from .models import Country
from .models import Record
from .models import Podcast
-
+from .models import ConditionGrading
admin.site.register(Gallery)
admin.site.register(Grading)
admin.site.register(Country)
admin.site.register(Record)
admin.site.register(Podcast)
+admin.site.register(ConditionGrading)
published = models.IntegerField()
class Meta:
+ verbose_name = 'OLD_Gallery'
managed = False
db_table = 'gallery'
nom = models.CharField(max_length=5)
class Meta:
+ verbose_name = 'OLD_Grading'
managed = False
db_table = 'grading'
published = models.IntegerField()
class Meta:
+ verbose_name = 'OLD_Links'
managed = False
db_table = 'links'
published = models.IntegerField()
class Meta:
+ verbose_name = 'OLD_Mix'
+ verbose_name_plural = 'OLD_Mixes'
managed = False
db_table = 'mix'
published = models.IntegerField()
class Meta:
+ verbose_name = 'OLD_News'
+ verbose_name_plural = 'OLD_News'
managed = False
db_table = 'news'
published = models.IntegerField()
class Meta:
+ verbose_name = 'OLD_Shop'
managed = False
db_table = 'shop'
published = models.IntegerField()
class Meta:
+ verbose_name = 'OLD_Theme'
managed = False
db_table = 'theme'
type = models.IntegerField()
class Meta:
+ verbose_name_plural = 'OLD_User'
managed = False
db_table = 'user'
class ConditionGrading(models.Model):
- name = models.CharField(_('name'), max_length=128)
+
abbr = models.CharField(_('abbreviation'), max_length=5, unique=True)
+ name = models.CharField(_('name'), max_length=128)
description = models.TextField(_('description'))
-
+ def __unicode__(self):
+ return " = ".join([self.abbr, self.name])
+
class Record(models.Model):
"""
Model for Record
# NEWS
news_list = [news for news in rec_models.News.objects.all()]
+# GRADING
+
+Grading_Dict = {
+ 'SS': {
+ 'name': "Still Sealed",
+ 'description': "in perfect condition, no wear"},
+ 'M' : {
+ 'name': "Mint" ,
+ 'description': "Still in new condition, no imperfections, a Perfect Copy !"},
+ 'NM' : {
+ 'name': "Near mint" ,
+ 'description': "Imperceptible wear, full vinyl gloss"},
+ 'EX' : {
+ 'name': "Excellent",
+ 'description': "Only very slight wear and paper scuffs, vinyl still glossy with very rare noise"},
+ 'VG++' : {
+ 'name': "Near Excellent",
+ 'description': "Light surface noise and wear but fairly minor, vinyl still plays nicely"},
+ 'VG+' : {
+ 'name': "Very Very Good",
+ 'description': "Evident groove wear or minor scuff marks, surface noise noticeable but does not really affect the playing"},
+ 'VG' : {
+ 'name': "Very Good",
+ 'description': "Wear and scuffs are more evident and many surface noises are noticeable"},
+ 'VG-' : {
+ 'name': "Good to Very Good",
+ 'description': "Heavy groove wear or scuffing, plays noisily"}
+ }
+
+
+count = 0
+for grade in rec_models.Grading.objects.all():
+ name = Grading_Dict[grade.nom]['name']
+ desc = Grading_Dict[grade.nom]['description']
+ obj, created = rec_models.ConditionGrading.objects.get_or_create(id=grade.id,
+ abbr=grade.nom,
+ name=name,
+ description=desc)
+ if created:
+ print "Create new GradingCondition : %s" % obj.name
+ count += 1
+
+print "%d fiches GradingCondition crées" % count
+
# SHOPS TO RECORDS
import HTMLParser
## """
## Model for Record
## """
-## # herited fields (from Product):
-## # title --> shop.titre
-## # categories --> shop.theme
-## # price --> shop.prix
-## # status --> shop.published
-
-## artiste = models.CharField(max_length=128)
-## new = models.IntegerField()
-## label = models.CharField(max_length=128)
-## date = models.CharField(max_length=8)
-## pays = models.CharField(max_length=128)
-## desc = models.TextField()
-## cover = models.IntegerField() # TODO : choices=GRADINGS)
-## vinyl = models.IntegerField() # TODO : choices=GRADING)
-## audio = FileField(_("Audio File"), max_length=200, format="media",
-## upload_to=upload_to("records.Record.audio", "audio/records"))