All is good.
I just wanted to make sure I was seeing the intended behavior.
On Sep 15, 9:30 am, Massimo Di Pierro
wrote:
> After reading this again and again... this is the intended behavior.
>
> form = SQLFORM(,hidden=...) causes the hidden fields to be passed
> with the submission, no more
After reading this again and again... this is the intended behavior.
form = SQLFORM(,hidden=...) causes the hidden fields to be passed
with the submission, no more, no less. form.accepts(...) is not
intended to read the received hidden fields and move them into
form.vars. The reason is securit
Hmmm.
I'm on 1.98.2.
This needs more investigation, but I can't do it today.
On Aug 30, 8:39 am, DenesL wrote:
> SQLFORM with hidden fields works fine in 1.98.2:
>
> # model
> db.define_table('dog',
> Field('name'),
> Field('age', 'integer')
> )
>
> # controller
> def newdog():
> form =
SQLFORM with hidden fields works fine in 1.98.2:
# model
db.define_table('dog',
Field('name'),
Field('age', 'integer')
)
# controller
def newdog():
form = SQLFORM(db.dog, fields=['name'], hidden={'age': 1})
if form.accepts(request, session):
response.flash = 'ok'
elif form.errors:
The rest of the insert is working.
As a workaround I'm doing a table update right after the
form.accepts() and just before the redirect.
On Aug 29, 3:45 pm, Anthony wrote:
> Does it insert the non-hidden fields, or is no record getting inserted at
> all?
>
>
>
>
>
>
>
> On Friday, August 26, 201
Does it insert the non-hidden fields, or is no record getting inserted at
all?
On Friday, August 26, 2011 5:43:15 AM UTC-4, Cliff wrote:
>
> I use SQLFORM something like this:
>
> fields = 'dog_name dog_weight dog_birtdate'.split(' ')
> hidden = {'dog_owner' : some_known_value} # We already kno
On Aug 29, 1:22 pm, Cliff wrote:
> It would look something like this:
>
> db.define_table('dogs',
> Field('dog_name'),
> Field('dog_birthdate', 'date'),
> Field('dog_weight', 'integer'),
> Field('dog_owner', db.owner)
> )
> db.dogs.dog_owner.requires=IS_IN_DB(db, db.dogs.id,
>
It would look something like this:
db.define_table('dogs',
Field('dog_name'),
Field('dog_birthdate', 'date'),
Field('dog_weight', 'integer'),
Field('dog_owner', db.owner)
)
db.dogs.dog_owner.requires=IS_IN_DB(db, db.dogs.id,
'%(owner_name)s', zero="Choose an owner")
Caveat: no
Anthony,
Good catch.
The form should be SQLFORM, the table should be db.purchase_orders.
On Aug 29, 10:18 am, Anthony wrote:
> Did you show the correct controller code? Your form is define as a SQLTABLE
> (rather than SQLFORM), and the table argument is db.suppliers, not
> db.purchase_orders.
Did you show the correct controller code? Your form is define as a SQLTABLE
(rather than SQLFORM), and the table argument is db.suppliers, not
db.purchase_orders.
Anthony
On Monday, August 29, 2011 7:33:25 AM UTC-4, Cliff wrote:
>
> Not sue that would help.
>
> The insert goes into purchase_or
Cliff, please post the related "dogs" table model.
Not sue that would help.
The insert goes into purchase_orders, not supplier_contacts.
On Aug 26, 4:16 pm, Anthony wrote:
> Does it work if you set db.supplier_contacts.supplier_id.writable = True in
> the controller function?
>
>
>
>
>
>
>
> On Friday, August 26, 2011 11:12:31 AM UTC-4, Cliff wr
Does it work if you set db.supplier_contacts.supplier_id.writable = True in
the controller function?
On Friday, August 26, 2011 11:12:31 AM UTC-4, Cliff wrote:
>
> Massimo,
>
> Thank you.
>
> Of course.
>
> Here are are the real table defs:
> ++
Massimo,
Thank you.
Of course.
Here are are the real table defs:
+++
++
db.define_table('purchase_orders',
Field('issue_date', 'date'),
Field('number', length=24, requires=IS_NOT_EMPTY(),
required=True,
Can I see the model?
On Aug 26, 4:43 am, Cliff wrote:
> I use SQLFORM something like this:
>
> fields = 'dog_name dog_weight dog_birtdate'.split(' ')
> hidden = {'dog_owner' : some_known_value} # We already know who the
> owner is
> SQLFORM(db.dogs, fields=fields, hidden=hidden)
>
> The hidden fi
15 matches
Mail list logo