Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Select all - admin change list

Received: by 10.50.192.227 with SMTP id hj3mr6970834igc.2.1335225615542;
        Mon, 23 Apr 2012 17:00:15 -0700 (PDT)
X-BeenThere: mezzanine-users@googlegroups.com
Received: by 10.231.71.151 with SMTP id h23ls10122645ibj.6.gmail; Mon, 23 Apr
 2012 17:00:14 -0700 (PDT)
Received: by 10.42.94.129 with SMTP id b1mr2952760icn.1.1335225614811;
        Mon, 23 Apr 2012 17:00:14 -0700 (PDT)
Received: by 10.42.94.129 with SMTP id b1mr2952758icn.1.1335225614743;
        Mon, 23 Apr 2012 17:00:14 -0700 (PDT)
Return-Path: <joshcar...@gmail.com>
Received: from mail-iy0-f170.google.com (mail-iy0-f170.google.com [209.85.210.170])
        by gmr-mx.google.com with ESMTPS id md3si5896389igc.1.2012.04.23.17.00.14
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 23 Apr 2012 17:00:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of joshcar...@gmail.com designates 209.85.210.170 as permitted sender) client-ip=209.85.210.170;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of joshcar...@gmail.com designates 209.85.210.170 as permitted sender) smtp.mail=joshcar...@gmail.com; dkim=pass header...@gmail.com
Received: by iaeh11 with SMTP id h11so166391iae.29
        for <mezzanine-users@googlegroups.com>; Mon, 23 Apr 2012 17:00:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=8KvkdursWRsWm7tgXf+5aB/sq9Aiwl+de6MITNhgpeg=;
        b=W7VHXcVwvtVriWBwwkai/PU6fTjTEMdFERYnv02d/Y/HA6s4XnRwR9EQt41Z7WKFrg
         ePMMn5VT7jH9JIDhVpqN+q8POevfunI4AGuUjkNx4vlNAknWvZBjwqRkmWe3xyxi38J1
         8k4n2qMgtWUsu9EBpMSa09luAGTfd3v5HCMCRB2QXcd8eu8P8k/4lDt8DGWFcOoyhegx
         TDUrwi3/vpya/nDFNSf10DCHRJG8edi50XT9lA5+5QI0Eu4yA6H/nSoRYNUgfKE5i9Rw
         UQKQm3jHVNkPlnjuIiugK1UHemX2TPCwyekjmn3Y3AiHGTzCLN58yrty9OoPEBgLNTsV
         Ls3g==
MIME-Version: 1.0
Received: by 10.50.89.233 with SMTP id br9mr7942545igb.48.1335225614572; Mon,
 23 Apr 2012 17:00:14 -0700 (PDT)
Received: by 10.42.180.132 with HTTP; Mon, 23 Apr 2012 17:00:14 -0700 (PDT)
In-Reply-To: <CADtpeMza_r-AcTOsB+WFq93U_mGFmjFYTP4N-Ci=rxUnhd-...@mail.gmail.com>
References: <CADtpeMwoEWZUcBG2PZGJNK5dSCfi9Jy8nXyimPdrmkJ4WQ5...@mail.gmail.com>
	<CAFDn9NbtVO_Wphg3Oa8t5C61Rp8bPpKhE3BXJh=pSVXWvae...@mail.gmail.com>
	<CADtpeMza_r-AcTOsB+WFq93U_mGFmjFYTP4N-Ci=rxUnhd-...@mail.gmail.com>
Date: Mon, 23 Apr 2012 17:00:14 -0700
Message-ID: <CADtpeMydJSD8ww7X_o8Nv=tYqS8FFPmih8F5Ege8m9D+4od...@mail.gmail.com>
Subject: Re: [mezzanine-users] Select all - admin change list
From: Josh Cartmell <joshcar...@gmail.com>
To: mezzanine-users@googlegroups.com
Content-Type: multipart/alternative; boundary=e89a8f3bac57739d5604be617047

--e89a8f3bac57739d5604be617047
Content-Type: text/plain; charset=ISO-8859-1

Ok after further research I think I have figured out what the problems are
mostly:

first of all the grappelli-safe change_list.html needs everything from the
{% if action_form %} to the {% endif %} here:
https://github.com/sehmaschine/django-grappelli/blob/master/grappelli/templates/admin/change_list.html#L20

then grappelli-safe's actions.html should look like this, although we may
need to add the class "actions" to the div:
https://github.com/sehmaschine/django-grappelli/blob/master/grappelli/templates/admin/actions.html

finally actions.min.js should be updated like this:
https://github.com/sehmaschine/django-grappelli/blob/master/grappelli/static/grappelli/js/actions.min.js
I think the really important parts are at the end in $.fn.actions.defaults
as the selectors are different since grappelli uses lists instead of spans.

