Try to add function 'quota_ore' below.
On Aug 19, 3:03 am, djnubbio <[email protected]> wrote:
> Sorry for wasting your preciuose time. I'm very newby in django.
>
> I have de following
>
> class Commessa(models.Model):
> commessa = models.CharField(max_length=20)
> quota_oraria=models.DecimalField(max_digits=5, decimal_places=2)
> ...
>
def quota_ore(self):
self.quota_oraria * sum([d.ore for d in self.diario_set.all()])
> class Diario(models.Model):
> data= models.DateField('data inizio')
> commessa = models.ForeignKey(Commessa)
> ore=models.IntegerField()
> ...
>
> I want to add a column to Commessa containg the result of:
>
> quota_oraria * sum(ore)
>
Widoyo
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.