mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-12-25 06:22:23 +00:00
Merge branch 'drop_old_structure' into 'main'
Suppression de l'ancienne structure See merge request mediatek/med!6
This commit is contained in:
commit
b0a1602ea2
356
media/models.py
356
media/models.py
@ -114,71 +114,6 @@ class Book(Medium):
|
||||
verbose_name_plural = _("books")
|
||||
|
||||
|
||||
class OldComic(models.Model):
|
||||
isbn = ISBNField(
|
||||
_('ISBN'),
|
||||
help_text=_('You may be able to scan it from a bar code.'),
|
||||
unique=True,
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
title = models.CharField(
|
||||
verbose_name=_('title'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
subtitle = models.CharField(
|
||||
verbose_name=_('subtitle'),
|
||||
max_length=255,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
external_url = models.URLField(
|
||||
verbose_name=_('external URL'),
|
||||
blank=True,
|
||||
)
|
||||
|
||||
side_identifier = models.CharField(
|
||||
verbose_name=_('side identifier'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
authors = models.ManyToManyField(
|
||||
'Author',
|
||||
verbose_name=_('authors'),
|
||||
)
|
||||
|
||||
number_of_pages = models.PositiveIntegerField(
|
||||
verbose_name=_('number of pages'),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
publish_date = models.DateField(
|
||||
verbose_name=_('publish date'),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
present = models.BooleanField(
|
||||
verbose_name=_("present"),
|
||||
help_text=_("Tell that the medium is present in the Mediatek."),
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
if self.subtitle:
|
||||
return "{} : {}".format(self.title, self.subtitle)
|
||||
else:
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("comic")
|
||||
verbose_name_plural = _("comics")
|
||||
ordering = ['title', 'subtitle']
|
||||
|
||||
|
||||
class Comic(Book):
|
||||
class Meta:
|
||||
verbose_name = _("comic")
|
||||
@ -186,68 +121,6 @@ class Comic(Book):
|
||||
ordering = ['title', 'subtitle']
|
||||
|
||||
|
||||
class OldManga(models.Model):
|
||||
isbn = ISBNField(
|
||||
_('ISBN'),
|
||||
help_text=_('You may be able to scan it from a bar code.'),
|
||||
unique=True,
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
title = models.CharField(
|
||||
verbose_name=_('title'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
subtitle = models.CharField(
|
||||
verbose_name=_('subtitle'),
|
||||
max_length=255,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
external_url = models.URLField(
|
||||
verbose_name=_('external URL'),
|
||||
blank=True,
|
||||
)
|
||||
|
||||
side_identifier = models.CharField(
|
||||
verbose_name=_('side identifier'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
authors = models.ManyToManyField(
|
||||
'Author',
|
||||
verbose_name=_('authors'),
|
||||
)
|
||||
|
||||
number_of_pages = models.PositiveIntegerField(
|
||||
verbose_name=_('number of pages'),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
publish_date = models.DateField(
|
||||
verbose_name=_('publish date'),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
present = models.BooleanField(
|
||||
verbose_name=_("present"),
|
||||
help_text=_("Tell that the medium is present in the Mediatek."),
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("manga")
|
||||
verbose_name_plural = _("mangas")
|
||||
ordering = ['title']
|
||||
|
||||
|
||||
class Manga(Book):
|
||||
class Meta:
|
||||
verbose_name = _("manga")
|
||||
@ -255,68 +128,6 @@ class Manga(Book):
|
||||
ordering = ['title', 'subtitle']
|
||||
|
||||
|
||||
class OldNovel(models.Model):
|
||||
isbn = ISBNField(
|
||||
_('ISBN'),
|
||||
help_text=_('You may be able to scan it from a bar code.'),
|
||||
unique=True,
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
title = models.CharField(
|
||||
verbose_name=_('title'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
subtitle = models.CharField(
|
||||
verbose_name=_('subtitle'),
|
||||
max_length=255,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
external_url = models.URLField(
|
||||
verbose_name=_('external URL'),
|
||||
blank=True,
|
||||
)
|
||||
|
||||
side_identifier = models.CharField(
|
||||
verbose_name=_('side identifier'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
authors = models.ManyToManyField(
|
||||
'Author',
|
||||
verbose_name=_('authors'),
|
||||
)
|
||||
|
||||
number_of_pages = models.PositiveIntegerField(
|
||||
verbose_name=_('number of pages'),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
publish_date = models.DateField(
|
||||
verbose_name=_('publish date'),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
present = models.BooleanField(
|
||||
verbose_name=_("present"),
|
||||
help_text=_("Tell that the medium is present in the Mediatek."),
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("novel")
|
||||
verbose_name_plural = _("novels")
|
||||
ordering = ['title', 'subtitle']
|
||||
|
||||
|
||||
class Novel(Book):
|
||||
class Meta:
|
||||
verbose_name = _("novel")
|
||||
@ -324,45 +135,6 @@ class Novel(Book):
|
||||
ordering = ['title', 'subtitle']
|
||||
|
||||
|
||||
class OldVinyl(models.Model):
|
||||
title = models.CharField(
|
||||
verbose_name=_('title'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
side_identifier = models.CharField(
|
||||
verbose_name=_('side identifier'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
rpm = models.PositiveIntegerField(
|
||||
verbose_name=_('rounds per minute'),
|
||||
choices=[
|
||||
(33, _('33 RPM')),
|
||||
(45, _('45 RPM')),
|
||||
],
|
||||
)
|
||||
|
||||
authors = models.ManyToManyField(
|
||||
'Author',
|
||||
verbose_name=_('authors'),
|
||||
)
|
||||
|
||||
present = models.BooleanField(
|
||||
verbose_name=_("present"),
|
||||
help_text=_("Tell that the medium is present in the Mediatek."),
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("vinyl")
|
||||
verbose_name_plural = _("vinyls")
|
||||
ordering = ['title']
|
||||
|
||||
|
||||
class Vinyl(Medium):
|
||||
rpm = models.PositiveIntegerField(
|
||||
verbose_name=_('rounds per minute'),
|
||||
@ -378,37 +150,6 @@ class Vinyl(Medium):
|
||||
ordering = ['title']
|
||||
|
||||
|
||||
class OldCD(models.Model):
|
||||
title = models.CharField(
|
||||
verbose_name=_('title'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
side_identifier = models.CharField(
|
||||
verbose_name=_('side identifier'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
authors = models.ManyToManyField(
|
||||
'Author',
|
||||
verbose_name=_('authors'),
|
||||
)
|
||||
|
||||
present = models.BooleanField(
|
||||
verbose_name=_("present"),
|
||||
help_text=_("Tell that the medium is present in the Mediatek."),
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("CD")
|
||||
verbose_name_plural = _("CDs")
|
||||
ordering = ['title']
|
||||
|
||||
|
||||
class CD(Medium):
|
||||
class Meta:
|
||||
verbose_name = _("CD")
|
||||
@ -416,57 +157,6 @@ class CD(Medium):
|
||||
ordering = ['title']
|
||||
|
||||
|
||||
class OldReview(models.Model):
|
||||
title = models.CharField(
|
||||
verbose_name=_('title'),
|
||||
max_length=255,
|
||||
)
|
||||
|
||||
number = models.PositiveIntegerField(
|
||||
verbose_name=_('number'),
|
||||
)
|
||||
|
||||
year = models.PositiveIntegerField(
|
||||
verbose_name=_('year'),
|
||||
null=True,
|
||||
blank=True,
|
||||
default=None,
|
||||
)
|
||||
|
||||
month = models.PositiveIntegerField(
|
||||
verbose_name=_('month'),
|
||||
null=True,
|
||||
blank=True,
|
||||
default=None,
|
||||
)
|
||||
|
||||
day = models.PositiveIntegerField(
|
||||
verbose_name=_('day'),
|
||||
null=True,
|
||||
blank=True,
|
||||
default=None,
|
||||
)
|
||||
|
||||
double = models.BooleanField(
|
||||
verbose_name=_('double'),
|
||||
default=False,
|
||||
)
|
||||
|
||||
present = models.BooleanField(
|
||||
verbose_name=_("present"),
|
||||
help_text=_("Tell that the medium is present in the Mediatek."),
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.title + " n°" + str(self.number)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("review")
|
||||
verbose_name_plural = _("reviews")
|
||||
ordering = ['title', 'number']
|
||||
|
||||
|
||||
class Review(Borrowable):
|
||||
number = models.PositiveIntegerField(
|
||||
verbose_name=_('number'),
|
||||
@ -584,52 +274,6 @@ class Emprunt(models.Model):
|
||||
ordering = ['-date_emprunt']
|
||||
|
||||
|
||||
class OldGame(models.Model):
|
||||
DURATIONS = (
|
||||
('-1h', '-1h'),
|
||||
('1-2h', '1-2h'),
|
||||
('2-3h', '2-3h'),
|
||||
('3-4h', '3-4h'),
|
||||
('4h+', '4h+'),
|
||||
)
|
||||
|
||||
title = models.CharField(
|
||||
max_length=255,
|
||||
verbose_name=_("name"),
|
||||
)
|
||||
owner = models.ForeignKey(
|
||||
'users.User',
|
||||
on_delete=models.PROTECT,
|
||||
verbose_name=_("owner"),
|
||||
)
|
||||
duration = models.CharField(
|
||||
choices=DURATIONS,
|
||||
max_length=255,
|
||||
verbose_name=_("duration"),
|
||||
)
|
||||
players_min = models.IntegerField(
|
||||
validators=[MinValueValidator(1)],
|
||||
verbose_name=_("minimum number of players"),
|
||||
)
|
||||
players_max = models.IntegerField(
|
||||
validators=[MinValueValidator(1)],
|
||||
verbose_name=_('maximum number of players'),
|
||||
)
|
||||
comment = models.CharField(
|
||||
max_length=255,
|
||||
blank=True,
|
||||
verbose_name=_('comment'),
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.title)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("game")
|
||||
verbose_name_plural = _("games")
|
||||
ordering = ['title']
|
||||
|
||||
|
||||
class Game(Borrowable):
|
||||
DURATIONS = (
|
||||
('-1h', '-1h'),
|
||||
|
Loading…
Reference in New Issue
Block a user