From a95e211d653aaafcab95a4d3d2eb8950c12c6e31 Mon Sep 17 00:00:00 2001 From: Andrews Medina Date: Tue, 29 Nov 2016 14:16:39 -0300 Subject: [PATCH] add compatibility with last version of deps (#454) --- djadmin2/admin2.py | 1 + djadmin2/apiviews.py | 1 + djadmin2/filters.py | 11 ++++++++--- djadmin2/types.py | 1 + example/db.sqlite3 | Bin 84992 -> 84992 bytes example/polls/admin2.py | 1 + setup.py | 6 +++--- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/djadmin2/admin2.py b/djadmin2/admin2.py index 5cfece8a..abbba0a0 100644 --- a/djadmin2/admin2.py +++ b/djadmin2/admin2.py @@ -17,6 +17,7 @@ class GroupSerializer(Admin2APISerializer): class Meta: model = Group + fields = '__all__' class GroupAdmin2(ModelAdmin2): diff --git a/djadmin2/apiviews.py b/djadmin2/apiviews.py index e126f5fb..24d5cf16 100644 --- a/djadmin2/apiviews.py +++ b/djadmin2/apiviews.py @@ -56,6 +56,7 @@ class ModelAPISerilizer(Admin2APISerializer): class Meta: model = model_class + fields = '__all__' return ModelAPISerilizer return super(Admin2APIMixin, self).get_serializer_class() diff --git a/djadmin2/filters.py b/djadmin2/filters.py index 557b2f7d..32d817d0 100644 --- a/djadmin2/filters.py +++ b/djadmin2/filters.py @@ -102,17 +102,22 @@ def build_date_filter(request, model_admin, queryset, field_name="published_date filterset_dict = { "year": NumericDateFilter( name=field_name, - lookup_type="year", + lookup_expr="year", ), "month": NumericDateFilter( name=field_name, - lookup_type="month", + lookup_expr="month", ), "day": NumericDateFilter( name=field_name, - lookup_type="day", + lookup_expr="day", ) } + filterset_dict["Meta"] = type( + type_str('Meta'), + (object, ), + {"model": queryset.model, "fields": [field_name]}, + ) return type( type_str('%sDateFilterSet' % queryset.model.__name__), diff --git a/djadmin2/types.py b/djadmin2/types.py index d3a366d1..fc494e97 100644 --- a/djadmin2/types.py +++ b/djadmin2/types.py @@ -285,6 +285,7 @@ class Admin2Inline(extra_views.InlineFormSet): adds some useful functionality. """ template = None + fields = '__all__' def construct_formset(self): """ diff --git a/example/db.sqlite3 b/example/db.sqlite3 index af9b94d73bf16532b678d4ffe5f891bf3bd4ca8c..ab10c5db2eb8b57de86ddc24ff6abd835491b4a6 100644 GIT binary patch delta 1397 zcmds1O>Em_82;?HDNRb0PN-s9Do8~qgt~;!pMPSvOu{5RoV#&76~SScG__ln#06_!$6hTkuwMZhfTBxPTPeGc9ubNm!%m(DFC4_ugppCALfa0@<#6F7u>Z~-n4=ci_X z_4?p-DqC$7GtGw8p%Fq}w^7!Onpr2aGw?R`^dn<)^7T%;M-MX7ANssryH4+RN|~;e zZ_~qj(~+;IXtj;kEx~=pH?7c&~k?ixk7b(i-3PFYm5-~u?5*uFPn2;2fI942q+y6;t%lTX< zkZb4lPTmOlXo+&FXP;Y5aEQeM#)NS;@l2`5_JfAWM+p9gN5eABAo<<~)E_5dA%MfK~?cQ{u<_%iu~Lxa4rR(KK6@)hh5ixk3Slv)wXj z_Z#h^W$3NuuC}R_Q&AbGm0UkrzCtubfT1iw=(L_~MWUNIiL{+Zz(#qOS zQW*pu&havrs$C*lRNhU;;v^X@+Mr5OeVI%4t7fWyX(tuU@tPv{($V#@&EvJ0I%qw7 zWiL@uNvE2vt(j>vQPFEFU5$ucl}KIVa-yl4e972aZ>-jy^49yS6=qwDZCGoym9kDY zx>_V|#jDbYx5aMswXH-!-*oiiy?7m8d~$Xq=)?gpvBDA~g*YaRS#E!s{%GV3n=Nro zQs66+ndK|yu5L)%lFl^h`9ixy%I5#v8EmJTby7{FkjM#G#QV#XYvjz}x0Ar|_`x~K z18@VuUAO_i*xhje@dZdyFG>_Rq!*bx`1#~5Tm3eIKi~(rZL5C)7heN;+;q=7I5-VI zyZhnqf4%X+6ipu?FzF+E;(SZ*U7M%9=-QjI+v`2=cFX=|wqg`W#wzKA7ZzA-Uki-2 zS!*{ddb28Y7sO(-B^r5wL}IOcIF`cI_BQwad#Y$E{l!jkabrtT5`9CAuNKD<8;yrk z5o0Au((6Y1U3)nn$~9{LP7!YGHzS4wK_CKgX!#xMOEW@!Wly1F1jq2$?)+cj delta 495 zcmZpe!P+o`b%Hcw@!I;ow&BW^4!s=+2pP6k?R-A5< zR9Kd5P+n+RQfY2hn3|uFot|f5nv@ph5|-;1;%nrW8LI6R%GVnp66*|W>zLfR>r1!My7@q7G_P>j9{-!e(+jh^Q&i4j2w*2cNm!O zFy8@&-D+kP6=q*XLf)Kw`?V%e+am_%N6d$T+O{*x$uT=J8W|Xx=^6l$rGg==1.8.0', - 'django-extra-views<=0.7.1', + 'django-extra-views==0.8.0', 'django-braces>=1.3.0', - 'djangorestframework<=3.3.3', - 'django-filter>=0.15.3', + 'djangorestframework<=3.5.3', + 'django-filter==1.0.0', 'pytz==2016.4', 'future>=0.15.2', ],