Changeset 766 for branches/4.x


Ignore:
Timestamp:
Jan 18, 2016, 6:22:35 PM (4 years ago)
Author:
cito
Message:

Minor doc fixes.

Location:
branches/4.x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.x/docs/contents/pg/db_wrapper.rst

    r763 r766  
    6767    :raises KeyError: the table does not have a primary key
    6868
    69 This method returns the primary key of a table. For composite primary
    70 keys, the return value will be a frozenset. Note that this raises a
     69This method returns the primary key of a table.  For composite primary
     70keys, the return value will be a frozenset.  Note that this raises a
    7171KeyError if the table does not have a primary key.
    7272
     
    298298    :raises ProgrammingError: no primary key or missing privilege
    299299
    300 This method is the basic mechanism to get a single row. It assumes
    301 that the key specifies a unique row. If *keyname* is not specified,
    302 then the primary key for the table is used. If *arg* is a dictionary
     300This method is the basic mechanism to get a single row.  It assumes
     301that the key specifies a unique row.  If *keyname* is not specified,
     302then the primary key for the table is used.  If *arg* is a dictionary
    303303then the value for the key is taken from it and it is modified to
    304304include the new values, replacing existing values where necessary.
     
    346346
    347347Similar to insert but updates an existing row.  The update is based on the
    348 OID value as munged by get or passed as keyword, or on the primary key of
    349 the table.  The dictionary is modified, if possible, to reflect any changes
    350 caused by the update due to triggers, rules, default values, etc.
     348OID value as munged by :meth:`DB.get` or passed as keyword, or on the primary
     349key of the table.  The dictionary is modified, if possible, to reflect any
     350changes caused by the update due to triggers, rules, default values, etc.
    351351
    352352Like insert, the dictionary is optional and updates will be performed
    353353on the fields in the keywords.  There must be an OID or primary key
    354354either in the dictionary where the OID must be munged, or in the keywords
    355 where it can be simply the string 'oid'.
     355where it can be simply the string ``'oid'``.
    356356
    357357query -- execute a SQL command string
     
    416416    :param dict d: optional dictionary of values
    417417    :rtype: None
     418    :raises ProgrammingError: table has no primary key,
     419        row is still referenced or missing privilege
    418420
    419421This method deletes the row from a table.  It deletes based on the OID value
    420 as munged by get or passed as keyword, or on the primary key of the table.
    421 The return value is the number of deleted rows (i.e. 0 if the row did not
    422 exist and 1 if the row was deleted).
     422as munged by :meth:`DB.get` or passed as keyword, or on the primary key of
     423the table.  The return value is the number of deleted rows (i.e. 0 if the
     424row did not exist and 1 if the row was deleted).
    423425
    424426truncate -- Quickly empty database tables
  • branches/4.x/pg.py

    r763 r766  
    669669        """Executes a SQL command string.
    670670
    671         This method simply sends a SQL query to the database. If the query is
     671        This method simply sends a SQL query to the database.  If the query is
    672672        an insert statement that inserted exactly one row into a table that
    673673        has OIDs, the return value is the OID of the newly inserted row.
    674674        If the query is an update or delete statement, or an insert statement
    675675        that did not insert exactly one row in a table with OIDs, then the
    676         number of rows affected is returned as a string. If it is a statement
     676        number of rows affected is returned as a string.  If it is a statement
    677677        that returns rows as a result (usually a select statement, but maybe
    678678        also an "insert/update ... returning" statement), this method returns
    679679        a pgqueryobject that can be accessed via getresult() or dictresult()
    680         or simply printed. Otherwise, it returns `None`.
     680        or simply printed.  Otherwise, it returns `None`.
    681681
    682682        The query can contain numbered parameters of the form $1 in place
    683         of any data constant. Arguments given after the query string will
    684         be substituted for the corresponding numbered parameter. Parameter
     683        of any data constant.  Arguments given after the query string will
     684        be substituted for the corresponding numbered parameter.  Parameter
    685685        values can also be given as a single list or tuple argument.
    686686
     
    873873        """Get a row from a database table or view.
    874874
    875         This method is the basic mechanism to get a single row.  The keyname
     875        This method is the basic mechanism to get a single row.  It assumes
    876876        that the key specifies a unique row.  If keyname is not specified
    877877        then the primary key for the table is used.  If arg is a dictionary
     
    985985
    986986        Similar to insert but updates an existing row.  The update is based
    987         on the OID value as munged by get or passed as keyword, or on the
     987        on the OID value as munged by get() or passed as keyword, or on the
    988988        primary key of the table.  The dictionary is modified, if possible,
    989989        to reflect any changes caused by the update due to triggers, rules,
     
    10761076
    10771077        This method deletes the row from a table.  It deletes based on the
    1078         OID value as munged by get or passed as keyword, or on the primary
     1078        OID value as munged by get() or passed as keyword, or on the primary
    10791079        key of the table.  The return value is the number of deleted rows
    10801080        (i.e. 0 if the row did not exist and 1 if the row was deleted).
Note: See TracChangeset for help on using the changeset viewer.