Changes between Initial Version and Version 1 of Ticket #28822


Ignore:
Timestamp:
11/20/2017 09:29:13 PM (20 months ago)
Author:
Ilya
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28822 – Description

    initial v1  
    99
    1010{{{
     11
    1112class Customer(models.Model):
    1213    first_name = models.CharField(max_length=255)
     
    5657What we suggest:
    5758
    58 cl
     59
    5960{{{
    60 ass Customer(models.Model):
     61
     62class Customer(models.Model):
    6163    first_name = models.CharField(max_length=255)
    6264    last_name = models.CharField(max_length=255)
    6365    age = models.IntegerField()
    64     allowed_to_drink = models.DBCalculatedField(Q(age__gt=18) models.BooleanField())
     66    allowed_to_drink = models.DBCalculatedField(Q(age__gt=18), models.BooleanField())
    6567}}}
    6668 
     
    6971
    7072I believe this syntax is much more clear and we have consensus about in on group:
    71 [https://groups.google.com/forum/#!topic/django-developers/ADSuUUuZp3Q
    72 ]
     73[https://groups.google.com/forum/#!topic/django-developers/ADSuUUuZp3Q]
    7374We may also have
    7475
     
    8182
    8283{{{
    83     allowed_to_drink = models.DBCalculatedField(Q(age__gt=18) models.BooleanField(), local=lambda c: c.age > 18)
     84    allowed_to_drink = models.DBCalculatedField(Q(age__gt=18), models.BooleanField(), local=lambda c: c.age > 18)
    8485
    8586# or
Back to Top