photo-objects 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.
@@ -1,3 +1,4 @@
1
+ from datetime import datetime
1
2
  from django import template
2
3
 
3
4
  from photo_objects.django.api.album import get_site_album
@@ -25,6 +26,11 @@ def display_name(user):
25
26
  return user.username
26
27
 
27
28
 
29
+ @register.filter
30
+ def is_datetime(value):
31
+ return isinstance(value, datetime)
32
+
33
+
28
34
  @register.filter
29
35
  def is_list(value):
30
36
  return isinstance(value, list)
@@ -40,13 +40,23 @@ def upload_photos(request: HttpRequest, album_key: str):
40
40
  })
41
41
 
42
42
 
43
+ def _lower(input: str):
44
+ return input.lower() if input else ''
45
+
46
+
43
47
  def _camera(photo: Photo):
44
- if photo.camera_make or photo.camera_model:
45
- return " ".join(i for i in [
46
- photo.camera_make,
47
- photo.camera_model,
48
- ] if i)
49
- return None
48
+ if not photo.camera_make and not photo.camera_model:
49
+ return None
50
+
51
+ # If camera model includes camera make, return model value to avoid
52
+ # stuttering.
53
+ if _lower(photo.camera_make) in _lower(photo.camera_model):
54
+ return photo.camera_model
55
+
56
+ return " ".join(i for i in [
57
+ photo.camera_make,
58
+ photo.camera_model,
59
+ ] if i)
50
60
 
51
61
 
52
62
  def _lens(photo: Photo):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: photo-objects
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Application for storing photos in S3 compatible object-storage.
5
5
  Author: Toni Kangas
6
6
  License: MIT License
@@ -26,7 +26,7 @@ photo_objects/django/migrations/0003_admin_visibility.py,sha256=PdxPOJzr-ViRBlOY
26
26
  photo_objects/django/migrations/0004_camera_setup_and_settings.py,sha256=CS5xyIHgBE2Y7-PSJ52ffRQeCzs8p899px9upomk4O8,1844
27
27
  photo_objects/django/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  photo_objects/django/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- photo_objects/django/templatetags/photo_objects_extras.py,sha256=JD6SHx3gmne5HdrwNlWOMqbGhcTfzNV9nV1bdNhlgto,1199
29
+ photo_objects/django/templatetags/photo_objects_extras.py,sha256=D-xmbDPpvZYSdYyeCExnmLXW7BikOkrQhZab7j0Sjns,1311
30
30
  photo_objects/django/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  photo_objects/django/tests/test_album.py,sha256=qeRx_M8EvY9n_as1x8-EWtp9Ob1kOPGnUfZuUnMfDO4,13979
32
32
  photo_objects/django/tests/test_auth.py,sha256=su00EypNzGQcvxqhmOtFevZriK31pY7yD1HxpQFcUT4,3928
@@ -43,11 +43,11 @@ photo_objects/django/views/api/utils.py,sha256=uQzKdSKHRAux5OZzqgWQr0gsK_FeweQP0
43
43
  photo_objects/django/views/ui/__init__.py,sha256=N3ro5KggdV-JnfyHwoStX73b3SbVbpcsMuQNlxntVJs,92
44
44
  photo_objects/django/views/ui/album.py,sha256=gOVwkpNZFytTrEU0N6OfJu4U4l85AIbL6b0L6x0eA4E,5232
45
45
  photo_objects/django/views/ui/configuration.py,sha256=pzNRHq3FSrVCTx2R31_FW3A3aJxzEO4pDnXsOVS75uA,5576
46
- photo_objects/django/views/ui/photo.py,sha256=fxjb47cxcT08pcYFcYIULpT4duKqK99zw5mgvKJx150,5994
46
+ photo_objects/django/views/ui/photo.py,sha256=ioECWNMZGLgnEAZBpvYjEVDYZMAyvCwXgl6y3L8jKsE,6249
47
47
  photo_objects/django/views/ui/users.py,sha256=nlJyW7rhmr-ZR4LeSHMRPVmJzpiyHCEB2ry6uH2ihOc,713
48
48
  photo_objects/django/views/ui/utils.py,sha256=YV_YcUbX-zUkdFnBlezPChR6aPDhZJ9loSOHBSzF6Cc,273
49
- photo_objects-0.3.0.dist-info/licenses/LICENSE,sha256=V3w6hTjXfP65F4r_mejveHcV5igHrblxao3-2RlfVlA,1068
50
- photo_objects-0.3.0.dist-info/METADATA,sha256=lzc5h4se4GYeyV3JZU8HLmboo-vM7TASrbSdH7qjZiw,3671
51
- photo_objects-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
52
- photo_objects-0.3.0.dist-info/top_level.txt,sha256=SZeL8mhf-WMGdhRtTGFvZc3aIRBboQls9O0cFDMGdQ0,14
53
- photo_objects-0.3.0.dist-info/RECORD,,
49
+ photo_objects-0.3.1.dist-info/licenses/LICENSE,sha256=V3w6hTjXfP65F4r_mejveHcV5igHrblxao3-2RlfVlA,1068
50
+ photo_objects-0.3.1.dist-info/METADATA,sha256=rh4SAReBNJ2n0OytlvQnpTBnJ2lgiWvC7OMHjSqyO0k,3671
51
+ photo_objects-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
52
+ photo_objects-0.3.1.dist-info/top_level.txt,sha256=SZeL8mhf-WMGdhRtTGFvZc3aIRBboQls9O0cFDMGdQ0,14
53
+ photo_objects-0.3.1.dist-info/RECORD,,