-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2 May 2007, at 15:10, Aldarion wrote:

> can't agree with you any more.
> this should be done in the section of templates .
> just for this case.
> c.titles = [page.title for page in model.Page.select()] was choose in
> 8.4.
> so the code c.titles = model.Page.select() doesn't work here(at least
> on my PC).
> for they share the same templates.

Aha. Didn't mean to appear patronising ...

/Now/ I see (with help from #pylons).

If you look at the content of model.py, you will see the following  
method specified for Page:

>     def __str__(self):
>         return self.title

Digging into the template list.myt, we see:

>     <% h.draggable_element("page-"+ str(title), revert=True) %>

The c.titles variable is "overloaded": in the list action, a  
collection of titles is assigned to it; in the "delete" action, a  
collection of objects is assigned to it (as you have correctly spotted).

The template relies on str(x) returning a title, irrespective of  
whether x is a title or an object, thus allowing the template to be  
shared.

(Doesn't explain why it doesn't work for you, though, sorry).

HTH

Cheers,

Graham.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAgUBRjioF1nrWVZ7aXD1AQJFcwP+In9FMdGV4vGKILl6ccoISCzD9MuMw7oi
qL9d1CZza3GtXehsCetHuOPwvPNluEWDQCAeQLunilt1DDmQMvGpzJcIDOrkbUdz
LZCYq9VgZRfI7AjG77Luv6T8oszFLMj0m1iiTuoqoYuLX5Aceb1rKOQIp998Lzps
2Pvx1Rj1lmc=
=ip/D
-----END PGP SIGNATURE-----


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to