Changes between Version 17 and Version 18 of S3/S3ResourceFilter


Ignore:
Timestamp:
05/11/12 10:49:23 (13 years ago)
Author:
Fran Boon
Comment:

S3QueryField -> S3FieldSelector

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3ResourceFilter

    v17 v18  
    4444== Field Selectors ==
    4545
    46 S3ResourceQuery instances are based on S3QueryField field selectors. A field selector is a string with the so-called "list_fields syntax":
     46S3ResourceQuery instances are based on S3FieldSelector, which is a string with the so-called "list_fields syntax":
    4747
    4848{{{
     
    5454  - '''field''' is the name of the field or a virtual field in the table addressed by ''alias'' (plus ''foreign key'' where present).
    5555
    56 To access fields in a table which is linked via a link table, replace the fkey by the link table name and add left and right key if needed:
     56To access fields in a table which is linked via a link table, replace the fkey by the link table name and add left and right key if not already specified by add_component:
    5757{{{
    5858alias.{{lkey:}linktable{:rkey}$}field
     
    6565
    6666lkey and rkey ''can'' be omitted if they are not ambiguous, i.e. if there's only one option each.
     67
    6768== URL queries ==
    6869
     
    116117== Extending filters at the back-end ==
    117118
    118 S3QueryField instances can also be generated at the back-end, simply by:
     119S3FieldSelector instances can also be generated at the back-end, simply by:
    119120
    120121{{{
    121 selector = S3QueryField(<field selector>)
     122selector = S3FieldSelector(<field selector>)
    122123}}}
    123124
     
    125126
    126127{{{
    127 afilter = S3QueryField("person.first_name") == "Dominic"
    128 bfilter = ~(S3QueryField("person.first_name").like("Dominic"))  # negation by ~ operator
     128afilter = S3FieldSelector("person.first_name") == "Dominic"
     129bfilter = ~(S3FieldSelector("person.first_name").like("Dominic"))  # negation by ~ operator
    129130}}}
    130131
     
    147148
    148149{{{
    149 cfilter = (S3QueryField("person.first_name") == "Dominic") & (S3QueryField("contact.value") == "dominic@nursix.org")
     150cfilter = (S3FieldSelector("person.first_name") == "Dominic") & (S3FieldSelector("contact.value") == "dominic@nursix.org")
    150151}}}
    151152
     
    155156
    156157{{{
    157 myfilter = S3QueryField("person.first_name") == "Dominic"
     158myfilter = S3FieldSelector("person.first_name") == "Dominic"
    158159resource.add_filter(myfilter)
    159160}}}