X-Git-Url: https://git.piment-noir.org/?p=webcomics.git;a=blobdiff_plain;f=comicsporn%2Fmodels.py;h=8cde6b13f4a2b4877086e034dd5db6059d3f97e6;hp=e162d0447e8a5383b4c9fc7c3ab930856c56a82c;hb=8e174089165882d8a20ce3e9d10fbba9711d3486;hpb=315e96d4c9aa127e9266eea5d45a90903f178b2a diff --git a/comicsporn/models.py b/comicsporn/models.py index e162d04..8cde6b1 100644 --- a/comicsporn/models.py +++ b/comicsporn/models.py @@ -7,7 +7,7 @@ from django.utils.translation import ugettext_lazy as _ # TODO: # - Create sensible default options with translation; # - Test the authentification framework; -# - Ensure pertinence of the comics building way : block by block; +# - Ensure relevance of the comics building way : block by block; # - Test upload to images file outside the DB ...; # - ... class Style(models.Model): @@ -17,10 +17,11 @@ class Style(models.Model): TAG_NAME_CHOICES = ( (_('MG'), _('Manga')), (_('HF'), _('Heroic Fantasy')), - ) + ) name = models.CharField(_('name'), max_length=30, choices=TAG_NAME_CHOICES) def __unicode__(self): return self.name + class Meta: verbose_name = _('Style') verbose_name_plural = _('Styles') @@ -32,15 +33,15 @@ class UserProfile(models.Model): is_author = models.BooleanField() """ The main difference is that the author have is own ads publisher - The default behaviour of class inheritance is to create OnetoOne relationship between parent and child + The default behavior of class inheritance is to create OnetoOne relationship between parent and child TODO: Which fields are required to interact with the ads publisher ? """ ADS_PUBLISHER_CHOICES = ( ('AS', 'Advert Stream'), ('TJ', 'Traffic Junky'), ) - ads_publisher = models.CharField(max_length=50, choices=ADS_PUBLISHER_CHOICES) - ads_publisher_login = models.CharField(max_length=50) + ads_publisher = models.CharField(_('Ads publisher'), max_length=50, choices=ADS_PUBLISHER_CHOICES) + ads_publisher_login = models.CharField(_('Ads publisher login'), max_length=50) class Meta: verbose_name = _('User profile') @@ -50,9 +51,9 @@ class UserProfile(models.Model): class Comic_block(models.Model): """ - Let's view a comics as an images serie + Let's view a comics as an images series """ - name = models.CharField(_('name'), max_length=50) # probably not useful, it's just simplier to assemble afterwards for author + name = models.CharField(_('name'), max_length=50) # probably not useful, it's just simplier to assemble afterwards for author number = models.IntegerField(_('number')) content = models.ImageField(upload_to='block_contents') # TODO: probably not useful @@ -75,7 +76,7 @@ class Comic(models.Model): A comic is build from N blocks, whatever they are The ManytoMany relationship is not really required but it much more reflect really : authors can share block between comic """ - title = models.CharField(max_length=50) + title = models.CharField(_('title'), max_length=50) rating = models.FloatField() is_online = models.BooleanField() publication_date = models.DateField(auto_now=True) @@ -85,4 +86,6 @@ class Comic(models.Model): return self.title class Meta: + verbose_name = _('Comic') + verbose_name_plural = _('Comics') ordering = ('title',)