Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
Archweb
Commits
13eccfe6
Commit
13eccfe6
authored
May 20, 2017
by
Jelle van der Waa
🚧
Browse files
Stop using deprecated SubFieldBase
parent
c7681318
Changes
1
Hide whitespace changes
Inline
Side-by-side
mirrors/fields.py
View file @
13eccfe6
...
...
@@ -18,7 +18,6 @@ def to_python(self, value):
class
IPNetworkField
(
models
.
Field
):
__metaclass__
=
models
.
SubfieldBase
description
=
"IPv4 or IPv6 address or subnet"
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -43,3 +42,6 @@ def formfield(self, **kwargs):
defaults
=
{
'form_class'
:
IPNetworkFormField
}
defaults
.
update
(
kwargs
)
return
super
(
IPNetworkField
,
self
).
formfield
(
**
defaults
)
def
from_db_value
(
self
,
value
,
expression
,
connection
,
context
):
return
self
.
to_python
(
value
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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