Package eoxserver :: Package core :: Module records :: Class RecordWrapper
[hide private]
[frames] | no frames]

Class RecordWrapper

source code


This is a common base class for :class:`RecordWrapperInterface` implementations. Concrete implementations may derive from it overriding the respective methods.
Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getType(self)
This method shall return the type of record the wrapper represents.
source code
 
setRecord(self, record)
Assign the model record ``record`` to the instance.
source code
 
setAttrs(self, **kwargs)
Assign the attributes given as keyword arguments to the instance.
source code
 
sync(self, fetch_existing=False) source code
 
getRecord(self, fetch_existing=False)
Get the model record wrapped by the instance (i.e.
source code
 
delete(self, commit=True)
Delete the model record wrapped by the instance from the database and perform any additional logic related to the deletion.
source code
 
_validate_record(self, record) source code
 
_set_record(self, record) source code
 
_validate_attrs(self, **kwargs) source code
 
_set_attrs(self, **kwargs) source code
 
_fetch_unique_record(self) source code
 
_fetch(self, *fields) source code
 
_get_query(self, fields=None) source code
 
_get_query_set(self, query) source code
 
_create_record(self) source code
 
_pre_delete(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

getType(self)

source code 
This method shall return the type of record the wrapper represents. Raises :exc:`~.InternalError` by default.

setRecord(self, record)

source code 
Assign the model record ``record`` to the instance. This method raises :exc:`~.InternalError` if the record does not validate.

setAttrs(self, **kwargs)

source code 
Assign the attributes given as keyword arguments to the instance. This method raises :exc:`~.InternalError` if attributes do not validate.

getRecord(self, fetch_existing=False)

source code 
Get the model record wrapped by the instance (i.e. an instance of a subclass of :class:`django.db.models.Model`). This method calls :meth:`sync` to fetch or create a record if none has been defined. The ``fetch_existing`` argument is parsed to :meth:`sync`.

delete(self, commit=True)

source code 
Delete the model record wrapped by the instance from the database and perform any additional logic related to the deletion. Do nothing if there is no model record defined. See :meth:`ResourceWrapperInterface.delete` for a description of the ``commit`` parameter.