# Path: wham/fields.py
# class WhamIntegerField(WhamFieldMixin, models.IntegerField):
# 
#     @property
#     def type_repr(self):
#         return 'integer'
# 
# class WhamTextField(WhamFieldMixin, models.TextField):
# 
#     @property
#     def type_repr(self):
#         return 'text'
# 
# class WhamManyToManyField(models.ManyToManyField):
# 
#     def __init__(self, *args, **kwargs):
#         self.wham_result_path = kwargs.pop('wham_result_path', None)
#         self.wham_endpoint = kwargs.pop('wham_endpoint', None)
#         self.wham_results_path = kwargs.pop('wham_results_path', ())
#         self.wham_pk_param = kwargs.pop('wham_pk_param', None)
#         self.wham_params = kwargs.pop('wham_params', {})
#         return super(WhamManyToManyField, self).__init__(*args, **kwargs)
# 
# 
# 
# 
#     @property
#     def type_repr(self):
#         return 'many to many'
# 
# class WhamDateTimeField(WhamFieldMixin, models.DateTimeField):
# 
#     def __init__(self, *args, **kwargs):
#         self.wham_format = kwargs.pop('wham_format', None)
#         return super(WhamDateTimeField, self).__init__(*args, **kwargs)
# 
# Path: wham/models.py
# FROM_LAST_ID = 'FROM_LAST_ID'
# 
# class WhamModel(models.Model):
# 
#     objects = WhamManager()
# 
#     class Meta():
#         abstract = True


from django.db import models
from django.template.loader import render_to_string
from wham.fields import WhamIntegerField, WhamTextField, WhamManyToManyField, \
    WhamDateTimeField
from wham.models import FROM_LAST_ID, WhamModel
        wham_endpoint='statuses/user_timeline',
        wham_pk_param='user_id',
        wham_params = {
            'count': 200,
            'exclude_replies': 'true',
            'include_rts': 'false',
        }
    )

    class Meta:
        db_table = 'twitter_user'

    class WhamMeta(TwitterMeta):
        endpoint = 'users/show'
        url_pk_type = 'querystring'
        url_pk_param = 'user_id'

        #https://api.twitter.com/1.1/users/show.json?screen_name=rsarver

    def __unicode__(self):
        return self.screen_name

# https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2

# https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2

class Tweet(WhamModel):

    id = WhamIntegerField(primary_key=True)
    text = WhamTextField()

# Path: wham/fields.py
# class WhamIntegerField(WhamFieldMixin, models.IntegerField):
# 
#     @property
#     def type_repr(self):
#         return 'integer'
# 
# class WhamTextField(WhamFieldMixin, models.TextField):
# 
#     @property
#     def type_repr(self):
#         return 'text'
# 
# class WhamManyToManyField(models.ManyToManyField):
# 
#     def __init__(self, *args, **kwargs):
#         self.wham_result_path = kwargs.pop('wham_result_path', None)
#         self.wham_endpoint = kwargs.pop('wham_endpoint', None)
#         self.wham_results_path = kwargs.pop('wham_results_path', ())
#         self.wham_pk_param = kwargs.pop('wham_pk_param', None)
#         self.wham_params = kwargs.pop('wham_params', {})
#         return super(WhamManyToManyField, self).__init__(*args, **kwargs)
# 
# 
# 
# 
#     @property
#     def type_repr(self):
#         return 'many to many'
# 
# class WhamDateTimeField(WhamFieldMixin, models.DateTimeField):
# 
#     def __init__(self, *args, **kwargs):
#         self.wham_format = kwargs.pop('wham_format', None)
#         return super(WhamDateTimeField, self).__init__(*args, **kwargs)
# 
# Path: wham/models.py
# FROM_LAST_ID = 'FROM_LAST_ID'
# 
# class WhamModel(models.Model):
# 
#     objects = WhamManager()
# 
#     class Meta():
#         abstract = True


# Path: wham/apis/twitter/models.py
from django.db import models
from django.template.loader import render_to_string
from wham.fields import WhamIntegerField, WhamTextField, WhamManyToManyField, \
    WhamDateTimeField
from wham.models import FROM_LAST_ID, WhamModel

        wham_endpoint='statuses/user_timeline',
        wham_pk_param='user_id',
        wham_params = {
            'count': 200,
            'exclude_replies': 'true',
            'include_rts': 'false',
        }
    )

    class Meta:
        db_table = 'twitter_user'

    class WhamMeta(TwitterMeta):
        endpoint = 'users/show'
        url_pk_type = 'querystring'
        url_pk_param = 'user_id'

        #https://api.twitter.com/1.1/users/show.json?screen_name=rsarver

    def __unicode__(self):
        return self.screen_name

# https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2

# https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2

class Tweet(WhamModel):

    id = WhamIntegerField(primary_key=True)
    text = WhamTextField()

    created_at = WhamDateTimeField(wham_format=CREATED_AT_FORMAT)