# Path: apps/quotes/models.py
# class Quote(models.Model):
#     text = models.TextField()
#     timestamp = models.DateField(default=timezone.now)
#     subject = models.CharField(blank=True, max_length=200,
#         help_text='The person that was quoted.')
#     creator = models.CharField(blank=True, max_length=200,
#         help_text='The person that created the quote.')
#     broadcast = models.ForeignKey(Broadcast, blank=True, null=True, related_name='quotes')
#     game = models.ForeignKey(Game, blank=True, null=True, related_name='quoted_on')
# 
#     class Meta:
#         ordering = ['-timestamp']
# 
#     def __str__(self):
#         return '{}'.format(self.text)


from django.contrib import admin
from .models import Quote
# -*- coding: utf-8 -*-



class QuoteAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': ('text', ('timestamp', 'subject'),)}),
        ('Metadata', {'fields': ('creator', 'broadcast', 'game')})
    )
    list_display = ['text', 'timestamp', 'subject', 'creator', 'broadcast', 'game']

    raw_id_fields = ['broadcast', 'game']
    autocomplete_lookup_fields = {'fk': ['game']}

# Path: apps/quotes/models.py
# class Quote(models.Model):
#     text = models.TextField()
#     timestamp = models.DateField(default=timezone.now)
#     subject = models.CharField(blank=True, max_length=200,
#         help_text='The person that was quoted.')
#     creator = models.CharField(blank=True, max_length=200,
#         help_text='The person that created the quote.')
#     broadcast = models.ForeignKey(Broadcast, blank=True, null=True, related_name='quotes')
#     game = models.ForeignKey(Game, blank=True, null=True, related_name='quoted_on')
# 
#     class Meta:
#         ordering = ['-timestamp']
# 
#     def __str__(self):
#         return '{}'.format(self.text)


# Path: apps/quotes/admin.py
from django.contrib import admin
from .models import Quote

# -*- coding: utf-8 -*-



class QuoteAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': ('text', ('timestamp', 'subject'),)}),
        ('Metadata', {'fields': ('creator', 'broadcast', 'game')})
    )
    list_display = ['text', 'timestamp', 'subject', 'creator', 'broadcast', 'game']

    raw_id_fields = ['broadcast', 'game']
    autocomplete_lookup_fields = {'fk': ['game']}

admin.site.register(Quote, QuoteAdmin)