Package gavo :: Package svcs :: Module common :: Class QueryMeta
[frames] | no frames]

Class QueryMeta

source code

object --+    
         |    
      dict --+
             |
            QueryMeta

A class keeping information on the query environment.

It is constructed with a plain dictionary (there are alternative constructors for nevow contexts and requests are below) mapping certain keys (you'll currently have to figure out which from the source) to values, mostly strings, except for the keys listed in listKeys, which should be sequences of strings.

If you pass an empty dict, some sane defaults will be used. You can get that "empty" query meta as common.emptyQueryMeta, but make sure you don't mutate it.

QueryMetas constructed from request will have the user and password items filled out.

If you're using nevow formal, you should set the formal_data item to the dictionary created by formal. This will let people use the parsed parameters in templates.

Instance Methods
new empty dictionary

__init__(self, initArgs=None, defaultLimit=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
overrideDbOptions(self, sortKeys=None, limit=None, sortFallback=None, direction=None) source code
 
asSQL(self)
returns the dbLimit and dbSortKey values as an SQL fragment.
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Methods
 
fromNevowArgs(cls, nevowArgs, **kwargs)
constructs a QueryMeta from a nevow web arguments dictionary.
source code
 
fromRequest(cls, request, **kwargs)
constructs a QueryMeta from a nevow request.
source code
 
fromContext(cls, ctx, **kwargs)
constructs a QueryMeta from a nevow context.
source code
Class Variables
  metaKeys = set(['FORMAT', '_ADDITEM', '_FILTER', '_FORMAT', '_...
  listKeys = set(['_ADDITEM', '_DBOPTIONS_ORDER', '_SET'])

Inherited from dict: __hash__

Properties

Inherited from object: __class__

Method Details

__init__(self, initArgs=None, defaultLimit=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

fromRequest(cls, request, **kwargs)
Class Method

source code 

constructs a QueryMeta from a nevow request.

In addition to getting information from the arguments, this also sets user and password.


Class Variable Details

metaKeys

Value:
set(['FORMAT',
     '_ADDITEM',
     '_FILTER',
     '_FORMAT',
     '_OUTPUT',
     '_SET',
     '_TDENC',
     '_TIMEOUT',
...