Domande taggate «django-inheritance»

10
In Django - Model Inheritance - Ti consente di sovrascrivere l'attributo di un modello genitore?
Sto cercando di fare questo: class Place(models.Model): name = models.CharField(max_length=20) rating = models.DecimalField() class LongNamedRestaurant(Place): # Subclassing `Place`. name = models.CharField(max_length=255) # Notice, I'm overriding `Place.name` to give it a longer length. food_type = models.CharField(max_length=25) Questa è la versione che vorrei usare (anche se sono aperto a qualsiasi suggerimento): http://docs.djangoproject.com/en/dev/topics/db/models/#id7 …
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.