I like this suggestion.

About Denes' question. There is a philosophical issue and a practical
one. Should the record id be assigned by the DB or by the user? I
think it should be assigned by the DB. The practical issue is that
SQLFORM assumes the current record id. You change that and everything
break. It can be fixed but web2py will become much more bloated. I
believe having an autoincrement id should be considered good practice
and enforced by web2py.

Massimo

On Mar 11, 12:50 am, Yarko Tymciurak <yark...@gmail.com> wrote:
> that would be useful - to map DAL field names (in general) to database field
> names....
> Example:
>
> Legacy DB has short, obtuse names;  you write code to handle OLD database,
> and want field names that actually make your code readable (!), and perhaps
> even make reasonable first level forms.
>
> This is sort of like creating DAL views into the data (note: you could do
> the same w/ the DB, and operate on the view).
>
> What is the argument (then) for creating a view in DAL / web2py --- instead
> of doing it in the database?
>
> I can think of one argument against:   this kind of mapping is not portable
> (it is specific to a database, a VERY strong argument that it's mapping
> should be done close to the database).
>
> Even sqlite has views!
>
> So - I think this IS handly - and you can already do it at the DB end (where
> it would seem it better belongs in any case).
>
> I welcome further discussion on this.
>
> Regards,
> Yarko
>
> On Tue, Mar 10, 2009 at 8:59 PM, DenesL <denes1...@yahoo.ca> wrote:
>
> > Massimo,
> > could you please explain the reason(s) for having the ID field in a
> > table?.
>
> > I see it being used to make each row unique.
> > It also makes a very convenient index: small, anonymous, sortable, ...
>
> > But, it also hampers the use of web2py with existing tables.
> > IMHO it should be possible to alias the id field to any existing
> > primary key(s).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to