'm going to sync django.auth.User Table across multiple database. Since, I
have two databases in my Django project.As we know Django doesn't support
cross-DB relationship officially. So I'm trying to sync User and Accounts
table across multiple database.
To create new User object, I have to do something like this:
usrdct = User.objects.get(username='username').__dict__ #from 'default'
database
What I have to do is that, either
u = User(**usrdct).using('db2')
or
u = User(using ='db2')
u.__dict__.update(usrdct)
u.save()
Thanks in Advance
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-developers/-/vuwJbumfI0sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.