How can I compare the value of an aggregate with a list of results from a model

2012-10-25 Thread Érico Oliveira
my view: def comprar(request): if request.method == 'POST': form = FormComprar(request.POST) if form.is_valid(): form = form.save() retorno = 'Intenção de compra computada.' form = FormComprar() else: form = FormComprar() total

where the syntax error?

2013-01-14 Thread Érico Oliveira
class Imovel(models.Model): disponivel = models.BooleanField(choices=DISPO) data_venda = models.DateTimeField(auto_now_add=True, blank=True) def validaData(self): if self.data_venda < datetime.now - timedelta(days=2) <- -- You received this message because you are subscr

votes/score

2013-11-14 Thread Érico Oliveira
Hy, i'm learning django. My idea is to give marks / votes for a selected job. Works but not as I would. class Job(models.Model): title= models.CharField(max_length=20) slug = models.SlugField(max_length=40, blank=True) def __unicode__(self): return self.title class Vote(mod