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
fe5aaadc
"README.rst" did not exist on "3f91f2ac27ab6c6b7c030775df44ac15a0338de6"
Verified
Commit
fe5aaadc
authored
1 month ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix migration history to be complete
parent
461f89e1
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
AUTHORS.txt
+1
-0
1 addition, 0 deletions
AUTHORS.txt
favicon/__init__.py
+1
-1
1 addition, 1 deletion
favicon/__init__.py
favicon/migrations/0005_leftover_changes.py
+29
-0
29 additions, 0 deletions
favicon/migrations/0005_leftover_changes.py
favicon/models.py
+5
-3
5 additions, 3 deletions
favicon/models.py
with
36 additions
and
4 deletions
AUTHORS.txt
+
1
−
0
View file @
fe5aaadc
...
@@ -8,3 +8,4 @@ raphaa
...
@@ -8,3 +8,4 @@ raphaa
Michał Pasternak (mpasternak)
Michał Pasternak (mpasternak)
ZugBahnHof
ZugBahnHof
Natureshadow
Natureshadow
hansegucker
This diff is collapsed.
Click to expand it.
favicon/__init__.py
+
1
−
1
View file @
fe5aaadc
__version__
=
'
1.2
'
__version__
=
'
1.2
.1
'
This diff is collapsed.
Click to expand it.
favicon/migrations/0005_leftover_changes.py
0 → 100644
+
29
−
0
View file @
fe5aaadc
# Generated by Django 5.2.1 on 2025-05-23 09:38
import
favicon.models
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
favicon
'
,
'
0004_faviconimg_favicon_size_rel_unique
'
),
]
operations
=
[
migrations
.
AlterModelManagers
(
name
=
'
favicon
'
,
managers
=
[
],
),
migrations
.
AlterField
(
model_name
=
'
favicon
'
,
name
=
'
faviconImage
'
,
field
=
models
.
ImageField
(
upload_to
=
favicon
.
models
.
get_image_path
),
),
migrations
.
AlterField
(
model_name
=
'
faviconimg
'
,
name
=
'
faviconImage
'
,
field
=
models
.
ImageField
(
upload_to
=
favicon
.
models
.
get_image_path
),
),
]
This diff is collapsed.
Click to expand it.
favicon/models.py
+
5
−
3
View file @
fe5aaadc
...
@@ -30,6 +30,8 @@ if "shortcut icon" not in config or 32 not in config["shortcut icon"]:
...
@@ -30,6 +30,8 @@ if "shortcut icon" not in config or 32 not in config["shortcut icon"]:
image_path
=
getattr
(
settings
,
"
FAVICON_PATH
"
,
"
favicon
"
)
image_path
=
getattr
(
settings
,
"
FAVICON_PATH
"
,
"
favicon
"
)
def
get_image_path
():
return
image_path
def
pre_delete_image
(
sender
,
instance
,
**
kwargs
):
def
pre_delete_image
(
sender
,
instance
,
**
kwargs
):
instance
.
del_image
()
instance
.
del_image
()
...
@@ -37,7 +39,7 @@ def pre_delete_image(sender, instance, **kwargs):
...
@@ -37,7 +39,7 @@ def pre_delete_image(sender, instance, **kwargs):
class
Favicon
(
models
.
Model
):
class
Favicon
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
100
)
title
=
models
.
CharField
(
max_length
=
100
)
faviconImage
=
models
.
ImageField
(
upload_to
=
image_path
)
faviconImage
=
models
.
ImageField
(
upload_to
=
get_
image_path
)
isFavicon
=
models
.
BooleanField
(
default
=
True
)
isFavicon
=
models
.
BooleanField
(
default
=
True
)
...
@@ -94,7 +96,7 @@ class Favicon(models.Model):
...
@@ -94,7 +96,7 @@ class Favicon(models.Model):
new_favicons
.
append
(
fav
)
new_favicons
.
append
(
fav
)
if
new_favicons
:
if
new_favicons
:
FaviconImg
.
objects
.
bulk_create
(
new_favicons
,
ignore_conflicts
=
True
)
FaviconImg
.
objects
.
bulk_create
(
new_favicons
,
ignore_conflicts
=
True
)
return
list
(
favicons
)
+
new_favicons
return
list
(
favicons
)
+
new_favicons
def
__str__
(
self
):
def
__str__
(
self
):
...
@@ -127,7 +129,7 @@ class FaviconImg(models.Model):
...
@@ -127,7 +129,7 @@ class FaviconImg(models.Model):
faviconFK
=
models
.
ForeignKey
(
Favicon
,
on_delete
=
models
.
CASCADE
)
faviconFK
=
models
.
ForeignKey
(
Favicon
,
on_delete
=
models
.
CASCADE
)
size
=
models
.
IntegerField
()
size
=
models
.
IntegerField
()
rel
=
models
.
CharField
(
max_length
=
250
,
null
=
True
)
rel
=
models
.
CharField
(
max_length
=
250
,
null
=
True
)
faviconImage
=
models
.
ImageField
(
upload_to
=
image_path
)
faviconImage
=
models
.
ImageField
(
upload_to
=
get_
image_path
)
def
as_html
(
self
):
def
as_html
(
self
):
"""
Return a <link> tag forthis favicon image.
"""
"""
Return a <link> tag forthis favicon image.
"""
...
...
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