If you do what I have outlined above you are given an option to select all
immediately upon loading a change list.  It shouldn't actually show until
you check the box that selects all on a page so there is still something
not quite right.  If you check that box and then click select all it does
work though.  Could somebody else give it a shot and see if they can figure
out that problem?  I tested it by adding list_per_page in the BlogPostAdmin
to 2 and then creating 3 test blog posts.

One other problem I noticed: when I created a fresh mezzanine project with
mezzanine installed using easy_install into a clean virtualenv,
change_list.html pulled many static resources from django rather than
grappelli_safe.

In the template this:
{{ media }}
produced this:
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript"
src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript"
src="/static/admin/js/jquery.js"></script>
    <script type="text/javascript"
src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript"
src="/static/admin/js/actions.min.js"></script>
so I deleted:
{{ media }}
and put this in its place:
    <script type="text/javascript"
src="/static/grappelli/js/core.js"></script>
    <script type="text/javascript"
src="/static/grappelli/js/admin/RelatedObjectLookups.js"></script>
    <script type="text/javascript"
src="/static/grappelli/js/jquery.js"></script>
    <script type="text/javascript"
src="/static/grappelli/js/jquery.init.js"></script>
    <script type="text/javascript"
src="/static/grappelli/js/actions.min.js"></script>

That worked for testing out the changes I listed above but is obviously not
the best solution moving forward.  Is anyone else seeing that?

That was a bit long so if anything doesn't make sense let me know and I
will try to clear things up as best I can.

On Sat, Apr 21, 2012 at 11:10 PM, Josh Cartmell <joshcar...@gmail.com>wrote:

> Ill probably look into this a bit more soon here is what I have found so
> far:
> http://code.google.com/p/django-grappelli/issues/detail?id=157(apparently the select all was added in grappelli 2.1)
>
>
> On Fri, Apr 20, 2012 at 11:55 PM, Stephen McDonald <st...@jupo.org> wrote:
>
>> Not sure what's involved but it'd be great to get this working.
>>
>> I suppose in the meantime you could create a separate action called
>> "export all" - although I have a vague recollection of the actions not
>> triggering if there aren't any rows selected. If that's the case you could
>> possibly get around it with a bit of JS that selects all on the page when
>> export all is chosen.
>>
>>
>> On Sat, Apr 21, 2012 at 9:53 AM, Josh Cartmell <joshcar...@gmail.com>wrote:
>>
>>> On a default Django admin change list page there is a checkbox in the
>>> upper left to select all items on the page (clicking it then allows you to
>>> click a link which selects all items in the list, not just the current
>>> page).
>>>
>>> In Mezzanine we do not have either of these.  I am guessing it is
>>> related to Grappelli.  Is there anything to be done for this or does anyone
>>> know of a workaround?  It would be very useful as I am working on excel
>>> data export for a custom app that is integrated with a Mezzanine based site.
>>>
>>
>>
>>
>> --
>> Stephen McDonald
>> http://jupo.org
>>
>
>

--e89a8f3bac57739d5604be617047
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_extra">Ok after further research I think I have figured=
 out what the problems are mostly:<br><br>first of all the grappelli-safe c=
hange_list.html needs everything from the {% if action_form %} to the {% en=
dif %} here:<br>
<a href=3D"https://github.com/sehmaschine/django-grappelli/blob/master/grap=
pelli/templates/admin/change_list.html#L20">https://github.com/sehmaschine/=
django-grappelli/blob/master/grappelli/templates/admin/change_list.html#L20=
</a><br>
<br>then grappelli-safe&#39;s actions.html should look like this, although =
we may need to add the class &quot;actions&quot; to the div:<br><a href=3D"=
https://github.com/sehmaschine/django-grappelli/blob/master/grappelli/templ=
ates/admin/actions.html">https://github.com/sehmaschine/django-grappelli/bl=
ob/master/grappelli/templates/admin/actions.html</a><br>
<br>finally actions.min.js should be updated like this:<br><a href=3D"https=
://github.com/sehmaschine/django-grappelli/blob/master/grappelli/static/gra=
ppelli/js/actions.min.js">https://github.com/sehmaschine/django-grappelli/b=
lob/master/grappelli/static/grappelli/js/actions.min.js</a><br>
I think the really important parts are at the end in $.fn.actions.defaults =
as the selectors are different since grappelli uses lists instead of spans.=
<br><br>If you do what I have outlined above you are given an option to sel=
ect all immediately upon loading a change list.=A0 It shouldn&#39;t actuall=
y show until you check the box that selects all on a page so there is still=
 something not quite right.=A0 If you check that box and then click select =
