I have foreign key entries in my model that I'd like to use for my choicefields...now I'm not so sure how to go about this....my model file can be found here Basically I want have a choicefield for vehicle make, model, year, body style, exterior color and transmission. Since all of them work in the same way I just need someone to point me in the right direction then I'm all set.
class Model(models.Model):
model = models.CharField(max_length=15, blank=False)
manufacturer = models.ForeignKey(Manufacturer)
date_added = models.DateField()
def __unicode__(self):
name = ''+str(self.manufacturer)+" "+str(self.model)
return name
class BodyStyle(models.Model):
doors = models.PositiveSmallIntegerField()
passengers = models.PositiveSmallIntegerField()
style = models.CharField(max_length=15, blank=False)
def __unicode__(self):
name = str(self.doors)+" Door / "+str(self.passengers)+" Passenger / "+str(self.style)
return name