noc.main.refbooks.refbooks

Package Contents

class noc.main.refbooks.refbooks.RB

Bases: noc.core.model.base.NOCModel

Reference Books

class Meta

Bases: object

app_label = main
verbose_name = Ref Book
verbose_name_plural = Ref Books
name
language
description
is_enabled
is_builtin
downloader
download_url
last_updated
next_update
refresh_interval

Check refbook has at least one searchable field

fields

Get fields names sorted by order

__str__(self)
add_record(self, data)

Add new record :param data: Hash of field name -> value :type data: Dict

flush_refbook(self)

Delete all records in ref. book

bulk_upload(self, data)

Bulk upload data to ref. book

Parameters:data (List) – List of hashes field name -> value
download(self)

Download refbook

class noc.main.refbooks.refbooks.RefBookField

Bases: noc.core.model.base.NOCModel

Refbook fields

class Meta

Bases: object

app_label = main
verbose_name = Ref Book Field
verbose_name_plural = Ref Book Fields
unique_together = [['ref_book', 'order'], ['ref_book', 'name']]
ordering = ['ref_book', 'order']
ref_book
name
order
is_required
description
search_method
rx_mac_3_octets
__str__(self)
get_extra(self, search)
search_string(self, search)

string search method

search_substring(self, search)

substring search method

search_starting(self, search)

starting search method

search_mac_3_octets_upper(self, search)

Match 3 first octets of the MAC address

class noc.main.refbooks.refbooks.Language

Bases: noc.core.model.base.NOCModel

Language

class Meta

Bases: object

app_label = main
db_table = main_language
verbose_name = Language
verbose_name_plural = Languages
ordering = ['name']
name
native_name
is_active
__str__(self)
noc.main.refbooks.refbooks.lang_cache
noc.main.refbooks.refbooks.get_language(name)
class noc.main.refbooks.refbooks.RefBook

Bases: object

name
language = English
description =
downloader
download_url
refresh_interval = 30
fields = []
classmethod sync(cls)

Syncronization :return:

class noc.main.refbooks.refbooks.Field(name, description=None, is_required=True, search_method=None)

Bases: object

RefBook fields