photo-objects 0.10.3__tar.gz → 0.10.5__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.
Files changed (72) hide show
  1. {photo_objects-0.10.3 → photo_objects-0.10.5}/PKG-INFO +27 -5
  2. {photo_objects-0.10.3 → photo_objects-0.10.5}/README.md +24 -2
  3. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/backup.py +15 -1
  4. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/models.py +1 -0
  5. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/album.py +2 -0
  6. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/photo.py +17 -5
  7. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects.egg-info/PKG-INFO +27 -5
  8. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects.egg-info/requires.txt +1 -1
  9. {photo_objects-0.10.3 → photo_objects-0.10.5}/pyproject.toml +3 -3
  10. {photo_objects-0.10.3 → photo_objects-0.10.5}/LICENSE +0 -0
  11. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/__init__.py +0 -0
  12. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/config.py +0 -0
  13. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/__init__.py +0 -0
  14. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/admin.py +0 -0
  15. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/__init__.py +0 -0
  16. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/album.py +0 -0
  17. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/auth.py +0 -0
  18. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/photo.py +0 -0
  19. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/photo_change_request.py +0 -0
  20. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/api/utils.py +0 -0
  21. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/apps.py +0 -0
  22. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/conf.py +0 -0
  23. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/context_processors.py +0 -0
  24. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/forms.py +0 -0
  25. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/management/__init__.py +0 -0
  26. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/management/commands/__init__.py +0 -0
  27. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/management/commands/clean-scaled-photos.py +0 -0
  28. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/management/commands/create-initial-admin-account.py +0 -0
  29. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/management/commands/restore-backup.py +0 -0
  30. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0001_initial.py +0 -0
  31. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0002_created_at_updated_at.py +0 -0
  32. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0003_admin_visibility.py +0 -0
  33. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0004_camera_setup_and_settings.py +0 -0
  34. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0005_sitesettings.py +0 -0
  35. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0006_photo_alt_text.py +0 -0
  36. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0007_backup.py +0 -0
  37. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/0008_sitesettings_copyright_notice.py +0 -0
  38. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/migrations/__init__.py +0 -0
  39. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/objsto.py +0 -0
  40. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/signals.py +0 -0
  41. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/templatetags/__init__.py +0 -0
  42. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/templatetags/photo_objects_extras.py +0 -0
  43. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/__init__.py +0 -0
  44. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_album.py +0 -0
  45. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_auth.py +0 -0
  46. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_commands.py +0 -0
  47. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_img.py +0 -0
  48. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_og_meta.py +0 -0
  49. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_photo.py +0 -0
  50. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_photo_change_requests.py +0 -0
  51. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/test_utils.py +0 -0
  52. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/tests/utils.py +0 -0
  53. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/urls.py +0 -0
  54. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/__init__.py +0 -0
  55. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/api/__init__.py +0 -0
  56. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/api/album.py +0 -0
  57. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/api/auth.py +0 -0
  58. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/api/photo.py +0 -0
  59. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/api/utils.py +0 -0
  60. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/__init__.py +0 -0
  61. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/configuration.py +0 -0
  62. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/photo_change_request.py +0 -0
  63. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/users.py +0 -0
  64. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/ui/utils.py +0 -0
  65. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/django/views/utils.py +0 -0
  66. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/error.py +0 -0
  67. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/img.py +0 -0
  68. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects/utils.py +0 -0
  69. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects.egg-info/SOURCES.txt +0 -0
  70. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects.egg-info/dependency_links.txt +0 -0
  71. {photo_objects-0.10.3 → photo_objects-0.10.5}/photo_objects.egg-info/top_level.txt +0 -0
  72. {photo_objects-0.10.3 → photo_objects-0.10.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: photo-objects
3
- Version: 0.10.3
3
+ Version: 0.10.5
4
4
  Summary: Application for storing photos in S3 compatible object-storage.
5
5
  Author: Toni Kangas
6
6
  License: MIT License
@@ -29,7 +29,7 @@ Project-URL: Homepage, https://github.com/kangasta/photo-objects
29
29
  Project-URL: Repository, https://github.com/kangasta/photo-objects.git
30
30
  Classifier: Environment :: Web Environment
31
31
  Classifier: Framework :: Django
32
- Classifier: Framework :: Django :: 5.0
32
+ Classifier: Framework :: Django :: 6.0
33
33
  Classifier: Intended Audience :: Developers
34
34
  Classifier: License :: OSI Approved :: MIT License
35
35
  Classifier: Operating System :: OS Independent
@@ -43,18 +43,40 @@ Description-Content-Type: text/markdown
43
43
  License-File: LICENSE
44
44
  Requires-Dist: markdown~=3.7
45
45
  Requires-Dist: minio<7.2.19,>=7.2.0
46
- Requires-Dist: pillow~=10.4
46
+ Requires-Dist: pillow~=12.0
47
47
  Dynamic: license-file
48
48
 
49
49
  # Photo Objects
50
50
 
51
51
  [![CI](https://github.com/kangasta/photo-objects/actions/workflows/ci.yml/badge.svg)](https://github.com/kangasta/photo-objects/actions/workflows/ci.yml)
52
+ [![Release](https://github.com/kangasta/photo-objects/actions/workflows/release.yml/badge.svg)](https://github.com/kangasta/photo-objects/actions/workflows/release.yml)
52
53
 
53
- Application for storing photos in S3 compatible object-storage.
54
+ Application for storing photos in S3 compatible object-storage. Key features:
55
+
56
+ - Automatically scales photos according to different sizes defined in settings.
57
+ - Provides simple grouping and access control for the photos with albums.
54
58
 
55
59
  ## Developing
56
60
 
57
- Make migrations:
61
+ Build containers:
62
+
63
+ ```sh
64
+ docker compose build
65
+ ```
66
+
67
+ Start or update development environment:
68
+
69
+ ```sh
70
+ docker compose up -d
71
+ ```
72
+
73
+ Print initial admin password (username of the initial administrator account is `admin`):
74
+
75
+ ```sh
76
+ docker compose exec api cat /var/photo_objects/initial_admin_password
77
+ ```
78
+
79
+ Make database migrations (requires development environment to be running):
58
80
 
59
81
  ```sh
60
82
  python3 back/manage.py makemigrations --pythonpath="$(pwd)"
@@ -1,12 +1,34 @@
1
1
  # Photo Objects
2
2
 
3
3
  [![CI](https://github.com/kangasta/photo-objects/actions/workflows/ci.yml/badge.svg)](https://github.com/kangasta/photo-objects/actions/workflows/ci.yml)
4
+ [![Release](https://github.com/kangasta/photo-objects/actions/workflows/release.yml/badge.svg)](https://github.com/kangasta/photo-objects/actions/workflows/release.yml)
4
5
 
5
- Application for storing photos in S3 compatible object-storage.
6
+ Application for storing photos in S3 compatible object-storage. Key features:
7
+
8
+ - Automatically scales photos according to different sizes defined in settings.
9
+ - Provides simple grouping and access control for the photos with albums.
6
10
 
7
11
  ## Developing
8
12
 
9
- Make migrations:
13
+ Build containers:
14
+
15
+ ```sh
16
+ docker compose build
17
+ ```
18
+
19
+ Start or update development environment:
20
+
21
+ ```sh
22
+ docker compose up -d
23
+ ```
24
+
25
+ Print initial admin password (username of the initial administrator account is `admin`):
26
+
27
+ ```sh
28
+ docker compose exec api cat /var/photo_objects/initial_admin_password
29
+ ```
30
+
31
+ Make database migrations (requires development environment to be running):
10
32
 
11
33
  ```sh
12
34
  python3 back/manage.py makemigrations --pythonpath="$(pwd)"
@@ -1,4 +1,5 @@
1
1
  from threading import Thread
2
+ from time import sleep
2
3
 
3
4
  from django.contrib.auth import get_user_model
4
5
  from django.contrib.auth.models import Group, Permission
@@ -59,7 +60,20 @@ def _group_dict(group: Group):
59
60
 
60
61
 
61
62
  def _create_backup(backup_id: int):
62
- backup = Backup.objects.get(id=backup_id)
63
+ # Backup might not be available immediately.
64
+ # Retry getting the backup a few times.
65
+ for _ in range(5):
66
+ try:
67
+ backup = Backup.objects.get(id=backup_id)
68
+ break
69
+ except Backup.DoesNotExist:
70
+ sleep(2)
71
+
72
+ if not backup:
73
+ return
74
+
75
+ backup.status = "processing"
76
+ backup.save()
63
77
 
64
78
  user_model = get_user_model()
65
79
 
@@ -256,6 +256,7 @@ class Backup(models.Model):
256
256
  return _str(
257
257
  f'Backup {self.id}',
258
258
  created_at=self.created_at,
259
+ status=self.status,
259
260
  comment=self.comment,
260
261
  )
261
262
 
@@ -78,6 +78,8 @@ def show_album(request: HttpRequest, album_key: str):
78
78
  "Description": render_markdown(album.description),
79
79
  "Timeline": _timeline(album),
80
80
  "Visibility": Album.Visibility(album.visibility).label,
81
+ "Created at": album.created_at,
82
+ "Updated at": album.updated_at,
81
83
  }
82
84
 
83
85
  return render(request, "photo_objects/album/show.html", {
@@ -1,6 +1,7 @@
1
1
  from django.http import HttpRequest, HttpResponseRedirect
2
2
  from django.shortcuts import render
3
3
  from django.urls import reverse
4
+ from django.utils.safestring import mark_safe
4
5
 
5
6
  from photo_objects.django import api
6
7
  from photo_objects.django.api.utils import (
@@ -64,25 +65,34 @@ def _lens(photo: Photo):
64
65
  return None
65
66
 
66
67
 
68
+ def _sec(text: str):
69
+ return f'<span class="secondary">{text}</span>'
70
+
71
+
67
72
  def _exposure_time_to_string(exposure_time: float | None):
68
73
  if exposure_time is None:
69
74
  return None
70
75
  if exposure_time < 1:
71
- return f"1/{int(1 / exposure_time)}\u202Fs"
76
+ return mark_safe(
77
+ f"{_sec('1/')}{int(1 / exposure_time)}\u202F{_sec('s')}")
72
78
  else:
73
- return f"{int(exposure_time)}\u202Fs"
79
+ return mark_safe(
80
+ f"{int(exposure_time)}\u202F{_sec('s')}")
74
81
 
75
82
 
76
83
  def _camera_settings(photo: Photo):
77
84
  r = []
78
85
  if photo.focal_length:
79
- r.append(f"{round(photo.focal_length)}\u202Fmm")
86
+ r.append(mark_safe(
87
+ f"{round(photo.focal_length)}\u202F{_sec('mm')}"))
80
88
  if photo.f_number:
81
- r.append(f"f/{photo.f_number}")
89
+ r.append(
90
+ mark_safe(f"{_sec('f/')}{photo.f_number}"))
82
91
  if photo.exposure_time:
83
92
  r.append(_exposure_time_to_string(photo.exposure_time))
84
93
  if photo.iso_speed:
85
- r.append(f"ISO\u202F{photo.iso_speed}")
94
+ r.append(mark_safe(
95
+ f"{_sec('ISO')}\u202F{photo.iso_speed}"))
86
96
  return r
87
97
 
88
98
 
@@ -120,6 +130,8 @@ def show_photo(request: HttpRequest, album_key: str, photo_key: str):
120
130
  "Camera": _camera(photo),
121
131
  "Lens": _lens(photo),
122
132
  "Settings": _camera_settings(photo),
133
+ "Created at": photo.created_at,
134
+ "Updated at": photo.updated_at,
123
135
  }
124
136
 
125
137
  return render(request, "photo_objects/photo/show.html", {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: photo-objects
3
- Version: 0.10.3
3
+ Version: 0.10.5
4
4
  Summary: Application for storing photos in S3 compatible object-storage.
5
5
  Author: Toni Kangas
6
6
  License: MIT License
@@ -29,7 +29,7 @@ Project-URL: Homepage, https://github.com/kangasta/photo-objects
29
29
  Project-URL: Repository, https://github.com/kangasta/photo-objects.git
30
30
  Classifier: Environment :: Web Environment
31
31
  Classifier: Framework :: Django
32
- Classifier: Framework :: Django :: 5.0
32
+ Classifier: Framework :: Django :: 6.0
33
33
  Classifier: Intended Audience :: Developers
34
34
  Classifier: License :: OSI Approved :: MIT License
35
35
  Classifier: Operating System :: OS Independent
@@ -43,18 +43,40 @@ Description-Content-Type: text/markdown
43
43
  License-File: LICENSE
44
44
  Requires-Dist: markdown~=3.7
45
45
  Requires-Dist: minio<7.2.19,>=7.2.0
46
- Requires-Dist: pillow~=10.4
46
+ Requires-Dist: pillow~=12.0
47
47
  Dynamic: license-file
48
48
 
49
49
  # Photo Objects
50
50
 
51
51
  [![CI](https://github.com/kangasta/photo-objects/actions/workflows/ci.yml/badge.svg)](https://github.com/kangasta/photo-objects/actions/workflows/ci.yml)
52
+ [![Release](https://github.com/kangasta/photo-objects/actions/workflows/release.yml/badge.svg)](https://github.com/kangasta/photo-objects/actions/workflows/release.yml)
52
53
 
53
- Application for storing photos in S3 compatible object-storage.
54
+ Application for storing photos in S3 compatible object-storage. Key features:
55
+
56
+ - Automatically scales photos according to different sizes defined in settings.
57
+ - Provides simple grouping and access control for the photos with albums.
54
58
 
55
59
  ## Developing
56
60
 
57
- Make migrations:
61
+ Build containers:
62
+
63
+ ```sh
64
+ docker compose build
65
+ ```
66
+
67
+ Start or update development environment:
68
+
69
+ ```sh
70
+ docker compose up -d
71
+ ```
72
+
73
+ Print initial admin password (username of the initial administrator account is `admin`):
74
+
75
+ ```sh
76
+ docker compose exec api cat /var/photo_objects/initial_admin_password
77
+ ```
78
+
79
+ Make database migrations (requires development environment to be running):
58
80
 
59
81
  ```sh
60
82
  python3 back/manage.py makemigrations --pythonpath="$(pwd)"
@@ -1,3 +1,3 @@
1
1
  markdown~=3.7
2
2
  minio<7.2.19,>=7.2.0
3
- pillow~=10.4
3
+ pillow~=12.0
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "photo-objects"
7
- version = "0.10.3"
7
+ version = "0.10.5"
8
8
  dependencies = [
9
9
  "markdown~=3.7",
10
10
  "minio>=7.2.0,<7.2.19",
11
- "pillow~=10.4"
11
+ "pillow~=12.0"
12
12
  ]
13
13
  description = "Application for storing photos in S3 compatible object-storage."
14
14
  readme = "README.md"
@@ -20,7 +20,7 @@ authors = [
20
20
  classifiers = [
21
21
  "Environment :: Web Environment",
22
22
  "Framework :: Django",
23
- "Framework :: Django :: 5.0",
23
+ "Framework :: Django :: 6.0",
24
24
  "Intended Audience :: Developers",
25
25
  "License :: OSI Approved :: MIT License",
26
26
  "Operating System :: OS Independent",
File without changes
File without changes