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,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 .notificationgroup import NotificationGroup
class SystemNotification(NOCModel):
class SystemNotification(Model):
"""
System Notifications
"""
......
......@@ -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 .template import Template
class SystemTemplate(NOCModel):
class SystemTemplate(Model):
class Meta(object):
app_label = "main"
db_table = "main_systemtemplate"
......
......@@ -10,13 +10,13 @@ from threading import Lock
import operator
# Third-party modules
from django.db.models.base import Model
from django.db import models
from django.core.exceptions import ValidationError
import jinja2
import cachetools
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.model.decorator import on_delete_check
id_lock = Lock()
......@@ -49,7 +49,7 @@ def template_validator(value):
("maintenance.Maintenance", "template"),
]
)
class Template(NOCModel):
class Template(Model):
class Meta(object):
app_label = "main"
db_table = "main_template"
......
......@@ -11,10 +11,10 @@ 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.timepattern import TimePattern as TP
from noc.core.model.decorator import on_delete_check
......@@ -34,7 +34,7 @@ id_lock = Lock()
("sa.ManagedObject", "time_pattern"),
]
)
class TimePattern(NOCModel):
class TimePattern(Model):
"""
Time Patterns
"""
......
......@@ -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.timepattern import TimePattern as TP
from noc.core.model.decorator import on_init
from noc.core.change.decorator import change
......@@ -18,7 +18,7 @@ from .timepattern import TimePattern
@on_init
@change
class TimePatternTerm(NOCModel):
class TimePatternTerm(Model):
"""
Time pattern terms
"""
......
......@@ -10,11 +10,11 @@ import operator
from threading import Lock
# 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.core.model.decorator import on_delete_check
from noc.core.model.fields import DocumentReferenceField
from noc.main.models.glyph import Glyph
......@@ -47,7 +47,7 @@ id_lock = Lock()
("vc.VLAN", "project"),
]
)
class Project(NOCModel):
class Project(Model):
"""
Projects are used to track investment projects expenses and profits
"""
......
......@@ -10,21 +10,21 @@ import re
import shlex
# Third-party modules
from noc.core.translation import ugettext as _
from noc.core.model.fields import DocumentReferenceField
from django.contrib.postgres.fields import ArrayField
from django.db.models.base import Model
from django.db import models
from django.template import Template, Context
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.translation import ugettext as _
from noc.core.model.fields import DocumentReferenceField
from noc.aaa.models.permission import Permission
from noc.main.models.label import Label
from noc.inv.models.resourcegroup import ResourceGroup
@Label.model
class CommandSnippet(NOCModel):
class CommandSnippet(Model):
"""
Command snippet
"""
......
......@@ -6,16 +6,16 @@
# ----------------------------------------------------------------------
# Third-party 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.aaa.models.group import Group
from noc.core.translation import ugettext as _
from .administrativedomain import AdministrativeDomain
class GroupAccess(NOCModel):
class GroupAccess(Model):
class Meta(object):
verbose_name = _("Group Access")
verbose_name_plural = _("Group Access")
......
......@@ -39,7 +39,6 @@ from typing import Optional
from pydantic import BaseModel
# NOC modules
from noc.core.model.base import NOCModel
from noc.config import config
from noc.aaa.models.user import User
from noc.aaa.models.group import Group
......@@ -2177,7 +2176,7 @@ class ManagedObject(Model):
@on_save
class ManagedObjectAttribute(NOCModel):
class ManagedObjectAttribute(Model):
class Meta(object):
verbose_name = "Managed Object Attribute"
verbose_name_plural = "Managed Object Attributes"
......
......@@ -10,7 +10,7 @@ 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
from django.db.models import Q
......@@ -18,7 +18,7 @@ import cachetools
from psycopg2.extensions import adapt
# NOC modules
from noc.core.model.base import NOCModel
from noc.core.translation import ugettext as _
from noc.inv.models.vendor import Vendor
from noc.inv.models.platform import Platform
from noc.inv.models.firmware import Firmware
......@@ -49,7 +49,7 @@ id_lock = Lock()
("sa.ManagedObjectSelectorByAttribute", "selector"),
]
)
class ManagedObjectSelector(NOCModel):
class ManagedObjectSelector(Model):
class Meta(object):
verbose_name = _("Managed Object Selector")
verbose_name_plural = _("Managed Object Selectors")
......@@ -488,7 +488,7 @@ class ManagedObjectSelector(NOCModel):
return " and ".join(query)
class ManagedObjectSelectorByAttribute(NOCModel):
class ManagedObjectSelectorByAttribute(Model):
class Meta(object):
verbose_name = _("Managed Object Selector by Attribute")
db_table = "sa_managedobjectselectorbyattribute"
......
......@@ -6,18 +6,18 @@
# ----------------------------------------------------------------------
# Third-party 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.translation import ugettext as _
from noc.core.model.fields import DocumentReferenceField
from noc.main.models.notificationgroup import NotificationGroup
from noc.inv.models.resourcegroup import ResourceGroup
from noc.lib.template import render_message
class ObjectNotification(NOCModel):
class ObjectNotification(Model):
class Meta(object):
verbose_name = _("Managed Object Notification")
db_table = "sa_objectnotification"
......
......@@ -9,18 +9,18 @@
from functools import reduce
# 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.core.translation import ugettext as _
from noc.aaa.models.user import User
from .groupaccess import GroupAccess
from .administrativedomain import AdministrativeDomain
class UserAccess(NOCModel):
class UserAccess(Model):
class Meta(object):
verbose_name = _("User Access")
verbose_name_plural = _("User Access")
......
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