[web2py] Re: Grid: case insensitive sort

2022-11-04 Thread Dave S
On Thursday, November 3, 2022 at 8:57:23 AM UTC-7 vincent...@gmail.com wrote: > Hello, > > I have a simple SQLFORM.grid that shows the rows of my simple SQLite > database. > In the grid, when I click on, say, the "vendorname" column header, this > performs a kind of alphabetical sort, but the s

[web2py] Re: grid: top + button: how to adapt dynamically & translate the title 'add record to database' ?

2020-05-04 Thread Luciano Bovio
I have the same problem on translation I have to modify button text with jQuery. Any ideas ? On Monday, February 12, 2018 at 7:01:17 AM UTC-3, Serge Bourgeois wrote: > > > Hello, > The following codes changes dynamically the title of the button on the top > left of the form in English. > But

Re: [web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Jim S
Wow, way better than what I've been doing. I'm going to have to take a look at that. Thanks! -Jim On Friday, April 24, 2020 at 12:28:56 PM UTC-5, Vlad wrote: > > I see. Thank you. > > I also did some Googling and found what I think should be documented more > explicitly and perhaps more clea

Re: [web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Eliezer (Vlad) Tseytkin
I see. Thank you. I also did some Googling and found what I think should be documented more explicitly and perhaps more clearly in web2py docs (it's there, but unless you know what to look for, you're guaranteed to miss it): when creating grid, the following args=request.args[:1] tells the gri

Re: [web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Jim S
So, you have to manage that yourself. I do it kind of like this. Yes, I know it's ugly but it pretty much works. # if the variable is passed in, get the value search_text = request.get_vars.search_text if request.wsgi.environ['QUERY_STRING'] != '': # we get here if no vars were passed on

Re: [web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Eliezer (Vlad) Tseytkin
Yes, there are arguments on the page already. I don't want the grid to get rid of them when reloading for those actions. On Fri, Apr 24, 2020, 12:39 PM Jim S wrote: > I thought it did keep track of paging. > > Are you looking for it to keep arguments that you supplied? > > -Jim > > On Friday, Ap

[web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Jim S
I thought it did keep track of paging. Are you looking for it to keep arguments that you supplied? -Jim On Friday, April 24, 2020 at 11:33:47 AM UTC-5, Vlad wrote: > > I've got a page with a grid on it. > grid reloads the page on create and other actions. > the page to begin with has argumen

[web2py] Re: Grid sorting bug when default orderby column type is date

2019-05-03 Thread jcrmatos
It was confirmed to be a bug in web2py and it is now corrected. quinta-feira, 28 de Março de 2019 às 18:41:59 UTC, João Matos escreveu: > > Hello, > > I have this action > > @auth.requires(auth.has_membership(CHECKER_ROLE) or auth.has_membership( > SUPERVISOR_ROLE)) > def list_tags_to_issue(): >

[web2py] Re: Grid search and clear buttons don't restore request.args. Where can I correct that?

2019-04-30 Thread jcrmatos
Found the solution. I have to add args=request.args[:1], to the child grid. terça-feira, 30 de Abril de 2019 às 00:37:24 UTC+1, Anthony escreveu: > > What do you mean by master-child pages? Are you using smartgrid? Can you > show some code? > > On Monday, April 29, 2019 at 6:15:30 PM UTC-4, jcrm

[web2py] Re: Grid search and clear buttons don't restore request.args. Where can I correct that?

2019-04-30 Thread jcrmatos
Just noticed now that both search and clear search buttons URLs also remove the search=1 var, but maintain the sid var. Strange isn't it? terça-feira, 30 de Abril de 2019 às 00:37:24 UTC+1, Anthony escreveu: > > What do you mean by master-child pages? Are you using smartgrid? Can you > show som

[web2py] Re: Grid search and clear buttons don't restore request.args. Where can I correct that?

2019-04-30 Thread jcrmatos
I have a master page (in this case an equipment's grid) where I have links to child tables. The URL for the equipment's page is http: //jmatos-p:8000/equipment?search=1&sid=d4b3d39a-b6bc-4c41-af05-d2e9bf7ea195 In this page the search and clear search buttons work fine and show the correct URLs,

[web2py] Re: Grid search collects all records from all fields on each request. Isn't this bad for performance?

2019-04-30 Thread jcrmatos
Ok, thanks Anthony. terça-feira, 30 de Abril de 2019 às 00:34:10 UTC+1, Anthony escreveu: > > On Monday, April 29, 2019 at 6:22:26 PM UTC-4, jcrm...@gmail.com > wrote: >> >> Grid search collects all records from all fields on each request. Isn't >> this bad for performance? >> > > Are you refer

[web2py] Re: Grid search and clear buttons don't restore request.args. Where can I correct that?

2019-04-29 Thread Anthony
What do you mean by master-child pages? Are you using smartgrid? Can you show some code? On Monday, April 29, 2019 at 6:15:30 PM UTC-4, jcrma...@gmail.com wrote: > > Grid search and clear buttons don't restore request.args. Where can I > correct that? > > > If using master-child pages, the maste

[web2py] Re: Grid search collects all records from all fields on each request. Isn't this bad for performance?

2019-04-29 Thread Anthony
On Monday, April 29, 2019 at 6:22:26 PM UTC-4, jcrma...@gmail.com wrote: > > Grid search collects all records from all fields on each request. Isn't > this bad for performance? > Are you referring to "reference" fields, which result in a select element showing associated values from the foreign

[web2py] Re: Grid sorting sorts by id (in case of a FK) instead of shown value (eg. name). Is this normal?

2019-04-29 Thread jcrmatos
So the only way to correct it is the way I used. Thanks Anthony. segunda-feira, 29 de Abril de 2019 às 23:56:18 UTC+1, Anthony escreveu: > > Yes. It shows the values from the foreign table via "recursive selects" > (i.e., a separate query for each displayed row after the initial set of > records

[web2py] Re: Grid sorting sorts by id (in case of a FK) instead of shown value (eg. name). Is this normal?

2019-04-29 Thread Anthony
Yes. It shows the values from the foreign table via "recursive selects" (i.e., a separate query for each displayed row after the initial set of records is fetched from the database), so it is not able to use that information for sorting (which would require the initial query to be a join with t

[web2py] Re: Grid sorting questions (referenced fields and case sensitive)

2019-03-29 Thread João Matos
Found a kludge to sort the grid's search fields list. # Sort grid's search fields list. grid.element('#w2p_query_fields').components = sort_grid_search_fields_list(grid) def sort_grid_search_fields_list(grid: gluon.DIV) -> List[gluon.OPTION]: """Sort grid's search fields list.

Re: [web2py] Re: grid reloading the page and outdated flash msgs? (strange behavior...)

2018-12-27 Thread Eliezer (Vlad) Tseytkin
I got it, finally, It was purely mystical for me, but now it makes sense... Grid is quite a sophisticated beast and does some magic behind the stage... Thank you very much! On Thu, Dec 27, 2018 at 11:08 PM Anthony wrote: > This simply displays an old fashioned grid. Nothing fancy. But now >>

Re: [web2py] Re: grid reloading the page and outdated flash msgs? (strange behavior...)

2018-12-27 Thread Anthony
> > This simply displays an old fashioned grid. Nothing fancy. But now > consider just exactly same code, with 2 extra lines (if (id==0): > redirect(home) : > > def test(): > id = 0 > try: > id = request.args(0, cast=int) > except: > id = 0 > pass > if (

Re: [web2py] Re: grid reloading the page and outdated flash msgs? (strange behavior...)

2018-12-27 Thread Eliezer (Vlad) Tseytkin
Antony, thank you very much, I got the 1st and the 3rd ones. But about the 2nd one it's tricky. Without going into details of why I need it, could you please just glance at the following code that works 100%: def test(): id = 0 try: id = request.args(0, cast=int) except:

[web2py] Re: grid reloading the page and outdated flash msgs? (strange behavior...)

2018-12-27 Thread Anthony
On Thursday, December 27, 2018 at 4:05:40 PM UTC-5, Vlad wrote: > > Here is a test function in my controller: > > def test(): > id = 0 > try: > id = request.args(0, cast=int) > session.flash = "Here is the id: " + str(id) > except: > session.flash = "ID is not v

[web2py] Re: grid column names do not print nicely

2017-12-20 Thread Anthony
> > >> Probably we should add some code to web2py-bootstrap3.css to remove some >> of the URLs from the grid when printing (e.g., headings, pagination links, >> etc.). If you'd like, open a github issue and link to this thread. >> >> Anthony >> > > > Would there need to be a way to override that

[web2py] Re: grid column names do not print nicely

2017-12-20 Thread Dave S
On Wednesday, December 20, 2017 at 11:13:18 AM UTC-8, Anthony wrote: > > Bootstrap includes CSS to print the href values for any links. To disable > this just for links within a web2py grid, you can add the following CSS > somewhere: > > @media print { > .web2py_table a[href]:after { >

[web2py] Re: grid column names do not print nicely

2017-12-20 Thread icodk
Thanks Anthony Eliminating buttons: .btn{ display: none !important; } Eliminating breadcrumb: .w2p_grid_breadcrumb_elem{ display: none !important; } All inside @media print { } The magic continue:-) On Wednesday, December 20, 2017 at 8:13:18 PM UTC+1, Anthony wrote: > > Bootstrap i

[web2py] Re: grid column names do not print nicely

2017-12-20 Thread Anthony
Bootstrap includes CSS to print the href values for any links. To disable this just for links within a web2py grid, you can add the following CSS somewhere: @media print { .web2py_table a[href]:after { content: none !important; } } If you only want to eliminate the URLs from the

{Disarmed} [web2py] Re: grid IS_IMAGE validator behavior

2017-12-07 Thread Carlos Cesar Caballero Díaz
Yes, first I crete the entry using the grid add form without problems, when I open the edit form, the image is in the field, but when I submit the form without changes, the validator says that there is no image. El 06/12/17 a las 14:32, Dave S escribió: On Wednesday, December 6, 2017 at 11:

Re: {Disarmed} Re: {Disarmed} [web2py] Re: grid IS_IMAGE validator behavior

2017-12-06 Thread Dave S
On Wednesday, December 6, 2017 at 11:06:02 AM UTC-8, Carlos Cesar Caballero wrote: > > That's the issue, I don't want null values, the user shouldn't remove the > image without upload a new one, but when I use the grid's edit form, the > validation error is triggered if the user edit another f

{Disarmed} Re: {Disarmed} [web2py] Re: grid IS_IMAGE validator behavior

2017-12-06 Thread Carlos Cesar Caballero Díaz
That's the issue, I don't want null values, the user shouldn't remove the image without upload a new one, but when I use the grid's edit form, the validation error is triggered if the user edit another field, so the form can't be submitted without uploading a new image. El 06/12/17 a las 13:0

[web2py] Re: grid IS_IMAGE validator behavior

2017-12-06 Thread Val K
yes, if you want to allow null-value - use IS_EMPTY_OR wrapper IS_EMPTY_OR(IS_IMAGE(...)) On Wednesday, December 6, 2017 at 8:48:06 PM UTC+3, Carlos Cesar Caballero wrote: > > Hi, I have being using web2py for some time, but I don't use files too > often, now I am using the IS_IMAGE, but usi

[web2py] Re: Grid edit behavior when no changes are made

2017-08-04 Thread Dave S
On Friday, August 4, 2017 at 1:42:54 PM UTC-7, Seth J wrote: > > So, archives on this page: https://github.com/niphlod/web2py/releases > don't contain it?!?! > I'm not sure. I would expect the zip files to, but that's a dev's archive rather than the "official" web2py archive referenced in t

[web2py] Re: Grid edit behavior when no changes are made

2017-08-04 Thread Seth J
So, archives on this page: https://github.com/niphlod/web2py/releases don't contain it?!?! On Friday, August 4, 2017 at 4:34:16 PM UTC-4, Dave S wrote: > > > > On Friday, August 4, 2017 at 1:17:08 PM UTC-7, Seth J wrote: >> >> Another quick question. How do I revert back to 2.14.6 or 2.14.5 t

[web2py] Re: Grid edit behavior when no changes are made

2017-08-04 Thread Dave S
On Friday, August 4, 2017 at 1:17:08 PM UTC-7, Seth J wrote: > > Another quick question. How do I revert back to 2.14.6 or 2.14.5 then? > I downloaded the appropriate version archive and replaced all of the files > in the installation and it still gives me the same error message: > If you'r

[web2py] Re: Grid edit behavior when no changes are made

2017-08-04 Thread Seth J
Another quick question. How do I revert back to 2.14.6 or 2.14.5 then? I downloaded the appropriate version archive and replaced all of the files in the installation and it still gives me the same error message: Version web2py™ Version 2.14.5-stable+timestamp.2016.04.13.22.22.13 Python Python

[web2py] Re: grid show or hidden table coloumn

2017-08-04 Thread Massimo Di Pierro
Yes. The SQLFORM.grid(..., fields=[dt.table.field1, ...],..) let you specify the fields to display. On Tuesday, 1 August 2017 03:32:58 UTC-5, 黄祥 wrote: > > is it possible to show or hidden table coloumn in grid base on user > choosen? > > thanks and best regards, > stifan > -- Resources: - htt

[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Seth J
Thanks, Leonel! Looking forward to it ... On Thursday, August 3, 2017 at 1:24:08 PM UTC-4, Leonel Câmara wrote: > > Seth that 2.15.2 bug has been fixed in trunk. Please wait for 2.15.3 > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Leonel Câmara
Seth that 2.15.2 bug has been fixed in trunk. Please wait for 2.15.3 -- 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 this message because you

[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Seth J
And it appears to be broken: web2py™ Version 2.15.2-stable+timestamp.2017.07.19.12.18.41 Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Traceback (most recent call last): File ".\gluon\restricted.py", line 219, in restricted e

[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Seth J
We're using 2.14.5 version of web2py so far. Let me update one of our dev servers and see if that solves the issue. Thanks, Anthony!!! On Thursday, August 3, 2017 at 12:30:11 PM UTC-4, Anthony wrote: > > Also, what version of web2py are you using? Looking at the code, it > appears this issue m

[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Anthony
Also, what version of web2py are you using? Looking at the code, it appears this issue might be resolved in the current version of the DAL (it now generates all the fields to be updated *before *call the _before_update callbacks, which should result in the archive record being generated due to

[web2py] Re: Grid edit behavior when no changes are made

2017-08-03 Thread Anthony
The problem is that archiving is handled via a _before_update callback, which (a) only receives the fields that are explicitly submitted with the form (i.e., not the modified_on and modified_by fields) and (b) archives only if the submitted fields differ from those in the original record. The m

[web2py] Re: grid for data entry

2017-07-24 Thread Nico de Groot
Looks like you specify the left relation also in the select clause. Debugging tip: you can use _select() to see the SQL generated by the DAL. To get answers in the forum, it helps if you convert your question to an minimal example using easy to grasp tablenames and relations. Nico de Groot --

[web2py] Re: grid for data entry

2017-07-24 Thread T.R.Rajkumar
Any ideas? -- 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 this message because you are subscribed to the Google Groups "web2py-users" group

[web2py] Re: Grid - limit searches to specified fields not whole tables

2017-07-07 Thread 'Matthew J Watts' via web2py-users
Ok thanks Antony i'll look into it, this looks like it could take some time!! On Friday, July 7, 2017 at 2:42:37 PM UTC+2, Matthew J Watts wrote: > > Hi all > > > > I’m having problems trying to tailor the grid to my needs > > I've set up a grid to query my db and it retrieves the data successf

[web2py] Re: Grid - limit searches to specified fields not whole tables

2017-07-07 Thread Anthony
I think you'll need a custom search widget and/or search function (the latter via the "searchable" argument). For details on how the current default search widget is constructed, see https://github.com/web2py/web2py/blob/89832479fccf6bb2d0ef19427bff2ee7f5347807/gluon/sqlhtml.py#L2618. Note, it

[web2py] Re: grid add/edit form label

2017-06-06 Thread T.R.Rajkumar
Thanks a lot icodk. Now I am able to change the text of buttons. -- 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 this message because you are

[web2py] Re: grid add/edit form label

2017-06-06 Thread icodk
Sorry in your case it is form[1][0][2][0]="Som text" This will replace the text in the DOM element of the serialized form returned by the call to SQLFORM.smartgrid Please note that the indexes (1,0,2,0) I used above can be different in your case. To find out start by printing the element to the

[web2py] Re: grid add/edit form label

2017-06-05 Thread T.R.Rajkumar
Thanks icodk for the code. But I do not understand grid[1][0][2][0]. What is that? Could you pl. tell me. Thank you once again. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/lis

[web2py] Re: grid add/edit form label

2017-06-05 Thread icodk
Code example: else: #person grid personRow = db(db.person.id == request.args[-1]).select()[0] title = T("cars owned by :") + personRow.name addBtn = T("Add new car for: ") + carRow.name if toCreate: grid[1][0][2][0] =addBtn On Monda

[web2py] Re: grid add/edit form label

2017-06-05 Thread T.R.Rajkumar
Thanks icodk. You said The last part is after the call to SQLFORM.smartgrid. Here you can manipulate the serialized HTML data by for example changing the "+Add record" text to "+Add person" in the auto generated button I would like to know how you manipulate the html in controller as above f

[web2py] Re: grid add/edit form label

2017-06-05 Thread T.R.Rajkumar
Yes, Anthony. It now works. Thank you for your valuable time. -- 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 this message because you are su

[web2py] Re: grid add/edit form label

2017-06-03 Thread Anthony
Oops, sorry, for some reason I wrapped the labels dict in a list -- should be: formargs={'amc_master': dict(labels={'lrrflg': 'Rate Revision'}), 'amc_details': dict(labels={'qty': 'Quantity'})} On Saturday, June 3, 2017 at 12:32:15 AM UTC-4, T.R.Rajkumar wrote: > > As said I did this

[web2py] Re: grid add/edit form label

2017-06-03 Thread icodk
In a controller that shows a grid/smartgrid, I have three parts.The first part is before the call to the SQLFORM.smartgrid, then next is the call to SQLFORM.smartgrid and the third part is after the call to SQLFORM.smartgrid. In the first part I inspect the request.args to figure out what the gri

[web2py] Re: grid add/edit form label

2017-06-02 Thread T.R.Rajkumar
As said I did this in controller but there is no effect in either create or edit forms of amc_master or amc_details. I added the closing parenthesis for the first dict. Anything I miss? form = SQLFORM.smartgrid(db.amc_master, linked_tables=['amc_details'],

[web2py] Re: grid add/edit form label

2017-06-02 Thread Anthony
Instead of: editargs={'labels':dict(amc_master={'lrrflg':'Rate Revision'}, amc_details={'qty':'Quantity'})} Try: formargs={'amc_master': dict(labels=[{'lrrflg': 'Rate Revision'}], 'amc_details': dict(labels=[{'qty': 'Quantity'}])} Anthony On Friday, June 2, 20

[web2py] Re: grid add/edit form label

2017-06-01 Thread T.R.Rajkumar
You've got it backwards -- the top-level keys of the editargs and createargs parameters should be the table names, with the nested dictionaries holding the actual SQLFORM arguments. I am not familiar with the syntax. Can you pl. elaborate with some actual code. Thanks Anthony. -- Resources: -

[web2py] Re: grid add/edit form label

2017-06-01 Thread Anthony
On Thursday, June 1, 2017 at 5:35:14 AM UTC-4, T.R.Rajkumar wrote: > > For a smartgrid I am doing this. > form = SQLFORM.smartgrid(db.amc_master, > linked_tables=['amc_details'], > user_signature=False, > fields=

[web2py] Re: grid add/edit form label

2017-06-01 Thread Jim S
Set the 'label' attribute on the individual fields that will be displayed before your call to SQLFORM.smartgrid() Ex: db.customer.first_name.label = 'First Name' -Jim On Thursday, June 1, 2017 at 4:35:14 AM UTC-5, T.R.Rajkumar wrote: > > For a smartgrid I am doing this. > form = SQLFORM.smartg

[web2py] Re: grid add/edit form label

2017-06-01 Thread T.R.Rajkumar
For a smartgrid I am doing this. form = SQLFORM.smartgrid(db.amc_master, linked_tables=['amc_details'], user_signature=False, fields=dict(amc_master=list_of_fields), formstyle='table3

[web2py] Re: grid edit

2017-05-31 Thread T.R.Rajkumar
Yes Anthony, with this the grid edit is OK. [setattr(f, 'writable', False) for f in db. amc_master if f.name not in ['id', 'amcdesc', 'amcmod', 'complndays']] But how come it worked fine with postgresql without the id field setting? Anyway thanks a lot for resolving the issue. -- Resources: -

[web2py] Re: grid edit

2017-05-31 Thread Anthony
On Wednesday, May 31, 2017 at 5:39:11 AM UTC-4, T.R.Rajkumar wrote: > > When I do SQLFORM.grid(db.amc_master) without setting any of the > readable/writable attributes the grid edit works fine. I am able to edit > and the form submits without errors. > Even with specifying the fields list grid e

[web2py] Re: grid edit

2017-05-31 Thread Jim S
Have you tried adding 'id' to your editable field list? [setattr(f, 'writable', False) for f in db.amc_master if f.name not in ['amcdesc','amcmod','complndays', 'id']] -Jim On Wednesday, May 31, 2017 at 4:39:11 AM UTC-5, T.R.Rajkumar wrote: > > When I do SQLFORM.grid(db.amc_master) without sett

[web2py] Re: grid edit

2017-05-31 Thread T.R.Rajkumar
When I do SQLFORM.grid(db.amc_master) without setting any of the readable/writable attributes the grid edit works fine. I am able to edit and the form submits without errors. Even with specifying the fields list grid edit works fine as the edit from has all the fields of the table. But when I

[web2py] Re: grid edit

2017-05-30 Thread Anthony
The "id" field is not writable in SQLFORMs, so the grid/SQLFORM do not include that field in update SQL queries. Does the "id" field actually appear as writable in your forms? What happens if you just do SQLFORM.grid(db.amc_master) without specifying the fields list or setting any of the readab

[web2py] Re: grid edit

2017-05-30 Thread isi_jca
T.R.Rajkumar Try setting this value: *field_id* must be the field of the table to be used as ID, for example db.mytable.id. This is useful when the grid query is a join of several tables. Any action button on the grid(add record, view, edit, delete) will work over db.mytable. Regards. -- R

[web2py] Re: grid edit

2017-05-29 Thread T.R.Rajkumar
I don't know why there is no response from anyone in the group. Is the post not clear? Thanks in advance. -- 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) ---

[web2py] Re: grid edit

2017-05-25 Thread T.R.Rajkumar
I googled and saw this https://www.drupal.org/node/2342699 where it is stated that SqlContentEntityStorage::mapToStorageRecord sends update statements that includes IDENTITY fields that need to be updated, such as: UPDATE xxx SET nid = 1, property0 = :value0 WHERE nid = 1;. This is not supporte

[web2py] Re: grid edit

2017-05-24 Thread T.R.Rajkumar
When I connect to postgresql the same model the grid edit form submits without error. Is this to do with pyodbc? -- 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 Issue

[web2py] Re: grid edit

2017-05-24 Thread T.R.Rajkumar
I have this in model. db.define_table('amc_master', Field('amcno', type='string',length=10, required='True',notnull='True',requires=IS_LENGTH(10)), Field('unitid',type='string',length=3,notnull='True'), Field('amcdesc', type='string',length=512,requi

[web2py] Re: grid edit

2017-05-24 Thread Dave S
On Tuesday, May 23, 2017 at 11:28:29 PM UTC-7, T.R.Rajkumar wrote: > > Why is DAL trying to update id column in grid edit form submission. > I think we need your model file to have much idea. /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com

[web2py] Re: grid oncreate

2017-05-23 Thread T.R.Rajkumar
First, why use db.executesql rather than a regular DAL query? Second, you should move the call to get_new_amcno to the controller function where you need to do this insert and set the defaults there -- otherwise, you are doing this database query on every single request to the app, even all the

[web2py] Re: grid edit

2017-05-23 Thread T.R.Rajkumar
Why is DAL trying to update id column in grid edit form submission. -- 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 this message because you

[web2py] Re: grid oncreate

2017-05-23 Thread Anthony
On Tuesday, May 23, 2017 at 7:40:13 AM UTC-4, T.R.Rajkumar wrote: > > I solved the issue as hinted by Anthony and Dave S. > > In model db.py I added this function > > def get_new_amcno(): > rows = db.executesql("exec gen_amcno_new @ucod = > ?,@divcod=?,@sec=?",placeholders=([session.unit,ses

[web2py] Re: grid oncreate

2017-05-23 Thread T.R.Rajkumar
I solved the issue as hinted by Anthony and Dave S. In model db.py I added this function def get_new_amcno(): rows = db.executesql("exec gen_amcno_new @ucod = ?,@divcod=?,@sec=?",placeholders=([session.unit,session.divn, session.sec]),as_dict=True) for i in rows: amcno = i['a

[web2py] Re: grid oncreate

2017-05-23 Thread T.R.Rajkumar
The values are for the user. So as soon the user logs in I can find the values. -- 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 this message

[web2py] Re: grid oncreate

2017-05-22 Thread Dave S
On Monday, May 22, 2017 at 9:28:10 PM UTC-7, T.R.Rajkumar wrote: > > The amcno is coined based on the user, his working division, section and > previous amcno. Also the update_uid is the user who has logged in. As said > may be the update_dt can be set to default request.now. But how to set >

[web2py] Re: grid oncreate

2017-05-22 Thread T.R.Rajkumar
The amcno is coined based on the user, his working division, section and previous amcno. Also the update_uid is the user who has logged in. As said may be the update_dt can be set to default request.now. But how to set others which requires calculation? -- Resources: - http://web2py.com - htt

[web2py] Re: grid oncreate

2017-05-22 Thread Anthony
Specify the "default" argument for the fields you want filled in automatically by the DAL. Anthony On Monday, May 22, 2017 at 7:21:02 AM UTC-4, T.R.Rajkumar wrote: > > I have this in model. > db.define_table('amc_master', > Field('amcno', > type='string',length=10,required='True

[web2py] Re: grid exportclasses not work in recent version

2017-01-04 Thread Andrea Fae'
Hello, I solved with this headers={'sede.nome':'Struttura','sede.is_active':'Attivo'} exportcls = dict(csv_with_hidden_cols=False, xml=True, html=False, json=False, tsv_with_hidden_cols=False, tsv=False) grid = SQLFORM.smartgrid(db.sede,linked_tables=['uo','pc'],fields=[db.sede.nome

[web2py] Re: grid exportclasses not work in recent version

2017-01-03 Thread Anthony
On Tuesday, January 3, 2017 at 11:02:22 AM UTC-5, Andrea Fae' wrote: > > What does it mean exactly? > > I have this but in the view export is exposed totally... why? > What do you mean "export is exposed totally"? What problem are you having? -- Resources: - http://web2py.com - http://web2py.com

[web2py] Re: grid exportclasses not work in recent version

2017-01-03 Thread Andrea Fae'
What does it mean exactly? I have this but in the view export is exposed totally... why? grid = SQLFORM.smartgrid(db.sede,linked_tables=['uo'],fields=[db.sede.nome,db.uo.nome],headers={'sede.nome':'Nome Struttura'},details=True, editable=True, deletable=False, maxtextlength=40,csv=True, export

[web2py] Re: Grid export csv

2016-10-24 Thread Niphlod
never ever pull web2py AND pydal master's and merge (unless you really know what you're doing). When using "master", at most, use web2py's one, which has the correct pointers to pydal's specific commits. Any commit later than 15aug should work fine ^_^ On Friday, October 21, 2016 at 10:54:31 P

[web2py] Re: Grid export csv

2016-10-21 Thread Bartosz Baranowski
Niphlod, I am using latest web2py and pydal from master branches. Any idea where is the fix? Could you please direct me to the commit? W dniu środa, 3 sierpnia 2016 12:51:56 UTC-7 użytkownik Niphlod napisał: > > should be already fixed on master, anyway if you're in a hurry, set > entity_quorin

[web2py] Re: Grid export csv

2016-08-04 Thread Kostas M
As you said, it works again now, by setting: entity_quoting=False Thanks Niphlod! -- 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 this mess

[web2py] Re: Grid export csv

2016-08-03 Thread Niphlod
should be already fixed on master, anyway if you're in a hurry, set entity_quoring=False on the DAL line to make it work again (long story short, DAL now quotes everything by default and not every cog in the wheel was expecting that) On Monday, August 1, 2016 at 1:51:54 PM UTC+2, Kostas M wrote

[web2py] Re: Grid export csv

2016-08-01 Thread Kostas M
I have the same problem with the CSV, HTML, TSV export buttons. The Ticket for the CSV is pasted below. The problem at least with the csv export button seems to be with the REGEX_TABLE_DOT_FIELD. Normally, this constant is defined in regex.py as: REGEX_TABLE_DOT_FIELD = re.compile('^(\w+)\.([^.

[web2py] Re: Grid export csv

2016-08-01 Thread Ryan Hood
DB.PY db.define_table('test', Field('name', 'string', length=50, notnull=True), Field('email', 'string', notnull=True), format="%(name)s") DEFAULT.PY query=(db.test.id>0) fields=[db.test.id,db.test.name,db.test.email] forms=SQLFOR

[web2py] Re: Grid export csv

2016-07-30 Thread Massimo Di Pierro
You press the button. Is this not working? What happens? What you model? What is your grid? On Friday, 29 July 2016 11:23:28 UTC-5, Ryan Hood wrote: > > How do you get the csv export to work in web2py grid? > > NOTE: Working with web2py version 2.14.6 and 2.14.5 > > Thank you, > -- Resources:

[web2py] Re: Grid remove class date/datetime

2016-05-12 Thread isi_jca
Hello!!! In my particular case, I wrote this code in my view: jQuery('input#tmatrizlaboral_fecingreso').removeClass('date form-control'); Greetings. El jueves, 12 de mayo de 2016, 9:45:07 (UTC-3), isi_jca escribió: > > Hi!!! > > Is possible to remove class date/datetime from form Grid?. > >

[web2py] Re: GRID export broken for CSV but not for JSON

2016-02-13 Thread Niphlod
also, the grid relies on the id for other functions, it's always better to include it On Saturday, February 13, 2016 at 12:20:22 AM UTC+1, Anthony wrote: > > This can probably be improved, but the problem is that your grid does not > include all the fields needed by the "represent" function (i.

[web2py] Re: GRID export broken for CSV but not for JSON

2016-02-12 Thread Anthony
This can probably be improved, but the problem is that your grid does not include all the fields needed by the "represent" function (i.e., it is missing the "id" field). You could (a) re-write the represent so it doesn't fail when the "id" field is missing, (b) use one of the "hidden column" do

[web2py] Re: GRID export broken for CSV but not for JSON

2016-02-12 Thread Anthony
Which version of web2py? On Friday, February 12, 2016 at 5:01:40 PM UTC-5, olivier hubert wrote: > > > I implemented a clone of Notifier application from Massimo. > If I try to export data from the grid via the grid bottom button I receive > an error if I use export to CSV, HTML & TSV but not wit

[web2py] Re: Grid links in component do not open in new window properly

2016-01-17 Thread fbenhamo102
Could you indicate whether what you did work, please? I've the same problem, when using appadmin/manage, which internally uses the smartgrid: opening a link in a new tab does not work (nor do the next / previous buttons). The problem I have when trying to implement Anthony's solution is the fo

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Anthony
O > The issue isn't simply whether there have been changes in the file but >> whether there have been changes in the file that are directly linked to >> changes in the core framework. web2py.js includes code that depends on >> particular HTML classes and data-* attributes generated by web2py HT

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Krzysztof Socha
On Wednesday, January 6, 2016 at 5:30:25 PM UTC+1, Anthony wrote: > > >> I guess, this is more-less what I need to do, but this is not perfect, as >> I have several applications that I maintain and updating all of them >> manually is not great. Also - is this the only file that should be update

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Anthony
> > I guess, this is more-less what I need to do, but this is not perfect, as > I have several applications that I maintain and updating all of them > manually is not great. Also - is this the only file that should be updated > in this way? I am not sure... What about web2py_ajax.html? appadmi

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Krzysztof Socha
On Wednesday, January 6, 2016 at 1:58:19 PM UTC+1, Anthony wrote: > > > Well, any time you upgrade the framework, you should always upgrade > web2py.js (no need to check whether it has changed -- just do it). > > I guess, this is more-less what I need to do, but this is not perfect, as I have s

[web2py] Re: GRID selectable inside component

2016-01-06 Thread Anthony
On Monday, January 4, 2016 at 6:20:42 PM UTC-5, Krzysztof Socha wrote: > > Ok. I think I got it... I started developing my application long time ago > based on a welcome app. I have updated web2py regularly, but I have not > updated original welcome application files that are specific to web2py,

[web2py] Re: GRID selectable inside component

2016-01-04 Thread Krzysztof Socha
Ok. I think I got it... I started developing my application long time ago based on a welcome app. I have updated web2py regularly, but I have not updated original welcome application files that are specific to web2py, such as web2py.js It appears that there have been changes there as well, but

[web2py] Re: GRID selectable inside component

2015-12-31 Thread Anthony
Oops, got it. Still can't reproduce. On Thursday, December 31, 2015 at 5:23:38 PM UTC-5, Krzysztof Socha wrote: > > As I wrote: > > 2.13.4-stable+timestamp.2015.12.26.04.59.39 > (Running on nginx/1.4.6, Python 2.7.6) > > Strange... I will have to investigate a bit more, than. I will report > back

[web2py] Re: GRID selectable inside component

2015-12-31 Thread Krzysztof Socha
As I wrote: 2.13.4-stable+timestamp.2015.12.26.04.59.39 (Running on nginx/1.4.6, Python 2.7.6) Strange... I will have to investigate a bit more, than. I will report back, what I find. Krzysztof. On Thursday, December 31, 2015 at 10:38:10 PM UTC+1, Anthony wrote: > > Sorry, tried your exact cod

  1   2   3   4   >