[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 the 
web2py.com/init/default/downloads page.

/dps
 

>
> 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 
>>> 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're pulling from the github archive, you need to do a recursive 
>> pull to get the correct version of PyDal.   The zip files, during their 
>> time on the download page, take care of that for you.
>>
>> /dps
>>
>>
>>  
>>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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're pulling from the github archive, you need to do a recursive pull 
> to get the correct version of PyDal.   The zip files, during their time on 
> the download page, take care of that for you.
>
> /dps
>
>
>  
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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're pulling from the github archive, you need to do a recursive pull 
to get the correct version of PyDal.   The zip files, during their time on 
the download page, take care of that for you.

/dps


 

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 227, in restricted
exec ccode in environment
  File "C:/inetpub/wwwroot/applications/CongressionalOfficeDev/models/db.py" 
,
 line 133, in 
migrate=settings.migrate)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 587, in 
define_table
table = self.lazy_define_table(tablename, *fields, **args)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 596, in 
lazy_define_table
fields = list(fields) + [f.clone() for f in common_fields]
AttributeError: 'Table' object has no attribute 'clone'



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 (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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 (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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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
exec(ccode, environment)
  File "C:/inetpub/wwwroot/applications/CongressionalOfficeDev/models/db.py" 
,
 line 133, in 
migrate=settings.migrate)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 587, in 
define_table
table = self.lazy_define_table(tablename, *fields, **args)
  File "C:\inetpub\wwwroot\gluon\packages\dal\pydal\base.py", line 596, in 
lazy_define_table
fields = list(fields) + [f.clone() for f in common_fields]
AttributeError: 'Table' object has no attribute 'clone'


On Thursday, August 3, 2017 at 12:46:13 PM UTC-4, Seth J wrote:
>
> 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 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 the new values for modified_on and modified_by).
>>
>> Anthony
>>
>> On Thursday, August 3, 2017 at 12:25:20 PM UTC-4, Anthony wrote:
>>>
>>> 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 
>>> modified_on and modified_by values, on the other hand, are not updated 
>>> until after the _before_update callback is called.
>>>
>>> To avoid the behavior, I think you will have to manually check whether 
>>> the submitted fields differ from the original record and then either (a) 
>>> temporarily changed the "update" attribute of the modified_on and 
>>> modified_by fields so their values are not actually updated or (b) 
>>> explicitly add the modified_on and modified_by fields to the form vars so 
>>> the archive record creation will be triggered.
>>>
>>> Anthony
>>>
>>> On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:

 Quick question, guys.  I've noticed that when record is edited in a 
 grid and no changes are made to it when hitting 'Submit' no entry is made 
 into a corresponding archive table.  However, fields "modified on" and 
 "modified by" are adjusted according to a user who submitted a change.  Is 
 there way to either not change the latter fields or put an entry in an 
 archive table reflecting previous state?  
 It becomes a little bit misleading and hard to proof that people have 
 not made any changes to the record when their name appears as an editor of 
 the field.  Thanks!

>>>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 the new values for modified_on and modified_by).
>
> Anthony
>
> On Thursday, August 3, 2017 at 12:25:20 PM UTC-4, Anthony wrote:
>>
>> 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 
>> modified_on and modified_by values, on the other hand, are not updated 
>> until after the _before_update callback is called.
>>
>> To avoid the behavior, I think you will have to manually check whether 
>> the submitted fields differ from the original record and then either (a) 
>> temporarily changed the "update" attribute of the modified_on and 
>> modified_by fields so their values are not actually updated or (b) 
>> explicitly add the modified_on and modified_by fields to the form vars so 
>> the archive record creation will be triggered.
>>
>> Anthony
>>
>> On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:
>>>
>>> Quick question, guys.  I've noticed that when record is edited in a grid 
>>> and no changes are made to it when hitting 'Submit' no entry is made into a 
>>> corresponding archive table.  However, fields "modified on" and "modified 
>>> by" are adjusted according to a user who submitted a change.  Is there way 
>>> to either not change the latter fields or put an entry in an archive table 
>>> reflecting previous state?  
>>> It becomes a little bit misleading and hard to proof that people have 
>>> not made any changes to the record when their name appears as an editor of 
>>> the field.  Thanks!
>>>
>>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
the new values for modified_on and modified_by).

