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
......@@ -11,17 +11,18 @@ import operator
# Third-party modules
import cachetools
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
id_lock = Lock()
@on_delete_check(check=[("sa.GroupAccess", "group")])
class Group(NOCModel):
class Group(Model):
class Meta(object):
verbose_name = "Group"
verbose_name_plural = "Groups"
......
......@@ -10,11 +10,11 @@ from threading import Lock
import operator
# Third-party modules
from django.db.models.base import Model
from django.db.models import CharField, ManyToManyField
import cachetools
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.aaa.models.group import Group
......@@ -22,7 +22,7 @@ perm_lock = Lock()
id_lock = Lock()
class Permission(NOCModel):
class Permission(Model):
"""
Permissions.
......
......@@ -13,13 +13,13 @@ from typing import Optional
# Third-party modules
import cachetools
from django.db.models.base import Model
from django.db import models
from django.core import validators
from django.contrib.auth.hashers import check_password, make_password
# NOC modules
from noc.config import config
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
from noc.core.translation import ugettext as _
from noc.settings import LANGUAGES
......@@ -45,7 +45,7 @@ id_lock = Lock()
("bi.Dashboard", "owner"),
]
)
class User(NOCModel):
class User(Model):
class Meta(object):
verbose_name = "User"
verbose_name_plural = "Users"
......
......@@ -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.main.models.timepattern import TimePattern
from noc.main.models.notificationgroup import USER_NOTIFICATION_METHOD_CHOICES
from .user import User
class UserContact(NOCModel):
class UserContact(Model):
class Meta(object):
verbose_name = "User Profile Contact"
verbose_name_plural = "User Profile Contacts"
......
......@@ -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.main.models.notificationgroup import NotificationGroup
from noc.sa.models.administrativedomain import AdministrativeDomain
......@@ -17,7 +17,7 @@ OBJECT_TYPES = ["config", "dns", "prefix-list", "rpsl"]
OBJECT_TYPE_CHOICES = [(x, x) for x in OBJECT_TYPES if x != "config"]
class ObjectNotify(NOCModel):
class ObjectNotify(Model):
class Meta(object):
app_label = "cm"
db_table = "cm_objectnotify"
......
......@@ -6,20 +6,20 @@
# ---------------------------------------------------------------------
# Third-party modules modules
from noc.core.translation import ugettext as _
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_init
from noc.config import config
from noc.core.model.fields import INETField
from noc.core.change.decorator import change
from noc.core.translation import ugettext as _
@on_init
@change
class DNSServer(NOCModel):
class DNSServer(Model):
"""
DNS Server is an database object representing real DNS server.
......
......@@ -13,6 +13,7 @@ from threading import Lock
import operator
# Third-party modules
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
import cachetools
......@@ -20,7 +21,6 @@ import cachetools
# NOC modules
from noc.core.model.decorator import on_init
from noc.config import config
from noc.core.model.base import NOCModel
from noc.main.models.notificationgroup import NotificationGroup
from noc.main.models.systemnotification import SystemNotification
from noc.main.models.label import Label
......@@ -47,7 +47,7 @@ ZONE_REVERSE_IPV6 = "6"
@on_init
@change
@on_delete_check(check=[("dns.DNSZoneRecord", "zone")])
class DNSZone(NOCModel):
class DNSZone(Model):
"""
DNS Zone
"""
......
......@@ -10,12 +10,12 @@ from threading import Lock
import operator
# Third-party modules
from django.db.models.base import Model
from django.db import models
import cachetools
# NOC modules
from noc.config import config
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_init
from noc.main.models.notificationgroup import NotificationGroup
from noc.core.change.decorator import change
......@@ -29,7 +29,7 @@ id_lock = Lock()
@on_init
@change
@on_delete_check(check=[("dns.DNSZone", "profile")])
class DNSZoneProfile(NOCModel):
class DNSZoneProfile(Model):
"""
DNS Zone profile is a set of common parameters, shared between zones.
......
......@@ -9,11 +9,11 @@
from typing import Optional
# Third-party modules
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_init
from noc.core.change.decorator import change
from noc.core.translation import ugettext as _
......@@ -24,7 +24,7 @@ from .dnszone import DNSZone
@Label.model
@on_init
@change
class DNSZoneRecord(NOCModel):
class DNSZoneRecord(Model):
"""
Zone RRs
"""
......
......@@ -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 DocumentReferenceField
from noc.main.models.timepattern import TimePattern
from noc.main.models.notificationgroup import NotificationGroup
......@@ -17,7 +17,7 @@ from noc.main.models.template import Template
from noc.inv.models.resourcegroup import ResourceGroup
class AlarmTrigger(NOCModel):
class AlarmTrigger(Model):
class Meta(object):
db_table = "fm_alarmtrigger"
app_label = "fm"
......
......@@ -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 DocumentReferenceField
from noc.main.models.timepattern import TimePattern
from noc.main.models.notificationgroup import NotificationGroup
......@@ -17,7 +17,7 @@ from noc.main.models.template import Template
from noc.inv.models.resourcegroup import ResourceGroup
class EventTrigger(NOCModel):
class EventTrigger(Model):
class Meta(object):
db_table = "fm_eventtrigger"
app_label = "fm"
......
......@@ -6,13 +6,11 @@
# ---------------------------------------------------------------------
# Third-party modules
from django.db.models.base import Model
from django.db import models
# NOC modules
from noc.core.model.base import NOCModel
class IgnoreEventRules(NOCModel):
class IgnoreEventRules(Model):
class Meta(object):
app_label = "fm"
db_table = "fm_ignoreeventrules"
......
......@@ -7,13 +7,13 @@
# Third-party modules
from noc.core.translation import ugettext as _
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
# NOC modules
from noc.config import config
from noc.core.model.decorator import on_init
from noc.core.model.base import NOCModel
from noc.project.models.project import Project
from noc.sa.models.managedobject import ManagedObject
from noc.core.model.fields import INETField, MACField
......@@ -36,7 +36,7 @@ from .addressprofile import AddressProfile
@full_text_search
@workflow
@on_delete_check(check=[("ip.Address", "ipv6_transition")])
class Address(NOCModel):
class Address(Model):
class Meta(object):
verbose_name = _("Address")
verbose_name_plural = _("Addresses")
......
......@@ -7,12 +7,12 @@
# Third-party modules
from noc.core.translation import ugettext as _
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
from django.template import Template, Context
# NOC modules
from noc.core.model.base import NOCModel
from noc.config import config
from noc.core.model.fields import CIDRField
from noc.core.ip import IP
......@@ -25,7 +25,7 @@ from .vrf import VRF
@Label.model
@change
class AddressRange(NOCModel):
class AddressRange(Model):
class Meta(object):
verbose_name = _("Address Range")
db_table = "ip_addressrange"
......
......@@ -11,13 +11,13 @@ from threading import Lock
from collections import defaultdict
# Third-party modules
from django.db.models.base import Model
from django.db import models, connection
from django.contrib.postgres.fields import ArrayField
import cachetools
# NOC modules
from noc.config import config
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.project.models.project import Project
from noc.peer.models.asn import AS
......@@ -51,7 +51,7 @@ id_lock = Lock()
("ip.Address", "prefix"),
]
)
class Prefix(NOCModel):
class Prefix(Model):
"""
Allocated prefix
"""
......
......@@ -10,21 +10,21 @@ from functools import reduce
from collections import defaultdict
# Third-party modules
from noc.core.translation import ugettext as _
from django.db.models.base import Model
from django.db import models
from django.db.models import Q
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.core.model.fields import CIDRField
from noc.core.validators import check_ipv4_prefix, check_ipv6_prefix
from noc.core.model.sql import SQL
from noc.core.translation import ugettext as _
from .afi import AFI_CHOICES
from .vrf import VRF
class PrefixAccess(NOCModel):
class PrefixAccess(Model):
class Meta(object):
verbose_name = _("Prefix Access")
verbose_name_plural = _("Prefix Access")
......
......@@ -9,17 +9,17 @@
from operator import attrgetter
# Third-party modules
from noc.core.translation import ugettext as _
from django.db.models.base import Model
from django.db import models
from django.db.models import Q
# NOC modules
from noc.core.model.base import NOCModel
from noc.aaa.models.user import User
from noc.core.translation import ugettext as _
from .prefix import Prefix
class PrefixBookmark(NOCModel):
class PrefixBookmark(Model):
"""
User Bookmarks
"""
......
......@@ -10,14 +10,14 @@ import operator
from threading import Lock
# Third-party modules
from noc.core.translation import ugettext as _
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
import cachetools
# NOC modules
from .vrfgroup import VRFGroup
from noc.config import config
from noc.core.model.base import NOCModel
from noc.project.models.project import Project
from noc.core.validators import check_rd
from noc.core.model.fields import DocumentReferenceField
......@@ -26,10 +26,10 @@ from noc.main.models.label import Label
from noc.core.model.decorator import on_delete_check, on_init
from noc.vc.models.vpnprofile import VPNProfile
from noc.wf.models.state import State
from .vrfgroup import VRFGroup
from noc.core.wf.decorator import workflow
from noc.core.vpn import get_vpn_id
from noc.core.change.decorator import change
from noc.core.translation import ugettext as _
id_lock = Lock()
......@@ -54,7 +54,7 @@ id_lock = Lock()
],
clean_lazy_labels="ipvrf",
)
class VRF(NOCModel):
class VRF(Model):
"""
VRF
"""
......
......@@ -6,12 +6,12 @@
# ---------------------------------------------------------------------
# Third-party modules
from noc.core.translation import ugettext as _
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.translation import ugettext as _
from noc.core.model.decorator import on_delete_check
from noc.core.comp import smart_text
from noc.main.models.label import Label
......@@ -19,7 +19,7 @@ from noc.main.models.label import Label
@Label.model
@on_delete_check(check=[("ip.VRF", "vrf_group")])
class VRFGroup(NOCModel):
class VRFGroup(Model):
"""
Group of VRFs with common properties
"""
......
......@@ -10,11 +10,11 @@ import datetime
import difflib
# Third-party modules
from django.db.models.base import Model
from django.db import models
from django.contrib.postgres.fields import ArrayField
# NOC modules
from noc.core.model.base import NOCModel
from noc.main.models.language import Language
from noc.main.models.label import Label
from noc.services.web.apps.kb.parsers.loader import loader
......@@ -31,7 +31,7 @@ from noc.core.model.decorator import on_delete_check
("kb.KBEntryAttachment", "kb_entry"),
]
)
class KBEntry(NOCModel):
class KBEntry(Model):
"""
KB Entry
"""
......
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