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