Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Django Favicon Plus Reloaded
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
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 Favicon Plus Reloaded
Commits
f592ebdf
Verified
Commit
f592ebdf
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Allow passing config dict to get_favicons
parent
e6b4ce1f
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Resolve "Optimise query count"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
favicon/models.py
+6
-3
6 additions, 3 deletions
favicon/models.py
with
6 additions
and
3 deletions
favicon/models.py
+
6
−
3
View file @
f592ebdf
...
@@ -60,16 +60,19 @@ class Favicon(models.Model):
...
@@ -60,16 +60,19 @@ class Favicon(models.Model):
verbose_name
=
'
Favicon
'
verbose_name
=
'
Favicon
'
verbose_name_plural
=
'
Favicons
'
verbose_name_plural
=
'
Favicons
'
def
get_favicons
(
self
,
update
=
False
):
def
get_favicons
(
self
,
update
=
False
,
config_override
=
None
):
"""
"""
Get all combinations of favicons as configured, creating mising ones.
Get all combinations of favicons as configured, creating mising ones.
Pass update=True to force re-generation of existing icons.
Pass update=True to force re-generation of existing icons.
"""
"""
# Use default config by default
if
config_override
is
None
:
config_override
=
config
# Get all combinations of favicon rels and sizes from config
# Get all combinations of favicon rels and sizes from config
query
=
Q
()
query
=
Q
()
for
rel
in
config
:
for
rel
in
config
_override
:
for
size
in
config
[
rel
]:
for
size
in
config
_override
[
rel
]:
query
|=
Q
(
rel
=
rel
,
size
=
size
)
query
|=
Q
(
rel
=
rel
,
size
=
size
)
# Get all existing favicons
# Get all existing favicons
...
...
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