]> git.parisson.com Git - telemeta.git/commitdiff
exclude item.public_access for non staff, prepare 1.6 info
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 8 Jul 2015 12:03:25 +0000 (14:03 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 8 Jul 2015 12:03:51 +0000 (14:03 +0200)
README.rst
doc/content/TM-1.6.rst
telemeta/forms/media.py
telemeta/models/item.py
telemeta/views/item.py

index 0a7689746eae68a05c6ce8adcbdf3f5dc418c7ef..e6fa287e9ada69d49697d72384698c3bb527bced 100644 (file)
@@ -55,6 +55,11 @@ The processing engine of Telemeta is a separate project called `TimeSide <https:
 Changes
 ========
 
+1.6
+++++
+
+*
+
 1.5.1
 ++++++
 
index c104ee1cd37978876485ee4dce69308efa126fc6..210e1be8637028b704b96f7881a13e01405cd655 100644 (file)
@@ -6,9 +6,9 @@ Telemeta 1.6 has been released!
 
 Changelog:
 
-* Installation have been dratiscally simplified with the help of **Docker**.
+* Installation method have been dratiscally simplified with the help of **Docker**.
 
-  One month after the publication of docker-compose, we have managed to build a composition which bundle all the dependencies, even for a production use case. From development tasks to testing and deployment, we provide now a DevBox that is compatible with all platforms.
+  One month after the publication of docker-compose, we have managed to build a composition which bundles all the dependencies of Telemeta and TimeSide. For development tasks, testing and even deployment in production use cases, we provide now a `DevBox <https://github.com/Parisson/DevBox>` that is compatible with all platforms and facilitate the install and deployement procedures.
 
 * Add an EPUB3 audio book generator for corpus and collection
 * Add more 404 pages exceptions
index 3d37995b1763ad267cb8b116c69c1100b882be26..d41aa13f6f483a9e9798aeb5ce1305dfabcc2e14 100644 (file)
@@ -93,11 +93,20 @@ class MediaItemForm(ModelForm):
     class Meta:
         model = MediaItem
         exclude = model.exclude
+        # print exclude
 
     def clean_code(self):
         return self.cleaned_data['code'] or None
 
 
+class RestrictedMediaItemForm(MediaItemForm):
+
+    class Meta:
+        model = MediaItem
+        exclude = model.restricted
+        print exclude
+
+
 class PlaylistForm(ModelForm):
 
     class Meta:
index cabe28ecd5bf45cbcfe978ffb7e9bfa552a208a3..317579ca62305e049742a91511e3d18b02ccabfc 100644 (file)
@@ -132,6 +132,13 @@ class MediaItem(MediaResource):
                     'publishing_date', 'scientist', 'topic',
                     'summary', 'contributor', ]
 
+    restricted = ['copied_from_item', 'mimetype',
+                    'organization', 'depositor', 'rights',
+                    'recordist', 'digitalist', 'digitization_date',
+                    'publishing_date', 'scientist', 'topic',
+                    'summary', 'contributor', 'public_access']
+
+
     def keywords(self):
         return ContextKeyword.objects.filter(item_relations__item = self)
     keywords.verbose_name = _('keywords')
index 8b79878d5f1673769e371669f4880299d2d7f993..eba649a7749e8bc7ca301e3c26dc79fe4b8c0870 100644 (file)
@@ -458,9 +458,14 @@ class ItemViewMixin(ItemBaseMixin):
 
 class ItemEditView(ItemViewMixin, UpdateWithInlinesView):
 
-    form_class = MediaItemForm
     template_name = 'telemeta/mediaitem_edit.html'
 
+    def get_form_class(self):
+        if self.request.user.is_staff:
+            return MediaItemForm
+        else:
+            return RestrictedMediaItemForm
+
     def forms_valid(self, form, inlines):
         messages.info(self.request, ugettext_lazy("You have successfully updated your item."))
         item = form.save()