Created
May 12, 2013 07:20
-
-
Save douglasmiranda/5562732 to your computer and use it in GitHub Desktop.
Resposta à pergunta: https://groups.google.com/forum/?fromgroups=#!topic/django-brasil/VAq_ZbIuqNI django brasil
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