django - How do I use inline formsets to link two or more forms? -
I have the following models and I want to use them to generate a contact form ... now I know That I suppossed to use 'inline formats', but I have never been able to make head or tail of this work ... first name, last name, email, phone number, best time to contact me , And message in my opinion
class best time (models.Model): co Ntact_time = models.CharField (max_length = 20) start_time = models.TimeField () end_time = models.TimeField () def __unicode __ (self): return self.contact_time class customer (models.Model): date_time_added = models.DateTimeField (default = Datetime.today) first_name = models.charphield (max_length = 20) last_name = models.charphield (max_length = 20) email_address = models.charphield (max_length = 75) phone_number = models.charfield (max_length = 20) best_time_to_contact = models.ForeignKey (Best Time) def __unicode __ (self): return self.first_name class message type (models.Model): type = models.CharField (max_length = 20) def __unicode__ (self): back self. Type class messages (models.model): date_time_added = models.DateTimeField (default = datetime.today) message_type = model. Foreign key (messaging) customer = model. Foreign key (customer) message = model. TextField () def __unicode __ (self): return self.date_time_ad
I was able to answer this question
Comments
Post a Comment