Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
fc836e04
Verified
Commit
fc836e04
authored
May 20, 2022
by
Andrey Vertiprahov
Browse files
Replace import.
parent
999e5483
Pipeline
#36304
failed with stages
in 6 minutes and 57 seconds
Changes
52
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
aaa/models/group.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
Group
(
Model
):
class
Meta
(
object
):
verbose_name
=
"Group"
verbose_name_plural
=
"Groups"
...
...
aaa/models/permission.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
Permission
(
Model
):
"""
Permissions.
...
...
aaa/models/user.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
User
(
Model
):
class
Meta
(
object
):
verbose_name
=
"User"
verbose_name_plural
=
"Users"
...
...
aaa/models/usercontact.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
UserContact
(
Model
):
class
Meta
(
object
):
verbose_name
=
"User Profile Contact"
verbose_name_plural
=
"User Profile Contacts"
...
...
cm/models/objectnotify.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
ObjectNotify
(
Model
):
class
Meta
(
object
):
app_label
=
"cm"
db_table
=
"cm_objectnotify"
...
...
dns/models/dnsserver.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
DNSServer
(
Model
):
"""
DNS Server is an database object representing real DNS server.
...
...
dns/models/dnszone.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
DNSZone
(
Model
):
"""
DNS Zone
"""
...
...
dns/models/dnszoneprofile.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
DNSZoneProfile
(
Model
):
"""
DNS Zone profile is a set of common parameters, shared between zones.
...
...
dns/models/dnszonerecord.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
DNSZoneRecord
(
Model
):
"""
Zone RRs
"""
...
...
fm/models/alarmtrigger.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
AlarmTrigger
(
Model
):
class
Meta
(
object
):
db_table
=
"fm_alarmtrigger"
app_label
=
"fm"
...
...
fm/models/eventtrigger.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
EventTrigger
(
Model
):
class
Meta
(
object
):
db_table
=
"fm_eventtrigger"
app_label
=
"fm"
...
...
fm/models/ignoreeventrules.py
View file @
fc836e04
...
...
@@ -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"
...
...
ip/models/address.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
Address
(
Model
):
class
Meta
(
object
):
verbose_name
=
_
(
"Address"
)
verbose_name_plural
=
_
(
"Addresses"
)
...
...
ip/models/addressrange.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
AddressRange
(
Model
):
class
Meta
(
object
):
verbose_name
=
_
(
"Address Range"
)
db_table
=
"ip_addressrange"
...
...
ip/models/prefix.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
Prefix
(
Model
):
"""
Allocated prefix
"""
...
...
ip/models/prefixaccess.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
PrefixAccess
(
Model
):
class
Meta
(
object
):
verbose_name
=
_
(
"Prefix Access"
)
verbose_name_plural
=
_
(
"Prefix Access"
)
...
...
ip/models/prefixbookmark.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
PrefixBookmark
(
Model
):
"""
User Bookmarks
"""
...
...
ip/models/vrf.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
VRF
(
Model
):
"""
VRF
"""
...
...
ip/models/vrfgroup.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
VRFGroup
(
Model
):
"""
Group of VRFs with common properties
"""
...
...
kb/models/kbentry.py
View file @
fc836e04
...
...
@@ -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
(
NOC
Model
):
class
KBEntry
(
Model
):
"""
KB Entry
"""
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment