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"
<https://vmweb2pysql02.gpo.gov/admin/default/edit/CongressionalOfficeDev/models/db.py>,
line 133, in <module>
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 [email protected].
For more options, visit https://groups.google.com/d/optout.