Hello! I need to get the user that is logged in to my application, because in the form I have fields modelChoice, and the query need to bring by logged in user, as shown below:
Note: I work with class based view.
Obs2: 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