Anthony

On Thursday, August 3, 2017 at 12:25:20 PM UTC-4, Anthony wrote:
>
> 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 
> modified_on and modified_by values, on the other hand, are not updated 
> until after the _before_update callback is called.
>
> To avoid the behavior, I think you will have to manually check whether the 
> submitted fields differ from the original record and then either (a) 
> temporarily changed the "update" attribute of the modified_on and 
> modified_by fields so their values are not actually updated or (b) 
> explicitly add the modified_on and modified_by fields to the form vars so 
> the archive record creation will be triggered.
>
> Anthony
>
> On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:
>>
>> Quick question, guys.  I've noticed that when record is edited in a grid 
>> and no changes are made to it when hitting 'Submit' no entry is made into a 
>> corresponding archive table.  However, fields "modified on" and "modified 
>> by" are adjusted according to a user who submitted a change.  Is there way 
>> to either not change the latter fields or put an entry in an archive table 
>> reflecting previous state?  
>> It becomes a little bit misleading and hard to proof that people have not 
>> made any changes to the record when their name appears as an editor of the 
>> field.  Thanks!
>>
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
modified_on and modified_by values, on the other hand, are not updated 
until after the _before_update callback is called.

To avoid the behavior, I think you will have to manually check whether the 
submitted fields differ from the original record and then either (a) 
temporarily changed the "update" attribute of the modified_on and 
modified_by fields so their values are not actually updated or (b) 
explicitly add the modified_on and modified_by fields to the form vars so 
the archive record creation will be triggered.

Anthony

On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:
>
> Quick question, guys.  I've noticed that when record is edited in a grid 
> and no changes are made to it when hitting 'Submit' no entry is made into a 
> corresponding archive table.  However, fields "modified on" and "modified 
> by" are adjusted according to a user who submitted a change.  Is there way 
> to either not change the latter fields or put an entry in an archive table 
> reflecting previous state?  
> It becomes a little bit misleading and hard to proof that people have not 
> made any changes to the record when their name appears as an editor of the 
> field.  Thanks!
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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:
- 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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 edit works fine as the edit from 
> has all the fields of the table. 
> But when I set the  readable/writable attributes to filter the fields in 
> edit form the the error 42000 listed above occurs. 
>

I see the problem. By default, the "id" field is actually set to 
writable=True. It is excluded from SQLFORM database writes not because of 
its "writable" attribute but because the SQLFORM.accepts() code explicitly 
excludes the "id" field. However, the code at this line 

 
ends up including fields that are in the record by have writable=False. So, 
because your code sets writable=False for all fields except the three 
special fields you have identified, the "id" field ends up getting 
writable=False, which forces it to be included in the database update. To 
fix this, the following should work:

[setattr(f, 'writable', False) for f in db.amc_master
 if f.name not in ['id', 'amcdesc', 'amcmod', 'complndays']]

Anthony

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 set the  readable/writable attributes to filter the fields in 
> edit form the the error 42000 listed above occurs. 
> Thank you Anthony for the test guidance. 
> How to go about now?
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 set the  readable/writable attributes to filter the fields in 
edit form the the error 42000 listed above occurs. 
Thank you Anthony for the test guidance. 
How to go about now?

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 readable/writable attributes?

