>
> But, if I now want to reverse the process, i.e. make the record current, 
> what do I need to do (and leave the db in a state where, if I later 
> re-archive that record, things are consistent? )
>   - Only set "is_active" to true?
>

Yes, I think that should do it (note, when you do that, it should 
automatically archive the current "deleted" version -- i.e., the version 
with in_active=False).
 

>   - What about the records in the archive table? Delete/modify those 
> records? - if I later re-archive that record, I need things to be consistent
>

I don't think you should have to touch the archive table. Whenever a change 
is made in the original table (including setting is_active to False or back 
to True), the current version of the record is archived (before the change 
is made). So, the archive table should have a record of all previous states.
 

> Ideally, I'd like a ongoing modification history
>  - record was originally created 3 years ago, archived last year, 
> re-activated 3 months ago and re-archived yesterday...
>

If the table includes a modified_on timestamp (e.g., via auth.signature), 
then you should be able to query all records in the archive table that 
reference the current record in the original table and sort by modification 
date to view the history of previous states (including alternating values 
of is_active).

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.

Reply via email to