# Path: quick_reports_demo/main/models.py
# class Article(models.Model):
#     class Status:
#         DRAFT = 0
#         PUBLISHED = 1
#         CHOICES = [(DRAFT, "Draft"), (PUBLISHED, "Published")]
# 
#     title = models.CharField(max_length=190)
#     body = models.TextField()
#     slug = models.SlugField(max_length=190)
#     status = models.IntegerField(choices=Status.CHOICES, default=Status.DRAFT)
#     author = models.ForeignKey(User)
#     created_at = models.DateTimeField(default=timezone.now)
# 
#     objects = models.Manager()  # The default manager.
#     published_objects = PublishedArticleManager()
# 
#     class Meta:
#         ordering = ["-created_at"]
# 
#     def __unicode__(self):
#         return self.title
# 
# class Comment(models.Model):
#     article = models.ForeignKey(Article)
#     title = models.CharField(max_length=190)
#     text = models.TextField()
#     created_at = models.DateTimeField(default=timezone.now)
# 
#     class Meta:
#         ordering = ["-created_at"]
# 
#     def __unicode__(self):
#         return self.title
# 
#     class QuickReport():
#         date_field = "created_at"


from django.contrib import admin
from quick_reports_demo.main.models import Article, Comment

# Register your models here.

class ArticleAdmin(admin.ModelAdmin):

    def __init__(self, *args, **kwargs):
        super(ArticleAdmin, self).__init__(*args, **kwargs)


# Path: quick_reports_demo/main/models.py
# class Article(models.Model):
#     class Status:
#         DRAFT = 0
#         PUBLISHED = 1
#         CHOICES = [(DRAFT, "Draft"), (PUBLISHED, "Published")]
# 
#     title = models.CharField(max_length=190)
#     body = models.TextField()
#     slug = models.SlugField(max_length=190)
#     status = models.IntegerField(choices=Status.CHOICES, default=Status.DRAFT)
#     author = models.ForeignKey(User)
#     created_at = models.DateTimeField(default=timezone.now)
# 
#     objects = models.Manager()  # The default manager.
#     published_objects = PublishedArticleManager()
# 
#     class Meta:
#         ordering = ["-created_at"]
# 
#     def __unicode__(self):
#         return self.title
# 
# class Comment(models.Model):
#     article = models.ForeignKey(Article)
#     title = models.CharField(max_length=190)
#     text = models.TextField()
#     created_at = models.DateTimeField(default=timezone.now)
# 
#     class Meta:
#         ordering = ["-created_at"]
# 
#     def __unicode__(self):
#         return self.title
# 
#     class QuickReport():
#         date_field = "created_at"


# Path: quick_reports_demo/main/admin.py
from django.contrib import admin
from quick_reports_demo.main.models import Article, Comment


# Register your models here.

class ArticleAdmin(admin.ModelAdmin):

    def __init__(self, *args, **kwargs):
        super(ArticleAdmin, self).__init__(*args, **kwargs)


    list_display = ('pk', 'title', 'created_at', 'status')