-
-
Save luzfcb/5565326 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# O select você faz normal usando o 'using' para indicar a database específica | |
# algo como: Usuario.objects.using('database_test') | |
from django import forms | |
# ... | |
class UsuarioForm(forms.ModelForm): | |
def __init__(self, *args, **kwargs): | |
super(ContentForm, self).__init__(*args, **kwargs) | |
self.fields["user"].queryset = Usuario.objects.using('database_test') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment