Not understand what is my_user...

Did you affect db to my_user??

my_user = db?

Richard

On Wed, Mar 7, 2012 at 7:36 AM, greenguerilla
<[email protected]>wrote:

> Hi,
>
> I have a table - called table - which keys into the auth_user table. This
> means that I can execute the following code:
>
> my_user.table.count(), my_user.table.select() where my_user is a record of
> type db.auth_user. This is a really nice feature, I'm wondering if there is
> some way to use this to order results...
>
> Normally, when specifying an orderby I might use something like
> orderby=db.auth_user.join_date (where join date is a field on the user
> table).
>
> However this retrieval of a SET of tables which reference a given user
> only works with an instance of auth_user.  db.auth_user.table throws an
> error as table is not a Field of this model..
>
> So, what I want to do is -  orderby=db.auth_user.table.count() - to get a
> list of users ordered by how many tables they have.
>
> Sadly, this doesn't work. Is there a way implement what I want to do?
>
> Cheers,
>
> John
>

Reply via email to