Base Classes

EntityModel

class ra.base.models.EntityModel(*args, **kwargs)[source]

The Main base for Ra static models Example: Client , Expense etc..

classmethod get_class_name()[source]

return the class name, usable when a ra model is mimicking (ie:proxying) another model. This method is used is get_doc_type_* functions, This method is made to avoid to repeat registered doc_type to make adjustments

classmethod get_doc_type_neuter_list()[source]

Returns List of Identified doctype that have a neuttral effect on the entity

classmethod get_model_name()[source]

A convenience method to get the base model name, needed in templates :return:

get_next_slug(suggestion=None)[source]

Get the next slug If it’s a new instance and the slug is not provided, we try and attempt a serial over the already added slugs in relation to the model :return:

get_pk_name()[source]

This is used to get the full name of the primary key, a bit hackish but is important for reports. :return:

classmethod get_redirect_url_prefix()[source]

Get the url for the change list of this model :return: a string url

classmethod get_report_list_url()[source]

Return the url for the report list for this model :return: a string url

get_title()[source]

A helper function to get a custom title of the instance if needed :return:

classmethod get_verbose_name_plural()[source]

A convenience method to get the base model verbose name, needed in templates :return:

save(force_insert=False, force_update=False, using=None, update_fields=None)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

TransactionModel

class ra.base.models.TransactionModel(*args, **kwargs)[source]
classmethod get_doc_type()[source]

Return the doc_type :return:

save(force_insert=False, force_update=False, using=None, update_fields=None)[source]

Custom save, it assign the user As owner and the last modifed it sets the doc_type make sure that dlc_date has correct timezone ?! :param force_insert: :param force_update: :param using: :param update_fields: :return:

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

TransactionItemModel

class ra.base.models.TransactionModel(*args, **kwargs)[source]
classmethod get_doc_type()[source]

Return the doc_type :return:

save(force_insert=False, force_update=False, using=None, update_fields=None)[source]

Custom save, it assign the user As owner and the last modifed it sets the doc_type make sure that dlc_date has correct timezone ?! :param force_insert: :param force_update: :param using: :param update_fields: :return:

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

QuantitativeTransactionItemModel

class ra.base.models.TransactionModel(*args, **kwargs)[source]
classmethod get_doc_type()[source]

Return the doc_type :return:

save(force_insert=False, force_update=False, using=None, update_fields=None)[source]

Custom save, it assign the user As owner and the last modifed it sets the doc_type make sure that dlc_date has correct timezone ?! :param force_insert: :param force_update: :param using: :param update_fields: :return:

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.