From 11c75da8c408e20adbc23ef0e643ac1111f1cc78 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 14 Apr 2016 12:08:20 -0300 Subject: [PATCH] Adiciona listagem ao crud mestre detalhe --- crud/masterdetail.py | 3 +++ parlamentares/forms.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/crud/masterdetail.py b/crud/masterdetail.py index ad82261c7..aa0c55e6f 100644 --- a/crud/masterdetail.py +++ b/crud/masterdetail.py @@ -70,10 +70,13 @@ class MasterDetailCrud(Crud): def get_url_regex(cls): return r'^%s/(?P\d+)/delete$' % cls.model._meta.model_name +<<<<<<< c9325f593ff07366e8a4acc20bdfba1f54ce254e def get_success_url(self): pk = getattr(self.get_object(), self.crud.parent_field).pk return self.resolve_url(LIST, args=(pk,)) +======= +>>>>>>> Adiciona listagem ao crud mestre detalhe @classonlymethod def build(cls, model, parent_field, help_path): crud = super(MasterDetailCrud, cls).build(model, help_path) diff --git a/parlamentares/forms.py b/parlamentares/forms.py index d708ce4cd..c6cb61f50 100644 --- a/parlamentares/forms.py +++ b/parlamentares/forms.py @@ -12,6 +12,10 @@ from crispy_layout_mixin import form_actions from .models import Filiacao, Legislatura, Mandato, Parlamentar +class ImageThumbnailFileInput(ClearableFileInput): + template_name = 'floppyforms/image_thumbnail.html' + + class ParlamentarForm(ModelForm): class Meta: