photo-objects 0.1.0__tar.gz → 0.2.1__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 (58) hide show
  1. {photo_objects-0.1.0 → photo_objects-0.2.1}/PKG-INFO +1 -1
  2. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/templatetags/photo_objects_extras.py +2 -2
  3. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/urls.py +1 -10
  4. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/ui/__init__.py +1 -0
  5. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/ui/album.py +6 -6
  6. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/ui/photo.py +0 -1
  7. photo_objects-0.2.1/photo_objects/django/views/ui/users.py +23 -0
  8. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects.egg-info/PKG-INFO +1 -1
  9. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects.egg-info/SOURCES.txt +1 -0
  10. {photo_objects-0.1.0 → photo_objects-0.2.1}/pyproject.toml +1 -1
  11. {photo_objects-0.1.0 → photo_objects-0.2.1}/LICENSE +0 -0
  12. {photo_objects-0.1.0 → photo_objects-0.2.1}/README.md +0 -0
  13. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/__init__.py +0 -0
  14. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/config.py +0 -0
  15. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/__init__.py +0 -0
  16. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/admin.py +0 -0
  17. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/api/__init__.py +0 -0
  18. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/api/album.py +0 -0
  19. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/api/auth.py +0 -0
  20. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/api/photo.py +0 -0
  21. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/api/utils.py +0 -0
  22. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/apps.py +0 -0
  23. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/context_processors.py +0 -0
  24. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/forms.py +0 -0
  25. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/management/__init__.py +0 -0
  26. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/management/commands/__init__.py +0 -0
  27. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/management/commands/create-initial-admin-account.py +0 -0
  28. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/management/commands/create-site-albums.py +0 -0
  29. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/migrations/0001_initial.py +0 -0
  30. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/migrations/0002_created_at_updated_at.py +0 -0
  31. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/migrations/0003_admin_visibility.py +0 -0
  32. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/migrations/0004_camera_setup_and_settings.py +0 -0
  33. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/migrations/__init__.py +0 -0
  34. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/models.py +0 -0
  35. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/objsto.py +0 -0
  36. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/signals.py +0 -0
  37. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/templatetags/__init__.py +0 -0
  38. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/tests/__init__.py +0 -0
  39. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/tests/test_album.py +0 -0
  40. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/tests/test_auth.py +0 -0
  41. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/tests/test_photo.py +0 -0
  42. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/tests/test_utils.py +0 -0
  43. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/tests/utils.py +0 -0
  44. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/__init__.py +0 -0
  45. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/api/__init__.py +0 -0
  46. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/api/album.py +0 -0
  47. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/api/auth.py +0 -0
  48. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/api/photo.py +0 -0
  49. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/api/utils.py +0 -0
  50. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/ui/configuration.py +0 -0
  51. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/ui/utils.py +0 -0
  52. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/django/views/utils.py +0 -0
  53. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/error.py +0 -0
  54. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects/img.py +0 -0
  55. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects.egg-info/dependency_links.txt +0 -0
  56. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects.egg-info/requires.txt +0 -0
  57. {photo_objects-0.1.0 → photo_objects-0.2.1}/photo_objects.egg-info/top_level.txt +0 -0
  58. {photo_objects-0.1.0 → photo_objects-0.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: photo-objects
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: Application for storing photos in S3 compatible object-storage.
5
5
  Author: Toni Kangas
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  from django import template
2
2
 
3
- from photo_objects.django.models import Album
3
+ from photo_objects.django.api.album import get_site_album
4
4
 
5
5
 
6
6
  register = template.Library()
@@ -41,7 +41,7 @@ def meta_og(context):
41
41
  try:
42
42
  request = context.get("request")
43
43
  site = request.site
44
- album = Album.objects.get(key=f'_site_{site.id}')
44
+ album = get_site_album(site.id)
45
45
 
46
46
  return {
47
47
  'request': request,
@@ -68,16 +68,7 @@ urlpatterns = [
68
68
  # TODO: img/<str:album_key>/<str:photo_key>/<str:size_key> path
69
69
  path(
70
70
  "users/login",
71
- auth_views.LoginView.as_view(
72
- template_name="photo_objects/form.html",
73
- extra_context={
74
- "title": "Login",
75
- "action": "Login",
76
- "back": BackLink(
77
- f'Back to albums',
78
- reverse_lazy('photo_objects:list_albums')),
79
- },
80
- ),
71
+ ui.login,
81
72
  name="login",
82
73
  ),
83
74
  path(
@@ -1,3 +1,4 @@
1
1
  from .album import *
2
2
  from .configuration import *
3
3
  from .photo import *
4
+ from .users import *
@@ -51,13 +51,13 @@ def new_album(request: HttpRequest):
51
51
  def get_info(request: HttpRequest, album_key: str):
52
52
  site_id = parse_site_id(album_key)
53
53
  if site_id is not None and request.site:
54
- return (
54
+ return render_markdown(
55
55
  "This is a special album for configuring site metadata for "
56
- f"{request.site.name}. Use album title to override the site name, "
57
- "albums cover photo to configure the preview image, and album "
58
- "description to configure the site description. The album title "
59
- "is automatically updated when the related sites name is changed "
60
- "and vice versa.")
56
+ f"**{request.site.name}**. Use album title to change the site "
57
+ "name, albums cover photo to configure the preview image, and "
58
+ "album description to configure the site description. The album "
59
+ "title is automatically updated when the related sites name is "
60
+ "changed and vice versa.")
61
61
 
62
62
 
63
63
  @json_problem_as_html
@@ -1,7 +1,6 @@
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
5
4
 
6
5
  from photo_objects.django import api
7
6
  from photo_objects.django.api.utils import AlbumNotFound, FormValidationFailed
@@ -0,0 +1,23 @@
1
+ from django.contrib.auth import views as auth_views
2
+ from django.http import HttpRequest
3
+ from django.urls import reverse_lazy
4
+
5
+ from photo_objects.django.api.album import get_site_album
6
+ from photo_objects.django.views.utils import BackLink
7
+
8
+
9
+ def login(request: HttpRequest):
10
+ album, _ = get_site_album(request.site)
11
+
12
+ return auth_views.LoginView.as_view(
13
+ template_name="photo_objects/form.html",
14
+ extra_context={
15
+ "title": "Login",
16
+ "photo": album.cover_photo,
17
+ "action": "Login",
18
+ "back": BackLink(
19
+ f'Back to albums',
20
+ reverse_lazy('photo_objects:list_albums')),
21
+ "class": "login"
22
+ },
23
+ )(request)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: photo-objects
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: Application for storing photos in S3 compatible object-storage.
5
5
  Author: Toni Kangas
6
6
  License: MIT License
@@ -52,4 +52,5 @@ photo_objects/django/views/ui/__init__.py
52
52
  photo_objects/django/views/ui/album.py
53
53
  photo_objects/django/views/ui/configuration.py
54
54
  photo_objects/django/views/ui/photo.py
55
+ photo_objects/django/views/ui/users.py
55
56
  photo_objects/django/views/ui/utils.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "photo-objects"
7
- version = "0.1.0"
7
+ version = "0.2.1"
8
8
  dependencies = [
9
9
  "markdown~=3.7",
10
10
  "minio~=7.2",
File without changes
File without changes
File without changes