On Oct 24, 2017 3:46 AM, "Andréas Kühne" wrote:
Hi all,
I would love to pick your collective brains for a second. I am working on
an application that will be first and foremost an administration system. As
such there will be very few users in the system. It will have a front end
developed in ang
Thanks for your response. This is an off-topic question but I can't figure
out how to get 'request' working. I'm using the CreateView generic class,
so there's no space to insert 'request'. This is what my code looks like.
When I try to run it, it tells me that request is not found.
class
for question 2 :
def get_queryset(self): # the user want to edit this post must be
owner this post
post_qs = super(UpdatePost, self).get_queryset()
return post_qs.filter(user=self.request.user)
On Tue, Oct 24, 2017 at 8:04 PM, mohammad k wrote:
> try that in your views
>
>
try that in your views
form = Dog_Form(request.POST)
if form.is_valid():
form_save = form.save(commit=False)
form_save.user = request.user # user is logged in
form.save()
On Tue, Oct 24, 2017 at 7:37 PM, Jack Zhang wrote:
> Let's say I have a model called 'Dogs'. Users can create
Let's say I have a model called 'Dogs'. Users can create instances of
Dogs. Let's say we have a user called User1. I have 2 questions:
1. When User1 creates an instance of Dogs, how do I automatically assign
that instance to User1? I tried using a model field like this but it
doesn't pick t
forms.TextInput(attrs={'type': 'hidden'})
On Tue, Oct 24, 2017 at 7:08 PM, gugsrs wrote:
> But isn't there any other way to change that attribute from my template
> for example?
>
> Thank you for the reply.
>
> On Saturday, October 21, 2017 at 4:19:21 AM UTC-2, k2527806 wrote:
>>
>> forms.CharFi
But isn't there any other way to change that attribute from my template for
example?
Thank you for the reply.
On Saturday, October 21, 2017 at 4:19:21 AM UTC-2, k2527806 wrote:
>
> forms.CharField(widget=forms.HiddenField)
>
> On Oct 21, 2017 12:45 AM, "gugsrs" >
> wrote:
>
> Hello,
>
> I am ha
Hi all,
I would love to pick your collective brains for a second. I am working on an
application that will be first and foremost an administration system. As such
there will be very few users in the system. It will have a front end developed
in angular 5 and a Django rest framework backend.
I
8 matches
Mail list logo