Package backend :: Package server :: Package rhnSQL :: Module sql_row :: Class Row
[hide private]
[frames] | no frames]

Class Row

source code


This class allows one to work with the columns of a particular row in a more convenient manner (ie, using a disctionary interface). It allows for the row data to be loaded and saved and is generally easier to use than the Table class which is really designed for bulk updates and stuff like that.

The easiest way to separate what these things are for is to remember that the Table class indexes by KEY, while the Row class indexes by column

Instance Methods [hide private]
 
__init__(self, db, table, hashname, hashval=None) source code
 
__repr__(self) source code
 
__str__(self) source code
 
__setitem__(self, name, value)
make it work like a dictionary
source code
 
__getitem__(self, name) source code
 
get(self, name) source code
 
reset(self, val=0)
reset the changed status for these entries
source code
 
create(self, hashval)
create it as a new entry
source code
 
load(self, hashval)
load an entry
source code
 
load_sql(self, sql, pdict={})
load from a sql clause
source code
 
save(self, with_updates=1)
now save an entry
source code

Inherited from rhn.UserDictCase.UserDictCase: __contains__, __delitem__, __getstate__, __iter__, __setstate__, clear, dict, get_hash, has_key, items, keys, update

Inherited from UserDict.UserDict: __cmp__, __len__, copy, iteritems, iterkeys, itervalues, pop, popitem, setdefault, values

Class Methods [hide private]

Inherited from UserDict.UserDict: fromkeys

Class Variables [hide private]

Inherited from UserDict.UserDict: __hash__

Method Details [hide private]

__init__(self, db, table, hashname, hashval=None)
(Constructor)

source code 
Overrides: UserDict.UserDict.__init__

__repr__(self)
(Representation operator)

source code 
Overrides: UserDict.UserDict.__repr__

__setitem__(self, name, value)
(Index assignment operator)

source code 

make it work like a dictionary

Overrides: UserDict.UserDict.__setitem__

__getitem__(self, name)
(Indexing operator)

source code 
Overrides: UserDict.UserDict.__getitem__

get(self, name)

source code 
Overrides: UserDict.UserDict.get