Yeah, this is the pattern I usually use, too. On Wed, Dec 1, 2010 at 12:41 AM, Thadeus Burgess <[email protected]> wrote: > I prefer singular for the Object models and plural for the tablenames. > > class Person: > __tablename__ = 'people' > > Since the table contains many of the records, but an object instance will > only contain one of those rows. > > -- > Thadeus > > > > > On Tue, Nov 30, 2010 at 5:13 PM, Branko Vukelic <[email protected]> wrote: >> >> On Tue, Nov 30, 2010 at 10:48 PM, pbreit <[email protected]> wrote: >> > Sorry for the newbie, religious question but what is the preference in >> > web2py for table names, plural or singular? Most of the docs seem to >> > indicate singular since that seems to make more sense in code (and you >> > don't really use SQL all that much). But I did see some examples with >> > plural. >> >> +1 for plural, just to make the discussion more interesting. :) >> >> Anyway, the reason for plurals is: it's a table, so it contains many >> records for something. >> Reason for singular is: ... it looks better in the API. >> >> singular in an API example: >> >> get.people.last() vs Get last person >> get.person.last() vs Get last person (more similar?) >> >> -- >> Branko Vukelić >> >> [email protected] >> [email protected] >> >> Check out my blog: http://www.brankovukelic.com/ >> Check out my portfolio: http://www.flickr.com/photos/foxbunny/ >> Registered Linux user #438078 (http://counter.li.org/) >> I hang out on identi.ca: http://identi.ca/foxbunny >> >> Gimp Brushmakers Guild >> http://bit.ly/gbg-group > >
-- Branko Vukelić [email protected] [email protected] Check out my blog: http://www.brankovukelic.com/ Check out my portfolio: http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca: http://identi.ca/foxbunny Gimp Brushmakers Guild http://bit.ly/gbg-group

