Verified Commit fc836e04 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Replace import.

parent 999e5483
Pipeline #36304 failed with stages
in 6 minutes and 57 seconds
......@@ -6,15 +6,15 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.main.models.databasestorage import database_storage
from noc.kb.models.kbentry import KBEntry
class KBEntryAttachment(NOCModel):
class KBEntryAttachment(Model):
"""
Attachments
"""
......
......@@ -6,15 +6,15 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.kb.models.kbentry import KBEntry
class KBEntryHistory(NOCModel):
class KBEntryHistory(Model):
"""
Modification History
"""
......
......@@ -6,15 +6,15 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.kb.models.kbentry import KBEntry
class KBEntryPreviewLog(NOCModel):
class KBEntryPreviewLog(Model):
"""
Preview Log
"""
......
......@@ -9,16 +9,16 @@
import re
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.fields import AutoCompleteTagsField
from noc.main.models.language import Language
from noc.services.web.apps.kb.parsers.loader import loader
class KBEntryTemplate(NOCModel):
class KBEntryTemplate(Model):
"""
KB Entry Template
"""
......
......@@ -6,15 +6,15 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.kb.models.kbentry import KBEntry
from noc.core.comp import smart_text
class KBGlobalBookmark(NOCModel):
class KBGlobalBookmark(Model):
"""
Global Bookmarks
@todo: Replace with boolean flag in KBEntry
......
......@@ -6,16 +6,16 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.kb.models.kbentry import KBEntry
from noc.core.comp import smart_text
class KBUserBookmark(NOCModel):
class KBUserBookmark(Model):
"""
User Bookmarks
"""
......
......@@ -9,14 +9,14 @@
import datetime
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
class Checkpoint(NOCModel):
class Checkpoint(Model):
"""
Checkpoint is a marked moment in time
"""
......
......@@ -11,6 +11,7 @@ from functools import reduce
import threading
# Third-party modules
from django.db.models.base import Model
from django.db import models, connection
from django.db.models import signals as django_signals
from django.apps import apps
......@@ -19,7 +20,6 @@ from mongoengine import fields
import mongoengine.signals
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.validators import is_int
from noc.core.comp import smart_text
from .customfieldenumgroup import CustomFieldEnumGroup
......@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
id_lock = threading.Lock()
class CustomField(NOCModel):
class CustomField(Model):
"""
Custom field description
"""
......
......@@ -6,17 +6,17 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
@on_delete_check(
check=[("main.CustomField", "enum_group"), ("main.CustomFieldEnumValue", "enum_group")]
)
class CustomFieldEnumGroup(NOCModel):
class CustomFieldEnumGroup(Model):
"""
Enumeration groups for custom fields
"""
......
......@@ -6,14 +6,14 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from .customfieldenumgroup import CustomFieldEnumGroup
class CustomFieldEnumValue(NOCModel):
class CustomFieldEnumValue(Model):
"""
Enumeration groups values
"""
......
......@@ -6,15 +6,15 @@
# ---------------------------------------------------------------------
# Third-party models
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.fields import BinaryField
from noc.lib.database_storage import DatabaseStorage as DBS
class DatabaseStorage(NOCModel):
class DatabaseStorage(Model):
"""
Database Storage
"""
......
......@@ -6,10 +6,10 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
......@@ -20,7 +20,7 @@ from noc.core.model.decorator import on_delete_check
("kb.KBEntryTemplate", "language"),
]
)
class Language(NOCModel):
class Language(Model):
"""
Language
"""
......
......@@ -9,14 +9,14 @@
import os
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.validators import check_extension, check_mimetype
class MIMEType(NOCModel):
class MIMEType(Model):
"""
MIME Type mapping
"""
......
......@@ -13,11 +13,11 @@ from threading import Lock
from typing import Tuple, Dict, Iterator
# Third-party modules
from django.db.models.base import Model
from django.db import models
import cachetools
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.settings import LANGUAGE_CODE
from noc.core.timepattern import TimePatternList
......@@ -56,7 +56,7 @@ USER_NOTIFICATION_METHOD_CHOICES = NOTIFICATION_METHOD_CHOICES
("peer.PeeringPoint", "prefix_list_notification_group"),
]
)
class NotificationGroup(NOCModel):
class NotificationGroup(Model):
"""
Notification Groups
"""
......@@ -223,7 +223,7 @@ class NotificationGroup(NOCModel):
yield MX_STREAMS[method], {"To": smart_bytes(param)}
class NotificationGroupUser(NOCModel):
class NotificationGroupUser(Model):
class Meta(object):
verbose_name = "Notification Group User"
verbose_name_plural = "Notification Group Users"
......@@ -247,7 +247,7 @@ class NotificationGroupUser(NOCModel):
)
class NotificationGroupOther(NOCModel):
class NotificationGroupOther(Model):
class Meta(object):
verbose_name = "Notification Group Other"
verbose_name_plural = "Notification Group Others"
......
......@@ -7,10 +7,10 @@
# Third-party modules
from typing import Union, List, Tuple, Iterable
from django.db.models.base import Model
from django.db import models
# NOC Modules
from noc.core.model.base import NOCModel
from noc.core.ip import IP
from noc.core.model.fields import CIDRField
from noc.core.model.decorator import on_delete_check
......@@ -25,7 +25,7 @@ from noc.core.translation import ugettext as _
],
clean_lazy_labels="prefixfilter",
)
class PrefixTable(NOCModel):
class PrefixTable(Model):
class Meta(object):
verbose_name = _("Prefix Table")
verbose_name_plural = _("Prefix Tables")
......@@ -80,7 +80,7 @@ class PrefixTable(NOCModel):
yield f"noc::prefixfilter::{pt.name}::{condition}"
class PrefixTablePrefix(NOCModel):
class PrefixTablePrefix(Model):
class Meta(object):
verbose_name = _("Prefix")
verbose_name_plural = _("Prefixes")
......
......@@ -9,17 +9,17 @@
import datetime
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
from noc.main.refbooks.downloaders.loader import loader
from .language import Language
@on_delete_check(check=[("main.RefBookField", "ref_book"), ("main.RefBookData", "ref_book")])
class RefBook(NOCModel):
class RefBook(Model):
"""
Reference Books
"""
......
......@@ -6,10 +6,10 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.fields import TextArrayField
from .refbook import RefBook
......@@ -24,7 +24,7 @@ class RBDManader(models.Manager):
return super().get_queryset().extra(order_by=["main_refbookdata.value[1]"])
class RefBookData(NOCModel):
class RefBookData(Model):
"""
Ref. Book Data
"""
......
......@@ -9,14 +9,14 @@
import re
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from .refbook import RefBook
class RefBookField(NOCModel):
class RefBookField(Model):
"""
Refbook fields
"""
......
......@@ -6,17 +6,17 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
@on_delete_check(
check=[("inv.Interface", "state"), ("vc.VC", "state"), ("main.ResourceState", "step_to")]
)
class ResourceState(NOCModel):
class ResourceState(Model):
class Meta(object):
verbose_name = "Resource State"
verbose_name_plural = "Resource States"
......
......@@ -10,11 +10,11 @@ from threading import Lock
import operator
# Third-party modules
from django.db.models.base import Model
from django.db import models
import cachetools
# NOC models
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
id_lock = Lock()
......@@ -46,7 +46,7 @@ id_lock = Lock()
("vc.L2DomainProfile", "style"),
]
)
class Style(NOCModel):
class Style(Model):
"""
CSS Style
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment