0
Hello! I need to get the user who is logged in to my application, because in the form I have modelChoice fields, and the query need to bring per logged in user, as shown below:
Note: Working with class based view.
Note: Django 1.10
from django import forms
from core.models.documento import *
from core.models.forma_pagamento import *
from core.models.local_compra import *
from core.models.tipo_documento import *
class DocumentoForm(forms.ModelForm):
descricao = forms.CharField(label='Descrição:')
forma_pagamento = forms.ModelChoiceField(label='Forma de pagamento:',queryset=FormaPagamento.objects.all())
class Meta:
model = Documento
I have already solved, reading a lot the doc. I did so, vlw.
– Thiago Porto