Re: dynamic forms and custom methods

2010-08-12 Thread Nick
I think jquery may be the right way to go for this. It will allow you to evaluate the weights in real time so you won't have to submit the form before any validation errors would be returned. Working it at the model level may get tricky, for ease I would handle it at the form or view level. On

Re: dynamic forms and custom methods

2010-08-12 Thread Steve Holden
On 8/12/2010 8:36 AM, lingrlongr wrote: > Hi Nick, > > Thanks for the reply. Yes, the department weights will be used in a > grading scheme. One department may be 25% (0.25), etc... But in the > end, the weights should total 1.0. For example, in my Store model: > > class Store(models.Model):

Re: dynamic forms and custom methods

2010-08-12 Thread lingrlongr
Hi Nick, Thanks for the reply. Yes, the department weights will be used in a grading scheme. One department may be 25% (0.25), etc... But in the end, the weights should total 1.0. For example, in my Store model: class Store(models.Model): #...etc... def _get_total_dept_weight(self):

Re: dynamic forms and custom methods

2010-08-11 Thread Nick
Are you trying to create a save function that evaluates all the weights and returns an error if they are more than 1? On Aug 10, 3:17 pm, lingrlongr wrote: > I 'm trying to create a form dynamically.  This works just fine, but > there's no way for the form to offer any

dynamic forms and custom methods

2010-08-10 Thread lingrlongr
I 'm trying to create a form dynamically. This works just fine, but there's no way for the form to offer any customized validation, by way of the clean() method. def get_dept_weight_form(store): fields = {} s = Store.objects.get(pk=store.id) for d in store.department_set.all():