Changes between Version 18 and Version 19 of S3/S3REST/URLFormat


Ignore:
Timestamp:
08/15/11 10:52:09 (10 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3REST/URLFormat

    v18 v19  
    3434== Basic Query Format ==
    3535
    36 The basic query format is: '''resource'''.'''field'''{'''operator'''}='''value'''
     36The basic query format is: '''resource'''.{'''foreign key'''$}'''field'''{'''operator'''}='''value(s)'''
    3737
    38   * '''resource''' is the name of the resource or component (without prefix) or the name of the context
    39   * '''field''' is the name of the field to be tested
     38  * '''resource''' is the name of the resource or component (without prefix)
     39  * '''foreign key''' is the name of the foreign key field
     40  * '''field''' is the name of the field in the target table
    4041  * '''operator''' is the operator
    41   * '''value''' is the value or a comma-separated list of values to test against (a comma will be treated as OR)
     42  * '''value(s)''' is the value or a comma-separated list of values to test against (a comma will be treated as OR)
    4243
    4344Supported operators:
     
    5556  ||!__ex||negative containment, not contains(value)||list types only||
    5657
     58
    5759== Field Queries ==
    5860
    59   * Testing a field in the main resource
     61Field names in URL queries must be prefixed by the resource alias, followed by a "." dot, like:
     62
     63Master resource:
     64
    6065{{{
    6166/pr/person?person.first_name__like=Miriam
    6267}}}
    6368
    64 == Component Field Queries ==
     69Master resources use their table name without controller prefix as alias, whereas components can have a context-dependent alias (which must be used here).
    6570
    66   * Testing a field in a component resource
     71Component:
     72
    6773{{{
    6874/pr/person?address.city__like=Oslo
    6975}}}
    7076
    71 == Context Queries ==
     77Note that any component of the master resource can be queried, even if it is not addressed by the URL.
    7278
    73   * Testing a field in a referenced resource
    74   * Context must be specified like '''''context''.'''name'''={'''component'''.}'''field'''
    75     * '''name''' is a name for the context (as reference for subsequent queries)
    76     * '''component''' is the name of the component resource (without prefix)
    77     * '''field''' is the field name of the foreign key field
     79To query a field in a referenced record, append the foreign key field name followed by a "$" sign to the resource name prefix.
    7880
    7981{{{
    80 /pr/person?context.location=address.location_id&location.lat__gt=0
     82/pr/person?person.location_id$lat__lt=55.0
    8183}}}
     84
     85This required that the respective foreign key field is defined as "reference" or "list:reference" type.
    8286
    8387== Boundary Box Queries ==