>
> Many thanks to you guys for answering so many user questions. I am finding
>> it really helpful.
>>
>
Cheers
Andrew
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list
works like a charm!!
thank you Annet!!!
thank you Anthony!!!
On Tuesday, June 18, 2019 at 3:11:08 PM UTC-4, Annet wrote:
>
> I think Anthony answered this question in this post:
>
> https://groups.google.com/forum/?fromgroups=#!topic/web2py/okMVqyQPKV8
>
> hope he did ;-)
>
>
> Regards,
>
>
I think Anthony answered this question in this post:
https://groups.google.com/forum/?fromgroups=#!topic/web2py/okMVqyQPKV8
hope he did ;-)
Regards,
Annet
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
It's a reference field (foreign key) and the pull down has no empty value.
It should have (because it can be null), but it doesn't for some reason.
On Wed, Jun 5, 2019, 10:44 PM Dave S wrote:
>
>
> On Wednesday, June 5, 2019 at 3:56:56 PM UTC-7, Vlad wrote:
>>
>> How can I search for None
On Wednesday, June 5, 2019 at 3:56:56 PM UTC-7, Vlad wrote:
>
> How can I search for None values?
>
> For example, the search expression
>table.customer == "1"
> gives me records with customer equals 1.
> I can't figure out how to search for records with customer field equals
> None.
>
>
See the answer at
https://groups.google.com/d/msg/web2py/i01tO7LQVYE/APWn-NPoCAAJ.
The only difference is you need to conditionally set the values to True or
False depending on which button was clicked. Assuming the approve/reject
filtered buttons are your 5th and 6th buttons, respectively, it
Hi,
The code I am using is as below - I have 'Approve Selected Corporates',
'Reject Selected Corporates', 'Approve All Corporates' and 'Reject All
Corporates' buttons working in the selectable list. I am changing
corp_approved boolean column to True or False as per the button on which
user
On Monday, November 14, 2016 at 2:07:02 AM UTC-5, Anthony Smith wrote:
>
> Hi Anthony,
>
> I thought I would try this, but getting the following error:
> (global name 'selected_true_callback' is not
> defined)
> It would be great if you could explain what I am doing wrong
>
You said you
Hi Anthony,
I thought I would try this, but getting the following error:
(global name 'selected_true_callback' is not
defined)
It would be great if you could explain what I am doing wrong
thanks
Anthony
On Thursday, 27 October 2016 03:20:30 UTC+11, Anthony wrote:
>
> Note, the "searchable"
Note, the "searchable" argument can be a custom callable -- so, you can
create a custom function that first calls the default internal query
builder to get the query that filters the records, then run the update
using that query, and then simply return the query for use by the grid.
Here is an
Responding to this old post.
query = db.Project.created_by == auth.user_id;
if_author = lambda row: (row.created_by==auth.user_id)
#grid = SQLFORM.smartgrid(db.Project,
constraints={'db.Project':query},editable=if_author,deletable=if_author,details=True,create=False,csv=False)
Instead of {'db.Project': query}, it should be {'Project': query}.
db.Project is a Table object, but "Project" is the table name.
Anthony
On Friday, January 8, 2016 at 2:12:17 PM UTC-5, Ron Chatterjee wrote:
>
> Responding to this old post.
>
>
> query = db.Project.created_by ==
I see the problem. When the grid involves a join, you must refer to fields
within a row via the row.table.field format. However, when you view/edit a
record from such a grid, only the record from a single table is shown
(i.e., there is no longer a join involved), so you must now refer to fields
Thank you so much. This works like a charm.
2015-11-01 14:24 GMT+08:00 Anthony :
> I see the problem. When the grid involves a join, you must refer to fields
> within a row via the row.table.field format. However, when you view/edit a
> record from such a grid, only the
I dont have special function for edit. When I click the icon on to edit the
record I get this error. I did not wrote any special function. I am using
web2py's
2015-11-01 11:38 GMT+08:00 Anthony :
> On Friday, October 30, 2015 at 11:03:18 PM UTC-4, Yebach wrote:
>>
>> The
On Friday, October 30, 2015 at 11:03:18 PM UTC-4, Yebach wrote:
>
> The thing is IF I put links = [lambda row: A('',_class='glyphicon
> glyphicon glyphicon-remove-sign',
> callback=URL('settings','deactivate',vars=dict(table='workers_skills',field
> = 'ws_status'
> ,value = row.workers_skills.id
My whole function
@auth.requires_login()
def workers_skills():
user = auth.user_id
org = db(db.auth_user.id ==
user).select(db.auth_user.organization)[0]["organization"]
db.workers_skills.ws_organisation.default = org
query=((db.workers_skills.ws_organisation == org) &
The thing is IF I put links = [lambda row: A('',_class='glyphicon glyphicon
glyphicon-remove-sign',
callback=URL('settings','deactivate',vars=dict(table='workers_skills',field
= 'ws_status'
,value = row.workers_skills.id )))]
Then my function for "deleting" record works but when I want to go to
is your "id" in the grid ? id it's not in the fields then it's not
accessible
On Friday, October 30, 2015 at 2:41:41 AM UTC+1, Yebach wrote:
>
> why am I getting an error AttributeError: 'Row' object has no attribute
> 'id'
>
> when I try to set links = [lambda row: A('',_class='glyphicon
why am I getting an error AttributeError: 'Row' object has no attribute
'id'
when I try to set links = [lambda row: A('',_class='glyphicon glyphicon
glyphicon-remove-sign',
callback=URL('settings','deactivate',vars=dict(table='workers_skills',field
= 'ws_status'
,value = row.id )))],
thanx for this
Yes I have a redirect to another page.
So if user creates a shift that already exists (code is based on times of
duration), i want to give him a choice to go to that shift and activate it
in case its status is archived
do you recommend another way. I give now flash message but if
I suppose that's fine -- it just wasn't clear to where you were redirecting
or why.
On Wednesday, October 7, 2015 at 11:11:27 PM UTC-4, Yebach wrote:
>
> thanx for this
>
> Yes I have a redirect to another page.
>
> So if user creates a shift that already exists (code is based on times of
>
>
> so far the link and everything works ok, but the first validators are not
> working so i get an error cos the sh_.field which is autogenerate is not
> done
>
> if (grid_shifts.create_form and grid_shifts.create_form.errors) or (
> grid_shifts.update_form and grid_shifts.update_form.errors):
Hello
I have a new problem with my forms.
I have validators on the fields
But looks like they are not triggered, so for example
When I insert a new record a first check should be done on the fields like
is_not_empty etc.
Then if that is all ok it has to check the field sh_code and if this
>
> Hello
>
> I have a new problem with my forms.
>
> I have validators on the fields
>
> But looks like they are not triggered, so for example
>
> When I insert a new record a first check should be done on the fields like
> is_not_empty etc.
>
> Then if that is all ok it has to check the field
explained here:
https://groups.google.com/d/msg/web2py/asCPsD9UGb8/ksmYX0UjBx0J
Op dinsdag 22 september 2015 04:22:39 UTC+2 schreef Yebach:
>
> Ok thanx. This worked.
>
> One more question. My SQLFORM.grid is not refreshed after callback. So
> record stays there. HOw to do a grid refresh?
>
>
Ok thanx. This worked.
One more question. My SQLFORM.grid is not refreshed after callback. So
record stays there. HOw to do a grid refresh?
2015-09-19 20:32 GMT+08:00 Anthony :
> On Saturday, September 19, 2015 at 4:18:49 AM UTC-4, Yebach wrote:
>>
>> Hello
>>
>> So I
Hello
So I managed to put link and create it but now I have a probelm getting the
id of the record I want to deal with
links = [lambda row: A('',_class='glyphicon glyphicon
glyphicon-remove-sign',
callback=URL('settings','deactivate',vars=dict(table='skills',field =
'sk_status', value =
On Saturday, September 19, 2015 at 4:18:49 AM UTC-4, Yebach wrote:
>
> Hello
>
> So I managed to put link and create it but now I have a probelm getting
> the id of the record I want to deal with
>
> links = [lambda row: A('',_class='glyphicon glyphicon
> glyphicon-remove-sign',
>
Something like this yes
This is my code
in my controler where i define my SQLFORM.grid
links = [lambda row: A('',_class='glyphicon glyphicon
glyphicon-remove-sign',
_href =URL('settings','deactivate',
vars=dict(s = '2')))]
2015-09-18 1:47 GMT+08:00 Dave S :
>
>
> On
Yes, but what problem do you observe? Are the URLs not getting generated
properly? Is the value not available in request.get_vars? What happens when you
click? Can you show the code of the action associated with that URL?
--
Resources:
- http://web2py.com
- http://web2py.com/book
I am trying with something like this
links = [lambda row: A('',_class='glyphicon glyphicon
glyphicon-remove-sign',
_href =URL('settings','deactivate',
vars=dict(s = '2')))]
But I cannot send vars to my controller function
I also tried with callback()
Any idea why?
I need to send id of the
What do you mean you cannot send vars? Exactly what is happening? Please show
more code.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received
"view" depends on the details=False argument
"add record" on the create=False
Its working exactly as requested :P
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report
On Thursday, September 17, 2015 at 3:55:48 AM UTC-7, Anthony wrote:
>
> What do you mean you cannot send vars? Exactly what is happening? Please
> show more code.
The snippet above looks lik he's trying to set vars within the URL helper
inside the lambda. Is he trying to make a link that
Thank you.
On Thursday, September 17, 2015 at 12:06:33 PM UTC-4, Niphlod wrote:
>
> "view" depends on the details=False argument
> "add record" on the create=False
>
> Its working exactly as requested :P
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
Thank you for fast reply
Will try with links. I have more then just active or inactive status, so i
guess the other option is out. But will keep that in mind for next projects
and/or tasks
thank you again
2015-09-14 23:42 GMT+08:00 Anthony :
> You can use the "links"
You can use the "links" argument to create additional buttons/links, either
in separate columns or in the column that includes the view/edit/delete
buttons.
Alternatively, you might consider setting up record versioning, either for just
this table
If I do have an Add button but I add the folowing after the grid creation:
grid = SQLFORM.grid(db.place)
for a in grid.elements('input',_name='mode'):# disable mode change. can
be done on a separate form
a['_disabled']=''
to manipulate the html so the radio button will be disable
Thanks Antony This did the trick, I think it is a serious bug (.. but all
bugs are serious:-)
Regarding the Add button, I removed the authentication to make it simpler
for testers to see the bug. I do have it in my app.
Now we can move to the next bug:
If I do have an Add button but I add the
For now, one workaround might be to do this right before defining the grid:
db.place.mode.type = 'integer'
In that case, because the grid won't think the field is a reference
field, it will not attempt to cache the output of the represent function.
Also, you probably don't see an Add button
You have found a bug, which I have submitted here:
https://github.com/web2py/web2py/issues/1024
Thanks for putting this together.
Anthony
On Friday, July 17, 2015 at 1:53:36 PM UTC-4, icodk wrote:
The attached app is a simple two tables app that demonstrates smart/grid
bug in represent
If I use
if form.accepted:
I still get an error
type 'exceptions.AttributeError' 'DIV' object has no attribute 'accepted'
I put div class=flash{{=response.flash}}/div in my view
2014-07-21 16:05 GMT+02:00 Anthony abasta...@gmail.com:
The message is in response.flash, so you need to display
Looks like everything I do with form.* after I declare it in my controller
I get an error
What am I doing wrong here?
2014-07-22 8:15 GMT+02:00 Vid Ogris vid.og...@gmail.com:
If I use
if form.accepted:
I still get an error
type 'exceptions.AttributeError' 'DIV' object has no attribute
you say form = SQLFORM.grid() but this is not a form, this is a grid
even if you call it form. Therefore there is no form.process(), there is no
form.accepted, there is no form.errors etc. This if not a form.
A grid MAY contain a form so you should do:
grid = SQLFORM.grid()
if
Sorry, forgot that you have to extract the form from the grid object. You
can also get the create and update forms via:
form = grid.element('.web2py_form')
Note, that will be None if there is no form (e.g., when loading just the
grid), so first test that it exists.
Anthony
On Tuesday, July
Do not call the .process method on a grid -- it automatically does the
processing itself. If you don't like the default flash messages, you can do:
if form.accepted:
or:
SQLFORM.grid(..., formargs=dict(message_onsuccess='form accepted',
message_onfailure='form
Thank you on fast reply
How do I present this message in my view?
2014-07-21 14:13 GMT+02:00 Anthony abasta...@gmail.com:
Do not call the .process method on a grid -- it automatically does the
processing itself. If you don't like the default flash messages, you can do:
if form.accepted:
The message is in response.flash, so you need to display that in your view
somewhere (it is already present in the layout.html of the scaffolding app).
Anthony
On Monday, July 21, 2014 8:23:16 AM UTC-4, Yebach wrote:
Thank you on fast reply
How do I present this message in my view?
You don't need the grid for that -- just use a SQLFORM:
form2 = SQLFORM(db.Participant, fields=fields).process()
Anthony
On Friday, December 13, 2013 11:38:03 AM UTC-5, LaDarrius Stewart wrote:
Is there to only give the add(create) functionality of the sqlform.grid
Example:
Nah that still brings back the entire set of records
On Friday, December 13, 2013 10:38:03 AM UTC-6, LaDarrius Stewart wrote:
Is there to only give the add(create) functionality of the sqlform.grid
Example:
db.define_table('Participant',
Field('FirstName' , 'text'),
Also in my model I have db.Participant.Member_Local.widget =
SQLFORM.widgets.autocomplete(request, db.Locals.LocalName,
id_field=db.Locals.Id)
Is there a way to pass a given list of ids instead of the available Ids in
the entire db. i.e.
allowed=(1,2,3)
db.Participant.Member_Local.widget =
i think you can achieve it with :
not tested
create = True
editable = False
deletable = False
searchable = False
details = False
csv = False
sortable = False
links_in_grid = False
showbuttontext = False
def participant():
grid=SQLFORM.grid(*db.*Participant, create = create, editable =
Answered in other thread...
SQLFORM.grid(query) OK
SQLFORM.smartgrid(table) OK
SQLFORM.smartgrid(query) WRONG!
SQLFORM.smartgrid(table, contraints={'tablename':query}) OK
On Tuesday, 16 July 2013 01:03:58 UTC-5, Sarbjit singh wrote:
I am doing the following steps :
db =
at 99% you don't need to change any of the sqlhtml.py code, just the css
classes assigned to the paginator.
Probably the default jquery-ui was meant to work with an older version of
the css
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
*SOLVED! *
Well - The code below was added to plugin layout's default.css to resolve
this issue. Which in my case was situated here
[static\plugin_layouts\layouts\Layout Name\default.css]. Note - web2py's
css (base.css ) and its pagination code or grid code remain unchanged.
.pagination ul,
Hey All,
Any suggestions? Do I need to modify anything in sqlhtml.py file
or other files? The application I created was with an older version of
web2py. I am upgrading it so do I need to update or replace any files? css
files etc ?
Help would be much appreciated.
Thanks, Rahul .
On
I made help'er function to generate representation
def ref_repr(reffered_table):
return lambda foreign_key, self: reffered_table[foreign_key].name
so you can add representation this way:
Even when using the following it does not show the country name.
I assume you are expecting it to use the country table's format
attribute to show the country name rather than the id. However, that only
works automatically if (a) the field in question is a reference field (it
is not in your first example), and (b) you do not explicitly set your own
actually, I didn't set anything for user_signature, which defaults to
False, right?
Anyway, I tried user_signature=False, and the ADD button appears. :)
Thanks Massimo. :)
On Sunday, September 30, 2012 11:34:59 AM UTC+8, Massimo Di Pierro wrote:
Did you set user_signature=False?
On
No. That's not how it should be.
user_signature = True is default. It means you MUST be logged in to enable
db write access. In your case [add] and [edit] do not appear because you
are not logged in the app.
If you set user_signature = False, you allow write access to DB from
everybody. Very
Did you set user_signature=False?
On Saturday, 29 September 2012 21:24:56 UTC-5, lyn2py wrote:
Hi guys, I just noticed that if the grid is empty, there is no ADD button,
even when I explicitly used create=True. Is this the expected behavior?
I have lots of empty grids for users to input,
On 2 December 2011 19:36, Anthony abasta...@gmail.com wrote:
Please submit an issue: http://code.google.com/p/web2py/issues/list
On Friday, December 2, 2011 11:35:01 AM UTC-5, peter wrote:
I have discovered that the error only occurs when one is editing records
that are returned from a
I have discovered that the error only occurs when one is editing records
that are returned from a query
Please submit an issue: http://code.google.com/p/web2py/issues/list
On Friday, December 2, 2011 11:35:01 AM UTC-5, peter wrote:
I have discovered that the error only occurs when one is editing records
that are returned from a query
Have you tried something like:
SQLFORM.grid(..., editable=auth.has_membership('editor_group'),
deletable=auth.has_membership('delete_group'),
user_signature=True)
Anthony
On Wednesday, November 9, 2011 5:16:10 AM UTC-5, Naleen Yadav wrote:
Hii All,
I am using sqlform grid and i just
Anthony
This is fantastic. I too was looking for a way to do this but this
didn't occur to me. Works great.
-Jim
On 11/9/2011 7:27 AM, Anthony wrote:
Have you tried something like:
SQLFORM.grid(..., editable=auth.has_membership('editor_group'),
+1
On Nov 9, 7:27 am, Anthony abasta...@gmail.com wrote:
Have you tried something like:
SQLFORM.grid(..., editable=auth.has_membership('editor_group'),
deletable=auth.has_membership('delete_group'),
user_signature=True)
Anthony
On Wednesday, November 9, 2011 5:16:10 AM UTC-5,
Thanks to all
its working.
I have one more problem that i dont want the add button to appear in the
form layout for that i tried few things such as writable=False but it is
wrong to use writable,
so can u tell the possible solution.
Once again thanks to u all.
On Thu, Nov 10, 2011 at 12:39 AM,
sorry for this post i got the solution to remove the add button from the
form.
its using the create=auth.has_membership('group_name')
now all things are working.
thanks a lot . I am pretty excitted about web2py.
Regards,
Naleen Yadav
GENPRO Technologies Pvt Ltd.
On Thu, Nov 10, 2011 at 11:31
I do not see the screenshot. :-(
This should work, although may not work the way you want.
On Sep 14, 4:48 pm, Jim Steil j...@qlf.com wrote:
In response to #3, I see what is going on now. I'm working on a
membership database where I have the following model:
### db.py
member =
I'm using the new format of the google group and see them as attachments
at the bottom of the post. I can create new ones if that helps?
-Jim
On 9/14/2011 10:07 PM, Massimo Di Pierro wrote:
I do not see the screenshot. :-(
This should work, although may not work the way you want.
On Sep
Ok, found the problem. I was missing an 's' in the line:
memberTag.memberId.requires = IS_IN_DB(db, db.member.id,
'%(firstName) %(lastName)s',
zero=('select member'))
Should have been:
memberTag.memberId.requires =
Again, found to be a typo on my end. I should give it up for the night
-Jim
On 9/15/2011 12:12 AM, Jim Steil wrote:
Ok, found the problem. I was missing an 's' in the line:
memberTag.memberId.requires = IS_IN_DB(db, db.member.id,
'%(firstName)
74 matches
Mail list logo