[web2py] How do I make directed relationship?

2010-01-07 Thread Christopher Helck
Perhaps this is a basic DB question: I want to model people who like other people. So I have a table of people and a table of relationships called 'likes'. The 'likes' table contains two columns: person, and endeared, both representing people. The problem comes when I want to join the two tables t

[web2py:38417] What does form.accepts() do?

2010-01-05 Thread Christopher Helck
I can not understand form.accepts(). I think it's because my intuitive understanding of web2py is wrong. Here's how I think it works: A simple controller function ( index() say) can return a string in which case web2py will simply serve it up as a web page. The same function can return a dictionar

[web2py:38413] Validation design question

2010-01-05 Thread Christopher Helck
Is it better to add validation at the DB level through Field level constraints like 'unique' or to validate at the form? When would it make sense to validate at the DB level? Thanks, C. Helck -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To p

Re: [web2py:38412] Re: DAL Question

2010-01-05 Thread Christopher Helck
91, in >self._execute = lambda *a, **b: self._cursor.execute(*a, **b) > IntegrityError: column name is not unique > >>> > >>> print "Tables" > Tables > >>> print db().select(db.foo.ALL) > foo.id,foo.name > 1,joe > 2,sally > >

Re: [web2py:38329] Re: DAL Question

2010-01-04 Thread Christopher Helck
How do I know which version of sqlite web2py is using? I have both sqlite 2.8.17 and 3.6.21 installed on my system. Do I need to set LIBPATH specifically? Thanks for the help, Christopher Helck On Mon, Jan 4, 2010 at 10:14 PM, mdipierro wrote: > I just tried it on mine: > >>>

[web2py:38323] DAL Question

2010-01-04 Thread Christopher Helck
My DB skills are not strong, so please forgive if this is a dumb question. Why does the following from my db.py not do what I want it to do? # db.define_table('foo', Field('name', unique=True)) db.foo.truncate() db.foo.insert(name='joe') db.foo.insert(name='sally') db.foo.insert(n

Re: [web2py:37993] Re: Multiple DB keys in from pull down menu

2009-12-28 Thread Christopher Helck
), field) Thanks, C. Helck On Tue, Dec 29, 2009 at 12:03 AM, mdipierro wrote: > > > On Dec 28, 10:23 pm, Christopher Helck > wrote: > > Thanks for the response. I believe I understand your suggestion. DBs are > not > > one of my areas of strength, and so I'm stru

Re: [web2py:37984] Re: Multiple DB keys in from pull down menu

2009-12-28 Thread Christopher Helck
b.application), > Field('component_id', db.component)) > > db.define_table('report', > Field('from_id', db.application), >Field('to_id', db.application)) > > If you use 1.74.4 and the format attribute you do not need to s

[web2py:37983] How do I debug?

2009-12-28 Thread Christopher Helck
I have a db.py that is giving me all sorts of problems. If I start Python on the command line, what do I need to do to initialize my environment to be like web2py ? Is there a way to source db.py and start debugging? Thanks, C. Helck -- You received this message because you are subscribed to the

[web2py:37918] Multiple DB keys in from pull down menu

2009-12-27 Thread Christopher Helck
I apologize if this is more of a DB question than a web2py question, but I'm having trouble with populating a drop down menu in the admin interface. I have a table (called 'version') with two keys ('name' and 'version') and a third column 'component_id'. This table records which versions of an ap