User Tools

Site Tools


zsqlexend_functions

Functions defined in the ZSQLExtend Product

  • 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='',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='',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
  • 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 (<input type="hidden" name="-max" value="50">
    or in the ZSQLFind-call (tal:define=“founds python:here.ZSQLFind(_max=50)”).
  • prevLink(self,html,storename=“foundCount”)
    generates the link to the previous max results (see above).
  • ZSQLRangeSize(self,storename=None)
    returns the number of results.
  • ZSQLRangeStart(self,storename=None)
    returns the number of the first result of the shown results.
  • ZSQLRangeEnd(self,storename=None)
    returns the number of the last result of the shown results.
zsqlexend_functions.txt · Last modified: 2020/10/10 14:13 by 127.0.0.1