I have a table that follows the following structure:
db.define_table('collection',
Field('IssueYr', 'integer',
requires = [IS_NOT_EMPTY(), IS_INT_IN_RANGE(1965,2018,
"Not
a valid year of issue")],
widget = lambda f, v: SQLFORM.widgets.in
Hi all,
in a controller function I want to check if a field is set as writable in
the model before updating it. "if db[table][column].writable == False" did
not work. I have the following:
def upd_field_value():
id,table,column = request.post_vars.id.split('.')
value = request.post_vars
perhaps you can print the value of fields writable then compare it
*e.g.*
field_writable = db.table.field.writable
*ref:*
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Run-time-field-and-table-modification
best regards,
stifan
--
Resources:
- http://web2py.com
- h
Hi all,
I am having issue exporting virtual fields to CSV using grid. It displays
fine though.
I defined field in this way
Field.Virtual('cost_value', lambda row: row.inventory.cost_price_avg *
row.inventory.qty, label=T('Stock value')),
When I export it to CSV in grid I got the following er
On Sunday, April 8, 2018 at 4:27:59 AM UTC-4, xelomac wrote:
>
> Hi all,
>
> in a controller function I want to check if a field is set as writable in
> the model before updating it. "if db[table][column].writable == False" did
> not work.
>
What do you mean by "did not work"? That is the correc
Sorry - I cannot comprehend what I have done wrong before.
"if db[table][column].writable == False:" works now as expected.
On Sunday, April 8, 2018 at 5:44:55 PM UTC+2, Anthony wrote:
>
> On Sunday, April 8, 2018 at 4:27:59 AM UTC-4, xelomac wrote:
>>
>> Hi all,
>>
>> in a controller function I
Recently I moved the sessions from the database to Redis, and I'm
wondering: is there a way to retrieve info about sessions when they are
stored in Redis?
For example, when sessions are stored in the database, you have the option
to use SQL to do some stuff like counting or deleting sessions. H
I moved the iteration to the controller side and it worked.
Regards
On Sat, Apr 7, 2018 at 5:36 PM, Anthony wrote:
> Also, there is not point to either of the for loops at the top of the view
> -- each loop is simply assigning a new value to the same variable, so the
> final value of the variabl
8 matches
Mail list logo