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
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
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
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
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
5 matches
Mail list logo