# Path: wham/fields.py
# class WhamCharField(WhamFieldMixin, models.TextField):
# 
#     @property
#     def type_repr(self):
#         return 'char'
# 
# 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 WhamTextField(WhamFieldMixin, models.TextField):
# 
#     @property
#     def type_repr(self):
#         return 'text'
# 
# Path: wham/models.py
# class WhamModel(models.Model):
# 
#     objects = WhamManager()
# 
#     class Meta():
#         abstract = True


from django.db import models
from wham.fields import WhamCharField, WhamManyToManyField, WhamTextField
from wham.models import WhamModel
    name = WhamCharField(max_length=255, primary_key=True)

    top_artists = WhamManyToManyField(
        #http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=rj&api_key=a04961fe4330211ff149a949dfabef51&format=json
        'LastFmArtist',
        through='LastFmUserTopArtists',
        wham_endpoint='',
        wham_pk_param='user',
        wham_params={'method': 'user.gettopartists'},
        wham_results_path=('topartists', 'artist')
    )

    class Meta:
        db_table = 'lastfm_user'

    class WhamMeta(LastFmMeta):
        endpoint = ''
        detail_base_result_path = ('user',)
        params = {'method': 'user.getInfo'}
        url_pk_type = 'querystring'
        url_pk_param = 'user'

    def __unicode__(self):
        return self.name




class LastFmArtist(WhamModel):


# Path: wham/fields.py
# class WhamCharField(WhamFieldMixin, models.TextField):
# 
#     @property
#     def type_repr(self):
#         return 'char'
# 
# 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 WhamTextField(WhamFieldMixin, models.TextField):
# 
#     @property
#     def type_repr(self):
#         return 'text'
# 
# Path: wham/models.py
# class WhamModel(models.Model):
# 
#     objects = WhamManager()
# 
#     class Meta():
#         abstract = True


# Path: wham/apis/lastfm/models.py
from django.db import models
from wham.fields import WhamCharField, WhamManyToManyField, WhamTextField
from wham.models import WhamModel

    name = WhamCharField(max_length=255, primary_key=True)

    top_artists = WhamManyToManyField(
        #http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=rj&api_key=a04961fe4330211ff149a949dfabef51&format=json
        'LastFmArtist',
        through='LastFmUserTopArtists',
        wham_endpoint='',
        wham_pk_param='user',
        wham_params={'method': 'user.gettopartists'},
        wham_results_path=('topartists', 'artist')
    )

    class Meta:
        db_table = 'lastfm_user'

    class WhamMeta(LastFmMeta):
        endpoint = ''
        detail_base_result_path = ('user',)
        params = {'method': 'user.getInfo'}
        url_pk_type = 'querystring'
        url_pk_param = 'user'

    def __unicode__(self):
        return self.name




class LastFmArtist(WhamModel):


    name = WhamTextField(primary_key=True)