Thanks for the help. I got the ID working and I used the
"self.user.request".
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegr
> 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
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'
>
Should get the flow instance from the form.save() so:
user = User.objects.get(pk=self.request.user.id)
flow = form.save()
log = Log(user=user, flow=flow, state=1)
On Mon, Oct 13, 2014 at 4:13 PM, Daniel Grace wrote:
> Hi,
> I have problem when getting the ID of the record just c
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.objects.get(pk=self.request.user.id)
flow = Flow.objects.get(pk=self.kwa
5 matches
Mail list logo