I want to add a custom attribute so that I can decide which customwidget
has to be used for a form field connected to that field.
Example:
db.define_table('person',
Field('salutation', mycustomwidget='select2', label = T('Salutation'),
requires=IS_IN_SET(GENDER), represent=lambda v, r: GENDE
I've found a solution:
rows = db(db[table].id == id).select()
rendered_row = rows.render(0, fields=[db[table][column]])
value = rendered_row[column]
On Saturday, April 21, 2018 at 12:31:49 PM UTC+2, xelomac wrote:
>
> Thank you Anthony. Works perfectly in a SQLFORM.grid. The
t; Anthony
>
> On Sunday, April 15, 2018 at 4:47:27 AM UTC-4, xelomac wrote:
>>
>> Consider the following example.
>>
>> Model:
>>
>> GENDER = {"male": T("Mr.", lazy=False),
>> "female": T("Ms.",
Consider the following example.
Model:
GENDER = {"male": T("Mr.", lazy=False),
"female": T("Ms.", lazy=False)}
db.define_table('person',
Field('gender', label = T('Salutation'), requires=IS_IN_SET(GENDER)),
Field('first_name', label = T('First Name'),
Field('last_name', l
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,
>
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
:8000/title-of-the-page (invalid request)
I have to enter: http://127.0.0.1:8000/show_color_page/title-of-the-page to
access that page.
Any idea why?
On Monday, September 2, 2013 3:20:05 PM UTC+2, Anthony wrote:
>
> What does your routes.py file look like now?
>
> On Monday, September
Hi everybody,
after playing around with routes.py for a while I wonder if what I want to
do is possible at all. I want to rewrite the URLs shown to the visitor
after clicking a menu link in the following way:
Lets say I built a site that deals with colors. My menu shows base color
links like r
re examples in the book [1].
>
> [1] http://web2py.com/books/default/chapter/29/04/the-core#URL-rewrite
>
> On Tue, Aug 27, 2013 at 1:08 PM, xelomac >
> wrote:
> > Thanks - good idea - but how do I force the URL to show the language
> token
> > like &
master/applications/admin/views/layout.html#L62
>
> https://github.com/web2py/web2py/blob/master/applications/admin/models/0.py#L79
>
>
> On Tuesday, 27 August 2013 06:00:57 UTC-5, xelomac wrote:
>>
>>
>>
>> Hi folks,
>>
>> I'm working on a mul
Hi folks,
I'm working on a multilingual CMS. Therefore I need to give the site
visitor the option to change the content language using a language switcher
menu link. My question is about changing content language not about
changing surface language (please no T function answers here :-)
So f
] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://rhcloud.com/~/git/web2py.git/'
Any idea what's going wrong?
Best,
xelomac
On Friday, June 8, 2012 5:07:39 PM UTC+2, Andrew Replogle wrote:
>
> Just FYI to anyone interested, I&
12 matches
Mail list logo