noc.main.models.customfield

Module Contents

noc.main.models.customfield.logger
noc.main.models.customfield.id_lock
class noc.main.models.customfield.CustomField

Bases: noc.core.model.base.NOCModel

Custom field description

class Meta

Bases: object

verbose_name = Custom Field
verbose_name_plural = Custom Fields
db_table = main_customfield
app_label = main
unique_together = [['table', 'name']]
table
name
is_active
label
type
description
max_length
regexp
is_indexed
is_searchable
is_filtered
is_hidden
enum_group
_cfields
_installed
_table_fields
is_table
db_column
index_name
db_create_statement
db_drop_statement
ext_model_field

Dict containing ExtJS model field description

ext_grid_column

Dict containing ExtJS grid column description

ext_form_field

Dict containing ExtJS form field description

__str__(self)
get_enums(self)

Return django-compatible choices or None :return:

get_field(self)

Return *Field instance

execute(self, sql)
activate_field(self)
deactivate_field(self)
create_index(self)
drop_index(self)
rename(self, old_name)
save(self, *args, **kwargs)

Create actual database field

delete(self, using=None)
model_class(self)

Return appropriate Model class

document_class(self)

Return appropriate document class

classmethod table_fields(cls, table)
classmethod install_fields(cls)

Install custom fields to models. Must be called after all models are initialized

install_field(self)

Install custom field to model

get_choices(self)

Returns django-compatible choices

classmethod table_search_Q(cls, table, query)
classmethod on_new_model(cls, sender, *args, **kwargs)
classmethod on_new_document(cls, sender, *args, **kwargs)