[Product-Developers] How to search and sort content based on owner last login time?

Laurence Rowe l at lrowe.co.uk
Mon May 14 00:25:17 UTC 2012


Dylan Jay wrote
> 
> On 14/05/2012, at 4:14 AM, Andreas Jung <lists@> wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Sorry but you don't know what you are doing. You retrieve the last_login
>> time *once* and pass the value to a date range query.
>> That's it - nothing more, nothing less.
>>
> 
> He wants to 'sort' on 'owners' last login. Why is a nuts idea and not
> simple.
> To do this you could create a new index in the zcatalog but to keep it
> up to date you'd need to reindex that index everytime anyone logged in
> which would create a lot of writes.
> Zcatalog is a denormslised query system. You can't do a join.
> 

ZCatalog is a collection of indexes and metadata, so I don't think
denormalised makes sense in this context. While the OP's problem is
certainly not a trivial problem to solve with only a content-centric index
that is no reason to dismiss the requirement out of hand.

It is possible to get the last login time for a user in Plone (see for
example: http://pypi.python.org/pypi/collective.lastlogin) and from that it
should be possible to query for all content by each user. So long as the
site is not too large this should offer acceptable performance.

Let's keep Plone mailing lists friendly, helpful and constructive, people.

Laurence



--
View this message in context: http://plone.293351.n2.nabble.com/How-to-search-and-sort-content-based-on-owner-last-login-time-tp7554312p7555624.html
Sent from the Product Developers mailing list archive at Nabble.com.


More information about the Product-Developers mailing list