On Wednesday, May 24, 2017 at 5:08:56 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',notnull='True',requires=IS_LENGTH(10)),
> Field('unitid',type='string',length=3,notnull='True'),
> Field('amcdesc', 
> type='string',length=512,required='True',notnull='True'),
> Field('estval', type='decimal(18,2)'),
> Field('supcflg', type='string', length=1),
> Field('supcval',type='decimal(18,2)'),
> Field('netestval',type='decimal(18,2)'),
> Field('bidmethod',type='string',length=3),
> Field('capbud',type='string',length=1),
> Field('amcmod',type='string',length=3),
> Field('lrrflg',type='string',length=1),
> Field('insflg',type='string',length=1),
> Field('stflg',type='string',length=1),
> Field('phwflg',type='string',length=1),
> Field('contyp',type='string',length=3),
> Field('rfact',type='decimal(18,2)'),
> Field('qfact',type='decimal(18,2)'),
> Field('emdamt',type='decimal(18,2)'),
> Field('doccharge',type='decimal(18,2)'),
> Field('divn',type='string',length=3),
> Field('subdivn',type='string',length=2),
> Field('cflg',type='string',length=1),
> Field('statflg',type='string',length=3),
> Field('appauthority',type='string',length=16),
> Field('accappddt',type='datetime'),
> Field('iewappddt',type='datetime'),
> Field('complndays',type='integer'),
> Field('examcno',type='string',length=10),
> Field('consoldamcstr',type='string',length=70),
> Field('isconsold',type='string',length=1),
> Field('estonprovn',type='decimal(18,2)'),
> Field('totest',type='decimal(18,2)'),
> 
> Field('update_uid','string',length=6,required='True',notnull='True'),
> 
> Field('update_dt','datetime',required='True',notnull='True')
> )
>
> in controller i have this
>
> def newamcmaster():
> list_of_fields = 
> [db.amc_master.amcdesc,db.amc_master.amcmod,db.amc_master.complndays]
> [setattr(f, 'readable', False) for f in db.amc_master if f.name not 
> in ['amcdesc','amcmod','complndays']]
> [setattr(f, 'writable', False) for f in db.amc_master if f.name not 
> in ['amcdesc','amcmod','complndays']]
> grid = 
> SQLFORM.grid(db.amc_master,user_signature=False,fields=list_of_fields,oncreate=create_new_amc)
> return locals()
>

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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.

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid edit

2017-05-30 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)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
supported in SQL Server because although there is no actual update 
happening it is explicitly telling the database engine that you wish to 
perform an update.

and here https://www.drupal.org/node/2090251  it is said The underlying 
problem is that MySQL accepts identity updates (when there are no changes) 
but Sql Server being properly designed complains with this bad practice.

Is this the issue in web2py also.
 

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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,required='True',notnull='True'),
Field('estval', type='decimal(18,2)'),
Field('supcflg', type='string', length=1),
Field('supcval',type='decimal(18,2)'),
Field('netestval',type='decimal(18,2)'),
Field('bidmethod',type='string',length=3),
Field('capbud',type='string',length=1),
Field('amcmod',type='string',length=3),
Field('lrrflg',type='string',length=1),
Field('insflg',type='string',length=1),
Field('stflg',type='string',length=1),
Field('phwflg',type='string',length=1),
Field('contyp',type='string',length=3),
Field('rfact',type='decimal(18,2)'),
Field('qfact',type='decimal(18,2)'),
Field('emdamt',type='decimal(18,2)'),
Field('doccharge',type='decimal(18,2)'),
Field('divn',type='string',length=3),
Field('subdivn',type='string',length=2),
Field('cflg',type='string',length=1),
Field('statflg',type='string',length=3),
Field('appauthority',type='string',length=16),
Field('accappddt',type='datetime'),
Field('iewappddt',type='datetime'),
Field('complndays',type='integer'),
Field('examcno',type='string',length=10),
Field('consoldamcstr',type='string',length=70),
Field('isconsold',type='string',length=1),
Field('estonprovn',type='decimal(18,2)'),
Field('totest',type='decimal(18,2)'),

Field('update_uid','string',length=6,required='True',notnull='True'),
Field('update_dt','datetime',required='True',notnull='True')
)

in controller i have this

def newamcmaster():
list_of_fields = 
[db.amc_master.amcdesc,db.amc_master.amcmod,db.amc_master.complndays]
[setattr(f, 'readable', False) for f in db.amc_master if f.name not in 
['amcdesc','amcmod','complndays']]
[setattr(f, 'writable', False) for f in db.amc_master if f.name not in 
['amcdesc','amcmod','complndays']]
grid = 
SQLFORM.grid(db.amc_master,user_signature=False,fields=list_of_fields,oncreate=create_new_amc)
return locals()

-- 
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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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/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.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid edit

2017-05-24 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 are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.