On Mon, Jul 20, 2009 at 4:32 PM, rb <[email protected]> wrote:

>
> Thx so much for your (quick) replies. It really helps to have a
> conversation sometimes.
>
> On Jul 20, 12:40 pm, Yarko Tymciurak <[email protected]> wrote:
> > On Mon, Jul 20, 2009 at 2:27 PM, rb <[email protected]> wrote:
> >
> > > No, what is an "ordering" table?
> >
> > YOU create a db table where YOU impose your order, e.g.
> >
> > db.define_table('mystuf',  db.Field('name'), db.Field('comment'))
> > db.define_table('myorder_mystuff', db.Field( 'my_sequence', integer #? or
> > whatever), db.Field( 'mystuff_id', db.mustuff))
> >
> > ... That sort of thing.  an order translation table.  Now when you need
> the
> > next 20 items, you get the list of id's of mystuff you want, and build
> your
> > select for the next page from that.
>
> Oh... use a table to map my primary key to the table's id. I don't
> think that would work, unfortunately.


I don't see why you think this (unless there is some requirement of yours
that somehow gets in the way...)

>
>
> Page 139 of the web2py manual says:
>
> "   Notice that you should not declare a field called "id" because one
> is created
> by web2py anyway. Every table has a field called "id" by default. It
> is an
> auto-increment integer field (starting at 1) used for cross-reference
> and for
> making every record unique, so "id" is a primary key."
>
> Sigh. *Every* table's primary key is this insertion-ordered 'id'
> field.


So what?   You aren't talking about something called "ID" for your order;
you are talking about some special order rule you want to control - so the
RAW table (I probosed) would like like

table:
------
id  (by DAL)     |     order (by rb)    |    reference id of source_table
(for dispaly of items on a page)


I think you should experiment, try this a bit...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to