Re: derived fields on a form

2007-05-17 Thread Yaron Buskilla
For Example : Class Student, Class Grade. Define a function to get this student average. Class Student(models.Model): name = models.Integer() def getAvrageGrades( self ): sum = 0 for grade in self.grades_set.all(): sum = sum + grade.grade totalGrades = self.grades_set.count() if(totalGrade

Re: derived fields on a form

2007-05-17 Thread 5264277-ew5264277
Hi, Thanks, could you give me an example ? Andrew > Hi Andrew, > > Calculated fields will not be stored in the database. > If you want to calculate something then create a function inside the > model which will return the expected result. > This function will calculate things about one or mor

Re: derived fields on a form

2007-05-17 Thread Yaron Buskilla
Hi Andrew, Calculated fields will not be stored in the database. If you want to calculate something then create a function inside the model which will return the expected result. This function will calculate things about one or more attributes of the model. Well if you do so, then you do not ne

Re: derived fields on a form

2007-05-17 Thread Yaron Buskilla
Hi Andrew, Calculated fields will not be stored in the database. If you want to calculate something then create a function inside the model which will return the expected result. This function will calculate things about one or more attributes of the model. Well if you do so, then you do not

derived fields on a form

2007-05-17 Thread 5264277-ew5264277
Hi All, Is it possible to have a value in a model class that is displayed as either a data entry box, or just plain text that does not have a corresponding entry in the database ? Lets say I have a list of numbers that I want to perform a calculations on (say the sum or average etc) how would I