all it does work though.=A0 Could somebody else give it a shot and see if t=
hey can figure out that problem?=A0 I tested it by adding list_per_page in =
the BlogPostAdmin to 2 and then creating 3 test blog posts.<br>
<br>One other problem I noticed: when I created a fresh mezzanine project w=
ith mezzanine installed using easy_install into a clean virtualenv, change_=
list.html pulled many static resources from django rather than grappelli_sa=
fe.<br>
<br>In the template this:<br>{{ media }}<br>produced this:<br>=A0=A0=A0 &lt=
;script type=3D&quot;text/javascript&quot; src=3D&quot;/static/admin/js/cor=
e.js&quot;&gt;&lt;/script&gt;<br>
=A0=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static=
/admin/js/admin/RelatedObjectLookups.js&quot;&gt;&lt;/script&gt;<br>
=A0=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static=
/admin/js/jquery.js&quot;&gt;&lt;/script&gt;<br>
=A0=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static=
/admin/js/jquery.init.js&quot;&gt;&lt;/script&gt;<br>
=A0=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static=
/admin/js/actions.min.js&quot;&gt;&lt;/script&gt;<br>so I deleted:<br>{{ me=
dia }}<br>and put this in its place:<br>=A0=A0=A0 &lt;script type=3D&quot;t=
ext/javascript&quot; src=3D&quot;/static/grappelli/js/core.js&quot;&gt;&lt;=
/script&gt;<br>
=A0=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static=
/grappelli/js/admin/RelatedObjectLookups.js&quot;&gt;&lt;/script&gt;<br>=A0=
=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static/gr=
appelli/js/jquery.js&quot;&gt;&lt;/script&gt;<br>
=A0=A0=A0 &lt;script type=3D&quot;text/javascript&quot; src=3D&quot;/static=
/grappelli/js/jquery.init.js&quot;&gt;&lt;/script&gt;<br>=A0=A0=A0 &lt;scri=
pt type=3D&quot;text/javascript&quot; src=3D&quot;/static/grappelli/js/acti=
ons.min.js&quot;&gt;&lt;/script&gt;<br>
<br>That worked for testing out the changes I listed above but is obviously=
 not the best solution moving forward.=A0 Is anyone else seeing that?<br><b=
r>That was a bit long so if anything doesn&#39;t make sense let me know and=
 I will try to clear things up as best I can.<br>
<br><div class=3D"gmail_quote">On Sat, Apr 21, 2012 at 11:10 PM, Josh Cartm=
ell <span dir=3D"ltr">&lt;<a href=3D"mailto:joshcar...@gmail.com" target=3D=
"_blank">joshcar...@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">
<div class=3D"gmail_extra">Ill probably look into this a bit more soon here=
 is what I have found so far:</div><div class=3D"gmail_extra"><a href=3D"ht=
tp://code.google.com/p/django-grappelli/issues/detail?id=3D157" target=3D"_=
blank">http://code.google.com/p/django-grappelli/issues/detail?id=3D157</a>=
 (apparently the select all was added in grappelli 2.1)<div>
<div class=3D"h5"><br>
<br><div class=3D"gmail_quote">On Fri, Apr 20, 2012 at 11:55 PM, Stephen Mc=
Donald <span dir=3D"ltr">&lt;<a href=3D"mailto:st...@jupo.org" target=3D"_b=
lank">st...@jupo.org</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex=
">

Not sure what&#39;s involved but it&#39;d be great to get this working.<div=
><br></div><div>I suppose in the meantime you could create a separate actio=
n called &quot;export all&quot; - although I have a vague recollection of t=
he actions not triggering if there aren&#39;t any rows selected. If that&#3=
9;s the case you could possibly get around it with a bit of JS that selects=
 all on the page when export all is chosen.<div>

<br>

<br><div class=3D"gmail_quote">On Sat, Apr 21, 2012 at 9:53 AM, Josh Cartme=
ll <span dir=3D"ltr">&lt;<a href=3D"mailto:joshcar...@gmail.com" target=3D"=
_blank">joshcar...@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex">



On a default Django admin change list page there is a checkbox in the upper=
 left to select all items on the page (clicking it then allows you to click=
 a link which selects all items in the list, not just the current page).<br=
>




<br>In Mezzanine we do not have either of these.=A0 I am guessing it is rel=
ated to Grappelli.=A0 Is there anything to be done for this or does anyone =
know of a workaround?=A0 It would be very useful as I am working on excel d=
ata export for a custom app that is integrated with a Mezzanine based site.=
<br>




</blockquote></div><br><br clear=3D"all"><div><br></div></div><span><font c=
olor=3D"#888888">-- <br>Stephen McDonald<br><a href=3D"http://jupo.org" tar=
get=3D"_blank">http://jupo.org</a><br>
</font></span></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>

--e89a8f3bac57739d5604be617047--