-1
我有以下型號值的字段的默認Django管理
class Trivias(models.Model):
GIFT_CHOICES = (
('gas', 'Gasolina'),
('money', 'Dinero'),
('xp','Experiencia'),
)
NUMQ_CHOICES = (
(1, '1'),
(2, '2'),
(3, '3'),
(4, '4'),
)
idtrivias = models.IntegerField(primary_key=True)
url = models.CharField(max_length=450)
numQ = models.IntegerField(max_length=4,choices=NUMQ_CHOICES)
idtipospropiedades = models.ForeignKey(Tipospropiedades, db_column='idtipospropiedades')
idtitulos = models.ForeignKey(Titulos, db_column='idtitulos')
correct = models.IntegerField(max_length=1)
gift = models.CharField(max_length=5,choices=GIFT_CHOICES)
value = models.CharField(max_length=20)
class Meta:
db_table = u'trivias'
我想要的網址字段在Django管理的默認值,我可怎麼辦?
問候
用英文編寫代碼是一種很好的做法。 – 2012-03-02 20:26:27