Example #1
0
 def make_public(self, request: HttpRequest, queryset: GalleryQuerySet) -> None:
     rows_updated = queryset.update(public=True)
     if rows_updated == 1:
         message_bit = "1 gallery was"
     else:
         message_bit = "%s galleries were" % rows_updated
     self.message_user(request, "%s successfully marked as public." % message_bit)
Example #2
0
 def set_reason(self, request: HttpRequest, queryset: GalleryQuerySet) -> None:
     reason = request.POST['extra_field']
     rows_updated = queryset.update(reason=reason)
     if rows_updated == 1:
         message_bit = "1 gallery was"
     else:
         message_bit = "%s galleries were" % rows_updated
     self.message_user(request, "%s successfully set with reason: %s." % (message_bit, reason))
Example #3
0
 def set_provider(self, request: HttpRequest, queryset: GalleryQuerySet) -> None:
     provider = request.POST['extra_field']
     rows_updated = queryset.update(provider=provider)
     if rows_updated == 1:
         message_bit = "1 gallery was"
     else:
         message_bit = "%s galleries were" % rows_updated
     self.message_user(request, "%s successfully set with provider: %s." % (message_bit, provider))
Example #4
0
 def make_normal(self, request: HttpRequest,
                 queryset: GalleryQuerySet) -> None:
     rows_updated = queryset.update(status=Gallery.NORMAL)
     if rows_updated == 1:
         message_bit = "1 gallery was"
     else:
         message_bit = "%s galleries were" % rows_updated
     self.message_user(
         request, "%s successfully marked status as normal." % message_bit)