# Path: shortener/linkmetrics/models.py
# class LinkLog(TimeStampedModel):
#     """
#         TODO - consider moving this to Redis or MongoDB
#     """
# 
#     link = models.ForeignKey(Link)
# 
#     http_accept_language = models.TextField(_("HTTP_ACCEPT_LANGUAGE"), blank=True)
#     http_host = models.CharField(_("HTTP_HOST"), max_length=255, blank=True)
#     http_referer = models.CharField(_("HTTP_REFERER"), max_length=255, blank=True)
#     http_user_agent = models.CharField(_("HTTP_USER_AGENT"), max_length=255, blank=True)
#     query_string = models.TextField(_("QUERY_STRING"), blank=True)
#     remote_addr = models.CharField(_("REMOTE_ADDR"), max_length=255, blank=True)
#     remote_host = models.CharField(_("REMOTE_HOST"), max_length=255, blank=True)
#     request_method = models.CharField(_("REQUEST_METHOD"), max_length=30, blank=True)
# 
#     objects = LingLogManager()
# 
#     def __unicode__(self):
#         return "{0}: {1}".format(
#             self.created,
#             self.link.original_url
#         )


from django.contrib import admin
from .models import LinkLog


class LinkLogAdmin(admin.ModelAdmin):
    
    readonly_fields = (
        "link", 
        "http_accept_language",
        "http_host",
        "http_referer",
        "http_user_agent",
        "query_string",
        "remote_addr",
        "remote_host",
        "request_method"
    )


# Path: shortener/linkmetrics/models.py
# class LinkLog(TimeStampedModel):
#     """
#         TODO - consider moving this to Redis or MongoDB
#     """
# 
#     link = models.ForeignKey(Link)
# 
#     http_accept_language = models.TextField(_("HTTP_ACCEPT_LANGUAGE"), blank=True)
#     http_host = models.CharField(_("HTTP_HOST"), max_length=255, blank=True)
#     http_referer = models.CharField(_("HTTP_REFERER"), max_length=255, blank=True)
#     http_user_agent = models.CharField(_("HTTP_USER_AGENT"), max_length=255, blank=True)
#     query_string = models.TextField(_("QUERY_STRING"), blank=True)
#     remote_addr = models.CharField(_("REMOTE_ADDR"), max_length=255, blank=True)
#     remote_host = models.CharField(_("REMOTE_HOST"), max_length=255, blank=True)
#     request_method = models.CharField(_("REQUEST_METHOD"), max_length=30, blank=True)
# 
#     objects = LingLogManager()
# 
#     def __unicode__(self):
#         return "{0}: {1}".format(
#             self.created,
#             self.link.original_url
#         )


# Path: shortener/linkmetrics/admin.py
from django.contrib import admin
from .models import LinkLog



class LinkLogAdmin(admin.ModelAdmin):
    
    readonly_fields = (
        "link", 
        "http_accept_language",
        "http_host",
        "http_referer",
        "http_user_agent",
        "query_string",
        "remote_addr",
        "remote_host",
        "request_method"
    )


admin.site.register(LinkLog, LinkLogAdmin)