Code

Changes between Version 19 and Version 20 of DescriptorFields


Ignore:
Timestamp:
01/16/06 15:02:47 (8 years ago)
Author:
adrian
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DescriptorFields

    v19 v20  
    4141   if there is an ordering in the underlying query. The query is only done when a collection protocol is used.  
    4242   Sometimes, multiple queries will be used to save traffic, eg if you access reporter.article_set[10000:10020] and then reporter.article_set[:20]. 
    43  
    44 == Query syntax == 
    45  
    46 In further discussions about this idea, it seemed consistent that both the manager ( Person.objects ) and relationship end points, ({{{reporter.articles}}}) would act as lazy sets of instances (base class QuerySet?) , with these 'refinement' methods on them (filter, order_by, etc).  
    47  
    48 eg  
    49  
    50 {{{Person.objects.get_list()}}} 
    51 becomes  
    52 {{{Person.objects}}} 
    53  
    54 {{{Person.objects.get_list(name__startswith="R")}}} 
    55 becomes 
    56 {{{Person.objects.filter(name__startswith="R")}}} 
    57  
    58 Query sets would be combinable with the standard set operators, which would be less clumsy than the current complex= query syntax. 
    59 eg  
    60 {{{ar_list = Person.objects.get_list(complex=Q(name_startswith="R")|Q(name_startswith="A") ) }}} 
    61 goes to (idiosyncratically) 
    62  
    63 {{{ 
    64 people = Person.objects 
    65 ar_set = people.filter(name_startswith="R") | people.filter(name_startswith="A") 
    66 }}}