# Path: wh_habitica/models.py
# class Habitica(models.Model):
#     """
#     Habitica API Endpoint
#     """
# 
#     user_id = models.CharField(_('User ID'), max_length=255, blank=True)
#     name = models.CharField(_('Name'), max_length=255, blank=True)
#     email = models.EmailField(_('Email'), blank=True)
#     api_token = models.CharField(_('API Token'), max_length=255, blank=True)
#     owner = models.OneToOneField(settings.AUTH_USER_MODEL, related_name='habitica')
# 
#     created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
#     modified_at = models.DateTimeField(_("Modified at"), auto_now=True)
# 
#     def get_api(self):
#         """
#         Returns the Habitica API object.
#         """
# 
#         return HabiticaApi(self.user_id, self.api_token)
# 
#     class Meta:
#         db_table = 'habitica_habitica'


from django.contrib import admin
from .models import Habitica



class HabiticaAdmin(admin.ModelAdmin):
    fieldsets = [
        (
            'Wunderlist',
            {'fields': ['user_id', 'name', 'email', 'api_token', 'owner', 'created_at', 'modified_at']}
        )
    ]
    readonly_fields = ['created_at', 'modified_at']
    list_display = ['user_id', 'name', 'email', 'owner', 'created_at', 'modified_at']



# Path: wh_habitica/models.py
# class Habitica(models.Model):
#     """
#     Habitica API Endpoint
#     """
# 
#     user_id = models.CharField(_('User ID'), max_length=255, blank=True)
#     name = models.CharField(_('Name'), max_length=255, blank=True)
#     email = models.EmailField(_('Email'), blank=True)
#     api_token = models.CharField(_('API Token'), max_length=255, blank=True)
#     owner = models.OneToOneField(settings.AUTH_USER_MODEL, related_name='habitica')
# 
#     created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
#     modified_at = models.DateTimeField(_("Modified at"), auto_now=True)
# 
#     def get_api(self):
#         """
#         Returns the Habitica API object.
#         """
# 
#         return HabiticaApi(self.user_id, self.api_token)
# 
#     class Meta:
#         db_table = 'habitica_habitica'


# Path: wh_habitica/admin.py
from django.contrib import admin
from .models import Habitica




class HabiticaAdmin(admin.ModelAdmin):
    fieldsets = [
        (
            'Wunderlist',
            {'fields': ['user_id', 'name', 'email', 'api_token', 'owner', 'created_at', 'modified_at']}
        )
    ]
    readonly_fields = ['created_at', 'modified_at']
    list_display = ['user_id', 'name', 'email', 'owner', 'created_at', 'modified_at']



admin.site.register(Habitica, HabiticaAdmin)