On 17 янв, 05:58, otonk <[EMAIL PROTECTED]> wrote:
> hi, i am currently designing two or more django application, one
> application act as the master application, contains all the data, the
> other application has partial function of the master application. The
> master database belongs to the master application, other database has
> a partial data from the master database. The reason we have such
> design is these application is separated geographically and the
> connection may not be always available. The problem with this design
> is how to move partial data from master db to other db, the sync
> process is triggered by user. I need an way to sync the data. I know
> this is doable but I am confused with the implementation. Any solution
> is appreciated. Thank you.

Create the sync script using the Python DB API directly (no Django
ORM). And then trigger it either automatically with the cron job or
manually, by wrapping that script inside django view. You may want to
add `modified` DateTimeField to all your Django models and store the
last sync date/time somewhere. So the sync script should only SELECT
records from master database where 'modified' is greater than last
sync date and INSERT/UPDATE it into other database.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to