To create one to many form i tried to follow the post from this
guy
http://blog.jotbe-fx.de/articles/2522/web2py-Normalized-many-to-many-model-with-multiselect-drop-down
Also to create the dropdown etc.
The thing worked kind of but the problem was that my grid was not getting
populated once yo
Postgres. The thimg is i have no table files. They somehow got deleted
On Aug 11, 2015 12:30 PM, "Dave S" wrote:
>
>
> On Monday, August 10, 2015 at 7:32:31 PM UTC-7, Yebach wrote:
>>
>> Thank you for detailed answer
>>
>> I am trying to implement this in SQLFORM? Looks like multiple option is
>>
On Monday, August 10, 2015 at 7:32:31 PM UTC-7, Yebach wrote:
>
> Thank you for detailed answer
>
> I am trying to implement this in SQLFORM? Looks like multiple option is
> not avaliable, the field is presented as text field in the form
>
> BTW - why web2py does not add new field to a table. If
Thank you for detailed answer
I am trying to implement this in SQLFORM? Looks like multiple option is not
avaliable, the field is presented as text field in the form
BTW - why web2py does not add new field to a table. If I set migrate to
True I get an error "table already exists" if it is set to
Hi there.
Web2py has some cool field types called "list:string", "list:integer" and
"list:reference table". Check them here:
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types
In your case, you could avoid the creation of the third table with
*list:refer
I am going to give it a go right now.
On Wednesday, October 16, 2013 7:18:33 PM UTC-5, Anthony wrote:
>
> Actually, I'm not sure this is the right data model. Presumably the
> product table should include just one record per product, so you don't want
> to store a sale id in the product table. I
Actually, I'm not sure this is the right data model. Presumably the product
table should include just one record per product, so you don't want to
store a sale id in the product table. If each sale can include only one
product, then you want a product reference field in the sale table. If each
Thanks Anthony, the default argument, which I am assuming is
"default=auth.user_id",
inserts the user id into the sales table. But what argument should I use to
insert the sale_id into the products table, very much in the same way the
default=auth.user_id inserst the user id in the db.sale.
>
> db.sale.user_id.requires = IS_IN_DB(db, 'auth_user.id')
>
The above line is unnecessary, as you get the IS_IN_DB validator
automatically by default.
> This is an improvement on what I had. But I am not sure if I applied the
> code correctly because the 'user_id' and 'sale_id' have been c
db.define_table(
'sale',
Field('user_id', db.auth_user),
Field('start_date', 'date', requires=IS_DATE()),
Field('end_date', 'date', requires=IS_DATE()),
Field('start_time', 'time', requires = IS_TIME()),
Field('end_time', 'time', requires = IS_TIME()))
db.sale.user_id.requi
This is a problem:
db.define_table(
'sale',
Field('id', db.auth_user, default=auth.user_id),
How about this instead:
db.define_table(
'sale',
Field('user_id', db.auth_user, requires=IS_IN_DB( # See "Forms and
Validators in the Fine Manual
Also do this:
db.define_table(
'prod
Thanks Stifan,
But that doesn't work either, because the product_id now displays in the
sale form. I need to generate the sale_id first, and then have sow in the
product table/form. Right now, it just shows up blank.
On Wednesday, October 16, 2013 11:08:58 AM UTC-5, 黄祥 wrote:
>
> yeah, my pov
yeah, my pov is because your product never save the sale id. imho, i think
your code should be :
db.define_table(
'sale',
Field('product_id', 'reference product'),
Field('user_id', db.auth_user, default=auth.user_id),
Field('start_date', 'date', requires=IS_DATE()),
Field('end_
No. But you can enforce the reference at the web2py level with the
IS_IN_DB validator.
On Aug 8, 2:36 am, Phyo Arkar wrote:
> Yes i understand that 1 to Many do not link to Field but Record but i need
> to Reference to a Field which is not id .
> so with that i can set two primary keys but i wan
Yes i understand that 1 to Many do not link to Field but Record but i need
to Reference to a Field which is not id .
so with that i can set two primary keys but i want to reference to EmailID
(which is not auto increment Integer but a md5sum , string , Unique) .
Is that possible?
On Sun, Aug 8,
as I understand this, the DAL always uses the id field for referencing
in a one to many relationship. And: you don't link to a certain field
(EmailID) but to a record of your emails table.
see http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables
On Aug 8, 8:00 am, Phyo Arka
16 matches
Mail list logo