sandwitches 1.3.1__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sandwitches-1.3.1 → sandwitches-1.4.0}/PKG-INFO +2 -1
- {sandwitches-1.3.1 → sandwitches-1.4.0}/pyproject.toml +2 -1
- sandwitches-1.4.0/src/sandwitches/admin.py +49 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/models.py +0 -21
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/settings.py +1 -0
- sandwitches-1.3.1/src/sandwitches/admin.py +0 -26
- {sandwitches-1.3.1 → sandwitches-1.4.0}/README.md +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/__init__.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/api.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/asgi.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/forms.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/locale/nl/LC_MESSAGES/django.mo +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/locale/nl/LC_MESSAGES/django.po +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0001_initial.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0002_historicalrecipe.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0003_rating.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0004_add_uploaded_by.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0005_historicalrecipe_uploaded_by.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0006_profile.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0007_alter_rating_score.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/__init__.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/storage.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/tasks.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/base.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/base_pico.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/detail.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/form.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/index.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/setup.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templates/signup.html +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templatetags/__init__.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/templatetags/markdown_extras.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/urls.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/views.py +0 -0
- {sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/wsgi.py +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sandwitches
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author: Martyn van Dijke
|
|
6
6
|
Author-email: Martyn van Dijke <martijnvdijke600@gmail.com>
|
|
7
7
|
Requires-Dist: django-debug-toolbar>=6.1.0
|
|
8
8
|
Requires-Dist: django-filter>=25.2
|
|
9
9
|
Requires-Dist: django-imagekit>=6.0.0
|
|
10
|
+
Requires-Dist: django-import-export>=4.3.14
|
|
10
11
|
Requires-Dist: django-ninja>=1.5.1
|
|
11
12
|
Requires-Dist: django-simple-history>=3.10.1
|
|
12
13
|
Requires-Dist: django-tasks>=0.10.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sandwitches"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.4.0"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -13,6 +13,7 @@ dependencies = [
|
|
|
13
13
|
"django-debug-toolbar>=6.1.0",
|
|
14
14
|
"django-filter>=25.2",
|
|
15
15
|
"django-imagekit>=6.0.0",
|
|
16
|
+
"django-import-export>=4.3.14",
|
|
16
17
|
"django-ninja>=1.5.1",
|
|
17
18
|
"django-simple-history>=3.10.1",
|
|
18
19
|
"django-tasks>=0.10.0",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from django.contrib import admin
|
|
2
|
+
from .models import Recipe, Tag, Rating
|
|
3
|
+
from django.utils.html import format_html
|
|
4
|
+
from import_export import resources
|
|
5
|
+
from import_export.admin import ImportExportModelAdmin
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RecipeResource(resources.ModelResource):
|
|
9
|
+
class Meta:
|
|
10
|
+
model = Recipe
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TagResource(resources.ModelResource):
|
|
14
|
+
class Meta:
|
|
15
|
+
model = Tag
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RatingResource(resources.ModelResource):
|
|
19
|
+
class Meta:
|
|
20
|
+
model = Rating
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@admin.register(Recipe)
|
|
24
|
+
class RecipeAdmin(ImportExportModelAdmin):
|
|
25
|
+
resource_classes = [RecipeResource]
|
|
26
|
+
list_display = ("title", "uploaded_by", "created_at", "show_url")
|
|
27
|
+
readonly_fields = ("created_at", "updated_at")
|
|
28
|
+
|
|
29
|
+
def save_model(self, request, obj, form, change):
|
|
30
|
+
# set uploaded_by automatically when creating in admin
|
|
31
|
+
if not change and not obj.uploaded_by:
|
|
32
|
+
obj.uploaded_by = request.user
|
|
33
|
+
super().save_model(request, obj, form, change)
|
|
34
|
+
|
|
35
|
+
def show_url(self, obj):
|
|
36
|
+
url = obj.get_absolute_url()
|
|
37
|
+
return format_html("<a href='{url}'>{url}</a>", url=url)
|
|
38
|
+
|
|
39
|
+
show_url.short_description = "Recipe Link" # ty:ignore[unresolved-attribute, inconsistent-mro]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@admin.register(Tag)
|
|
43
|
+
class TagAdmin(ImportExportModelAdmin):
|
|
44
|
+
resource_classes = [TagResource]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@admin.register(Rating)
|
|
48
|
+
class RatingAdmin(ImportExportModelAdmin):
|
|
49
|
+
resource_classes = [RatingResource]
|
|
@@ -18,27 +18,6 @@ hashed_storage = HashedFilenameStorage()
|
|
|
18
18
|
User = get_user_model()
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class Profile(models.Model):
|
|
22
|
-
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="profile")
|
|
23
|
-
avatar = models.ImageField(upload_to="avatars", blank=True, null=True)
|
|
24
|
-
avatar_thumbnail = ImageSpecField(
|
|
25
|
-
source="avatar",
|
|
26
|
-
processors=[ResizeToFill(100, 50)],
|
|
27
|
-
format="JPEG",
|
|
28
|
-
options={"quality": 60},
|
|
29
|
-
)
|
|
30
|
-
bio = models.TextField(blank=True)
|
|
31
|
-
created_at = models.DateTimeField(auto_now_add=True)
|
|
32
|
-
updated_at = models.DateTimeField(auto_now=True)
|
|
33
|
-
|
|
34
|
-
class Meta:
|
|
35
|
-
verbose_name = "Profile"
|
|
36
|
-
verbose_name_plural = "Profiles"
|
|
37
|
-
|
|
38
|
-
def __str__(self):
|
|
39
|
-
return f"{self.user.username}'s Profile" # ty:ignore[possibly-missing-attribute]
|
|
40
|
-
|
|
41
|
-
|
|
42
21
|
class Tag(models.Model):
|
|
43
22
|
name = models.CharField(max_length=50, unique=True)
|
|
44
23
|
slug = models.SlugField(max_length=60, unique=True, blank=True)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
from django.contrib import admin
|
|
2
|
-
from .models import Recipe, Tag, Rating, Profile
|
|
3
|
-
from django.utils.html import format_html
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@admin.register(Recipe)
|
|
7
|
-
class RecipeAdmin(admin.ModelAdmin):
|
|
8
|
-
list_display = ("title", "uploaded_by", "created_at", "show_url")
|
|
9
|
-
readonly_fields = ("created_at", "updated_at")
|
|
10
|
-
|
|
11
|
-
def save_model(self, request, obj, form, change):
|
|
12
|
-
# set uploaded_by automatically when creating in admin
|
|
13
|
-
if not change and not obj.uploaded_by:
|
|
14
|
-
obj.uploaded_by = request.user
|
|
15
|
-
super().save_model(request, obj, form, change)
|
|
16
|
-
|
|
17
|
-
def show_url(self, obj):
|
|
18
|
-
url = obj.get_absolute_url()
|
|
19
|
-
return format_html("<a href='{url}'>{url}</a>", url=url)
|
|
20
|
-
|
|
21
|
-
show_url.short_description = "Recipe Link" # ty:ignore[unresolved-attribute]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
admin.site.register(Tag)
|
|
25
|
-
admin.site.register(Rating)
|
|
26
|
-
admin.site.register(Profile)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sandwitches-1.3.1 → sandwitches-1.4.0}/src/sandwitches/migrations/0007_alter_rating_score.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|