Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-iconify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
django-iconify
Commits
3a8bed9b
Verified
Commit
3a8bed9b
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Leave out optional attributes
Docs say there are defaults, but there aren't…
parent
a03e7505
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dj_iconify/types.py
+30
-23
30 additions, 23 deletions
dj_iconify/types.py
with
30 additions
and
23 deletions
dj_iconify/types.py
+
30
−
23
View file @
3a8bed9b
...
@@ -8,34 +8,41 @@ import json
...
@@ -8,34 +8,41 @@ import json
class
IconifyOptional
:
class
IconifyOptional
:
left
:
int
=
0
left
:
Optional
[
int
]
=
None
top
:
int
=
0
top
:
Optional
[
int
]
=
None
width
:
int
=
16
width
:
Optional
[
int
]
=
None
height
:
int
=
16
height
:
Optional
[
int
]
=
None
rotate
:
int
=
0
rotate
:
Optional
[
int
]
=
None
h_flip
:
bool
=
Fals
e
h_flip
:
Optional
[
bool
]
=
Non
e
v_flip
:
bool
=
Fals
e
v_flip
:
Optional
[
bool
]
=
Non
e
def
_as_dict_optional
(
self
)
->
dict
:
def
_as_dict_optional
(
self
)
->
dict
:
return
{
res
=
{}
"
left
"
:
self
.
left
,
if
self
.
left
is
not
None
:
"
top
"
:
self
.
top
,
res
[
"
left
"
]
=
self
.
left
"
width
"
:
self
.
width
,
if
self
.
top
is
not
None
:
"
height
"
:
self
.
height
,
res
[
"
top
"
]
=
self
.
top
"
rotate
"
:
self
.
rotate
,
if
self
.
width
is
not
None
:
"
hFlip
"
:
self
.
h_flip
,
res
[
"
width
"
]
=
self
.
width
"
vFlip
"
:
self
.
v_flip
,
if
self
.
height
is
not
None
:
}
res
[
"
height
"
]
=
self
.
height
if
self
.
rotate
is
not
None
:
res
[
"
rotate
"
]
=
self
.
rotate
if
self
.
h_flip
is
not
None
:
res
[
"
hFlip
"
]
=
self
.
h_flip
if
self
.
v_flip
is
not
None
:
res
[
"
vFlip
"
]
=
self
.
v_flip
return
res
def
_from_dict_optional
(
self
,
src
:
dict
)
->
None
:
def
_from_dict_optional
(
self
,
src
:
dict
)
->
None
:
self
.
left
=
src
.
get
(
"
left
"
,
None
)
or
self
.
left
self
.
left
=
src
.
get
(
"
left
"
,
None
)
self
.
top
=
src
.
get
(
"
top
"
,
None
)
or
self
.
top
self
.
top
=
src
.
get
(
"
top
"
,
None
)
self
.
width
=
src
.
get
(
"
width
"
,
None
)
or
self
.
width
self
.
width
=
src
.
get
(
"
width
"
,
None
)
self
.
height
=
src
.
get
(
"
height
"
,
None
)
or
self
.
height
self
.
height
=
src
.
get
(
"
height
"
,
None
)
self
.
rotate
=
src
.
get
(
"
rotate
"
,
None
)
or
self
.
rotate
self
.
rotate
=
src
.
get
(
"
rotate
"
,
None
)
self
.
h_flip
=
src
.
get
(
"
hFlip
"
,
None
)
or
self
.
h_flip
self
.
h_flip
=
src
.
get
(
"
hFlip
"
,
None
)
self
.
v_flip
=
src
.
get
(
"
vFlip
"
,
None
)
or
self
.
v_flip
self
.
v_flip
=
src
.
get
(
"
vFlip
"
,
None
)
class
IconifyIcon
(
IconifyOptional
):
class
IconifyIcon
(
IconifyOptional
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment