Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-08-13 Thread Nick_B
Thanks for the advice Anton, > looks like you are using some additional layer before django.forms and > don't just create fields directly, so you may need to extend it too. > > Does anyone have any advice or references on extending my form to include an extra field? After searching and readi

Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-08-04 Thread Anton Baklanov
> > > > I am hoping to add an additional field, "Photographers" (from the > 'Photographer' model) to AForm so that users can select a Photographer to > become part of an instance of the 'A' model. > > Does that make sense? > yes, you need to add field and I'm guessing that ModelChoiceField will wo

Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-08-01 Thread Nick_B
Here are my models, if you are interested: class Photographer(models.Model): name = models.CharField(max_length=20) models = models.ManyToManyField('Model') class Model(models.Model): model = models.CharField(max_length=20, blank=False) series = models.Fore

Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-08-01 Thread Nick_B
Hi Anton, Thank you very much for your response. The 'fields_for_a' is generating the form fields for the instance of the model 'A'. The author admits that it might not be the prettiest implementation, but fully functional. def fields_for_a(instance): # generate a sorted dict of fields co

Re: Working with a Custom, Dynamic Form (using BaseForm)

2012-07-31 Thread Anton Baklanov
what is going on here: self.base_fields = fields_for_a(self.instance) ? On Tue, Jul 31, 2012 at 8:14 PM, Nick_B wrote: > Hi, > > Have hit a huge roadblock trying to implement a custom, dynamic form into > my django project. Although I am more familiar with using ModelForms, I > need to use

Working with a Custom, Dynamic Form (using BaseForm)

2012-07-31 Thread Nick_B
Hi, Have hit a huge roadblock trying to implement a custom, dynamic form into my django project. Although I am more familiar with using ModelForms, I need to use BaseForm to work with the structure I already have in place. I have a dictionary of objects inside of my Model 'Photographer' that I