wiki:functions

Functions defined in the ZSQLExtend Product

Functions intended for the use in Page Templates

Access to the database

  • ZSQLInlineSearch(_table = '...' ,fieldname = here.filename, _op_fieldname = '...')
    Searches in the given table (_table) in the given fieldname (replace fieldname with the name of the field, that contains the data that identifies the record) for the id of your object (here.filename) using the operator specified by _op_fieldname (again, replace fieldname; possible operators are for example eq (equals), ct (contains)). Returns an array with the results.
    Function
  • ZSQLisEmpty(record.fieldname)
    Returns True if the field is empty. Replace record with an record object for example returned by ZSQLInlineSearch() and fieldname with the name of the field you want to test.

  • ZSQLQuery(self, query, debug=None)
    Returns the result of a SQL query. query is an SQL expression. If debug is set, the ZSQLQuery call is written to a logfile.
  • ZSQLOptionsFromSearchList(self,fieldname,results,fieldName,valueName=None,start=None, multiple=<nowiki></nowiki>,startValue=None,additionalSelect="",size=None,linelen=None)
    generate select options form a search list
    es wird
    <select name=fieldname mutiple>
    <option value=startValue>start</option>
    <option value=result.fieldName>result.fieldValue</option>
    erzeugt.
    @parameter fieldname: Name fuer name-wert im select-tag
    @results results: Resultobject einer SQL-suche
    @parameter fieldName: Name des Feldes, das als value in den option-tag geschrieben werden soll.
    @parameter valueName: (optional) Name des Feldes, dass als im option-tag ausgegeben wird, default wert ist valueName=fieldName
    @start: (optional) falls zusaetzliches option tag erzeugt werden soll, gibt start an was im option tag steht
    @startValue: gibt den entsprechenden Wert an.
  • ZSQLOptionsFromCRList(self,fieldname,listField, multiple=<nowiki></nowiki>,start=None,startValue=None,size=None,selected=None)
    generate select oprions form a cr seperated list
    fieldname: name of the field, that is the value of the value-attribute of the option-tag
    listField: a string of the following form:
    listitem1\nlistitem2\nlistitem3

Helpers for Navigation

  • nextLink(self,html,storename="foundCount")
    generates the link to the next max results
    max is defined by the parameter -max.
    E.g. in the search-formular (<nowiki><input type="hidden" name="-max" value="50"></nowiki>
    or in the ZSQLFind-call (tal:define="founds python:here.ZSQLFind(_max=50)").

Additonal helpers

Functions internally used

Last modified 17 years ago Last modified on Mar 6, 2007, 10:45:48 AM