On Wed, Aug 29, 2012 at 4:17 PM, Vikas Rawal
wrote:
> I want to have a field in which the drop-down menu lists some
> suggestions that the user may choose from, or if nothing suits, the
> user may enter something other than what is available on the menu.
I think you should use a properly modified
> views.py:
>
> def PozoList(ListView):
> model = Pozo
> template_name = 'cuencas/edicioncuenca.html'
>
Is your view a function or a class?
--
$ gpg --recv-key da5098a7
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe fr
On Mon, Oct 13, 2014 at 3:13 PM, Daniel Grace wrote:
> Hi,
> I have problem when getting the ID of the record just created.
>
> class CreateFlow(CreateView):
> model = Flow
> fields = ['state']
> template_name = 'create_flow.html'
> def form_valid(self, form):
> user = User
> User.objects.get(pk=self.request.user.id) because request.user is your
> user object.
>
it's self.request.user - sorry.
But the sense is the same: you don't need User.objects.get
--
$ gpg --recv-key da5098a7
--
You received this message because you are subscribed to the Google Groups
"Djang
4 matches
Mail list logo