repositories
/
webcomics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a comics taxonomy field.
[webcomics.git]
/
comicsporn
/
models.py
diff --git
a/comicsporn/models.py
b/comicsporn/models.py
index 0cea8c997e0274ae2acb65162a5bf9aa898c7dde..30248205e356666e4cdea88f0337f344a57c2971 100644
(file)
--- a/
comicsporn/models.py
+++ b/
comicsporn/models.py
@@
-1,15
+1,15
@@
-from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth.models import User
+from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_lazy as _
+
# A very basic data model to begin with
# TODO:
# - Create sensible default options with translation;
# - Test the authentification framework;
# A very basic data model to begin with
# TODO:
# - Create sensible default options with translation;
# - Test the authentification framework;
-# - Ensure
pertine
nce of the comics building way : block by block;
+# - Ensure
releva
nce of the comics building way : block by block;
# - Test upload to images file outside the DB ...;
# - ...
# - Test upload to images file outside the DB ...;
# - ...
-
class Style(models.Model):
"""
TODO: The choice list should be in DB
class Style(models.Model):
"""
TODO: The choice list should be in DB
@@
-17,10
+17,12
@@
class Style(models.Model):
TAG_NAME_CHOICES = (
(_('MG'), _('Manga')),
(_('HF'), _('Heroic Fantasy')),
TAG_NAME_CHOICES = (
(_('MG'), _('Manga')),
(_('HF'), _('Heroic Fantasy')),
+ (_('SF'), _('Science Fiction')),
)
name = models.CharField(_('name'), max_length=30, choices=TAG_NAME_CHOICES)
def __unicode__(self):
return self.name
)
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')
class Meta:
verbose_name = _('Style')
verbose_name_plural = _('Styles')
@@
-32,15
+34,15
@@
class UserProfile(models.Model):
is_author = models.BooleanField()
"""
The main difference is that the author have is own ads publisher
is_author = models.BooleanField()
"""
The main difference is that the author have is own ads publisher
- The default behavio
u
r 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 ?
"""
TODO: Which fields are required to interact with the ads publisher ?
"""
-
ADS_PUBLISHER_CHOICES = (
-
('AS', 'Advert Stream'),
-
('TJ', 'Traffic Junky'),
+ 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')
class Meta:
verbose_name = _('User profile')
@@
-50,9
+52,9
@@
class UserProfile(models.Model):
class Comic_block(models.Model):
"""
class Comic_block(models.Model):
"""
- Let's view a comics as an image
s serie
+ Let's view a comics as an image
series
"""
"""
- name = models.CharField(_('name'), max_length=50)
# probably not useful, it's just simpli
er to assemble afterwards for author
+ name = models.CharField(_('name'), max_length=50)
# probably not useful, it's just simpl
er to assemble afterwards for author
number = models.IntegerField(_('number'))
content = models.ImageField(upload_to='block_contents')
# TODO: probably not useful
number = models.IntegerField(_('number'))
content = models.ImageField(upload_to='block_contents')
# TODO: probably not useful
@@
-75,7
+77,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
"""
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)
rating = models.FloatField()
is_online = models.BooleanField()
publication_date = models.DateField(auto_now=True)
@@
-85,4
+87,6
@@
class Comic(models.Model):
return self.title
class Meta:
return self.title
class Meta:
+ verbose_name = _('Comic')
+ verbose_name_plural = _('Comics')
ordering = ('title',)
ordering = ('title',)