razopay payment gateway isssues

2019-04-26 Thread ANIL UMARANE
I am using django python
i have uploaded your html file but not ope
error is the id provided does notexists





https://checkout.razorpay.com/v1/checkout-new.js";
data-key=""
data-amount="59900"
data-order_id="123456"
data-currency="INR"
data-buttontext="Pay with Razorpay"
data-name="expert"
data-description="Purchase Description"
data-image="https://your-awesome-site.com/your_logo.jpg";
data-prefill.name="Gaurav Kumar"
data-prefill.email="t...@test.com"
data-theme.color="#F37254"
>



-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKfwX9wNmTtBxZ%3DTPnkLtFiZBxWLRiZjMFX615bdi93sM%2B00rA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Comment Form Related issue

2019-04-26 Thread Soumen Khatua
Hi Folks,
I want to show one textarea where only logged in users can comment
otherwise if they are click the textareabox redirect them to login page
just like youutbe comnet box. If anyone have any source code related to
this please share.

Thank You.


Regards,
Soumen

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WadmH6vfXBrpSfNdGrMRgVoBAV-DZfGbJkoO%2B1tVuWyfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Comment Form

2019-04-26 Thread Soumen Khatua
Hi Folks,
I want to allow for those who are logged in if they are not logged then it
will redirect to login page.
if any one have any code related to this concept please share with me. For
better clarity please go through this link-
https://www.amazon.in/Megaliving-Monk-Who-Sold-Ferrari/dp/8172246145/ref=sr_1_1_sspa?keywords=the+old+monk+who+sold+his+ferrari&qid=1556275424&s=gateway&sr=8-1-spons&psc=1

and then click add reviews.

Thank You.


Regards,
Soumen

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WY%3Dood%3Dpx1pgboLVj7%2BDrXhZj5r9%3DW5rPdA1iQ1cRageg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Comment Form Related issue

2019-04-26 Thread Robin Riis
class Comment(models.Model):

message = models.TextField()

video = models.ForeignKey(Video, related_name='comments',
on_delete=models.CASCADE)

created_at = models.DateTimeField(auto_now_add=True)

created_by = models.ForeignKey(get_user_model(), related_name='comments',
on_delete=models.CASCADE)


class CommentForm(forms.ModelForm):

class Meta:

model = Comment

fields = ['message',]


def CommentVideo(request, pk):

video = get_object_or_404(Video, pk=pk)

if request.method == 'POST':

form = CommentForm(request.POST)

if form.is_valid():

comment = form.save(commit=False)

comment.video = video

comment.created_by = request.user

comment.save()

return reverse_lazy('my_cool_place')

else:

form = CommentForm()

return render(request, 'path/to/html/file.html', {'video': video, 'form':
form})

something like that?

Den fre 26 apr. 2019 kl 12:34 skrev Soumen Khatua :

> Hi Folks,
> I want to show one textarea where only logged in users can comment
> otherwise if they are click the textareabox redirect them to login page
> just like youutbe comnet box. If anyone have any source code related to
> this please share.
>
> Thank You.
>
>
> Regards,
> Soumen
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WadmH6vfXBrpSfNdGrMRgVoBAV-DZfGbJkoO%2B1tVuWyfw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPLZMbMsH-55Z_KK3byho-BqMDHaXWmWQcwnmn1ZDuKHUB56eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to add calls and biometric to your web app

2019-04-26 Thread MICHAEL EBEBE
Please has anyone try on how to add calls and biometric to his web app
android version ??try but keep failing

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGzuFWEZs%3DJJjcW1_sU4XhLm7Jh1%3Dd2NinBDWqfXAfkzR%3DOcvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Comment Form Related issue

2019-04-26 Thread Soumen Khatua
yes,I'm new to django so let me check once.
Thank You for your response.

On Fri, Apr 26, 2019 at 4:36 PM Robin Riis  wrote:

> class Comment(models.Model):
>
> message = models.TextField()
>
> video = models.ForeignKey(Video, related_name='comments',
> on_delete=models.CASCADE)
>
> created_at = models.DateTimeField(auto_now_add=True)
>
> created_by = models.ForeignKey(get_user_model(), related_name='comments',
> on_delete=models.CASCADE)
>
>
> class CommentForm(forms.ModelForm):
>
> class Meta:
>
> model = Comment
>
> fields = ['message',]
>
>
> def CommentVideo(request, pk):
>
> video = get_object_or_404(Video, pk=pk)
>
> if request.method == 'POST':
>
> form = CommentForm(request.POST)
>
> if form.is_valid():
>
> comment = form.save(commit=False)
>
> comment.video = video
>
> comment.created_by = request.user
>
> comment.save()
>
> return reverse_lazy('my_cool_place')
>
> else:
>
> form = CommentForm()
>
> return render(request, 'path/to/html/file.html', {'video': video, 'form':
> form})
>
> something like that?
>
> Den fre 26 apr. 2019 kl 12:34 skrev Soumen Khatua <
> soumenkhatua...@gmail.com>:
>
>> Hi Folks,
>> I want to show one textarea where only logged in users can comment
>> otherwise if they are click the textareabox redirect them to login page
>> just like youutbe comnet box. If anyone have any source code related to
>> this please share.
>>
>> Thank You.
>>
>>
>> Regards,
>> Soumen
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPUw6WadmH6vfXBrpSfNdGrMRgVoBAV-DZfGbJkoO%2B1tVuWyfw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPLZMbMsH-55Z_KK3byho-BqMDHaXWmWQcwnmn1ZDuKHUB56eg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WbCeF%2BUuQVfOBoNEzM1vZo9dheKTQYoMz%3DQXfQmtgeTSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Comment Form Related issue

2019-04-26 Thread Robin Riis
class Comment(models.Model): <--- in models.py

class CommentForm(forms.ModelForm): <--- in forms.py

def CommentVideo(request, pk): <--- in views.py

and the video is another model i used since you said like youtube. :)

Den fre 26 apr. 2019 kl 13:33 skrev Soumen Khatua :

> yes,I'm new to django so let me check once.
> Thank You for your response.
>
> On Fri, Apr 26, 2019 at 4:36 PM Robin Riis  wrote:
>
>> class Comment(models.Model):
>>
>> message = models.TextField()
>>
>> video = models.ForeignKey(Video, related_name='comments',
>> on_delete=models.CASCADE)
>>
>> created_at = models.DateTimeField(auto_now_add=True)
>>
>> created_by = models.ForeignKey(get_user_model(), related_name='comments',
>> on_delete=models.CASCADE)
>>
>>
>> class CommentForm(forms.ModelForm):
>>
>> class Meta:
>>
>> model = Comment
>>
>> fields = ['message',]
>>
>>
>> def CommentVideo(request, pk):
>>
>> video = get_object_or_404(Video, pk=pk)
>>
>> if request.method == 'POST':
>>
>> form = CommentForm(request.POST)
>>
>> if form.is_valid():
>>
>> comment = form.save(commit=False)
>>
>> comment.video = video
>>
>> comment.created_by = request.user
>>
>> comment.save()
>>
>> return reverse_lazy('my_cool_place')
>>
>> else:
>>
>> form = CommentForm()
>>
>> return render(request, 'path/to/html/file.html', {'video': video, 'form':
>> form})
>>
>> something like that?
>>
>> Den fre 26 apr. 2019 kl 12:34 skrev Soumen Khatua <
>> soumenkhatua...@gmail.com>:
>>
>>> Hi Folks,
>>> I want to show one textarea where only logged in users can comment
>>> otherwise if they are click the textareabox redirect them to login page
>>> just like youutbe comnet box. If anyone have any source code related to
>>> this please share.
>>>
>>> Thank You.
>>>
>>>
>>> Regards,
>>> Soumen
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPUw6WadmH6vfXBrpSfNdGrMRgVoBAV-DZfGbJkoO%2B1tVuWyfw%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPLZMbMsH-55Z_KK3byho-BqMDHaXWmWQcwnmn1ZDuKHUB56eg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WbCeF%2BUuQVfOBoNEzM1vZo9dheKTQYoMz%3DQXfQmtgeTSQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPLZMbOxPsNjD%2BDX6t36i3WZEwXLRXJW-qO7e%2BGeV5m%3DhXss-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Comment Form Related issue

2019-04-26 Thread Soumen Khatua
Okay,Could you tell me If any user want to update their comment it later
the process is same or different?

Thank You


On Fri, Apr 26, 2019 at 5:31 PM Robin Riis  wrote:

> class Comment(models.Model): <--- in models.py
>
> class CommentForm(forms.ModelForm): <--- in forms.py
>
> def CommentVideo(request, pk): <--- in views.py
>
> and the video is another model i used since you said like youtube. :)
>
> Den fre 26 apr. 2019 kl 13:33 skrev Soumen Khatua <
> soumenkhatua...@gmail.com>:
>
>> yes,I'm new to django so let me check once.
>> Thank You for your response.
>>
>> On Fri, Apr 26, 2019 at 4:36 PM Robin Riis  wrote:
>>
>>> class Comment(models.Model):
>>>
>>> message = models.TextField()
>>>
>>> video = models.ForeignKey(Video, related_name='comments',
>>> on_delete=models.CASCADE)
>>>
>>> created_at = models.DateTimeField(auto_now_add=True)
>>>
>>> created_by = models.ForeignKey(get_user_model(),
>>> related_name='comments', on_delete=models.CASCADE)
>>>
>>>
>>> class CommentForm(forms.ModelForm):
>>>
>>> class Meta:
>>>
>>> model = Comment
>>>
>>> fields = ['message',]
>>>
>>>
>>> def CommentVideo(request, pk):
>>>
>>> video = get_object_or_404(Video, pk=pk)
>>>
>>> if request.method == 'POST':
>>>
>>> form = CommentForm(request.POST)
>>>
>>> if form.is_valid():
>>>
>>> comment = form.save(commit=False)
>>>
>>> comment.video = video
>>>
>>> comment.created_by = request.user
>>>
>>> comment.save()
>>>
>>> return reverse_lazy('my_cool_place')
>>>
>>> else:
>>>
>>> form = CommentForm()
>>>
>>> return render(request, 'path/to/html/file.html', {'video': video,
>>> 'form': form})
>>>
>>> something like that?
>>>
>>> Den fre 26 apr. 2019 kl 12:34 skrev Soumen Khatua <
>>> soumenkhatua...@gmail.com>:
>>>
 Hi Folks,
 I want to show one textarea where only logged in users can comment
 otherwise if they are click the textareabox redirect them to login page
 just like youutbe comnet box. If anyone have any source code related to
 this please share.

 Thank You.


 Regards,
 Soumen

 --
 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...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAPUw6WadmH6vfXBrpSfNdGrMRgVoBAV-DZfGbJkoO%2B1tVuWyfw%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPLZMbMsH-55Z_KK3byho-BqMDHaXWmWQcwnmn1ZDuKHUB56eg%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPUw6WbCeF%2BUuQVfOBoNEzM1vZo9dheKTQYoMz%3DQXfQmtgeTSQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPLZMbOxPsNjD%2BDX6t36i3WZEwXLRXJW-qO7e%2BGeV5m%3DhXss-g%40mail.gmail.com
> 

Re: Comment Form Related issue

2019-04-26 Thread Robin Riis
its pretty much the same, you can check on class based view where you have
CreateView and UpdateView and so on

and i would recomend to add the following to models.py:
updated_at = models.DateTimeField(null=True)
updated_by = models.ForeignKey(get_user_model(), on_delete=models.CASCADE,
null=True)

cheers mate

Den fre 26 apr. 2019 kl 14:05 skrev Soumen Khatua :

> Okay,Could you tell me If any user want to update their comment it later
> the process is same or different?
>
> Thank You
>
>
> On Fri, Apr 26, 2019 at 5:31 PM Robin Riis  wrote:
>
>> class Comment(models.Model): <--- in models.py
>>
>> class CommentForm(forms.ModelForm): <--- in forms.py
>>
>> def CommentVideo(request, pk): <--- in views.py
>>
>> and the video is another model i used since you said like youtube. :)
>>
>> Den fre 26 apr. 2019 kl 13:33 skrev Soumen Khatua <
>> soumenkhatua...@gmail.com>:
>>
>>> yes,I'm new to django so let me check once.
>>> Thank You for your response.
>>>
>>> On Fri, Apr 26, 2019 at 4:36 PM Robin Riis 
>>> wrote:
>>>
 class Comment(models.Model):

 message = models.TextField()

 video = models.ForeignKey(Video, related_name='comments',
 on_delete=models.CASCADE)

 created_at = models.DateTimeField(auto_now_add=True)

 created_by = models.ForeignKey(get_user_model(),
 related_name='comments', on_delete=models.CASCADE)


 class CommentForm(forms.ModelForm):

 class Meta:

 model = Comment

 fields = ['message',]


 def CommentVideo(request, pk):

 video = get_object_or_404(Video, pk=pk)

 if request.method == 'POST':

 form = CommentForm(request.POST)

 if form.is_valid():

 comment = form.save(commit=False)

 comment.video = video

 comment.created_by = request.user

 comment.save()

 return reverse_lazy('my_cool_place')

 else:

 form = CommentForm()

 return render(request, 'path/to/html/file.html', {'video': video,
 'form': form})

 something like that?

 Den fre 26 apr. 2019 kl 12:34 skrev Soumen Khatua <
 soumenkhatua...@gmail.com>:

> Hi Folks,
> I want to show one textarea where only logged in users can comment
> otherwise if they are click the textareabox redirect them to login page
> just like youutbe comnet box. If anyone have any source code related to
> this please share.
>
> Thank You.
>
>
> Regards,
> Soumen
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WadmH6vfXBrpSfNdGrMRgVoBAV-DZfGbJkoO%2B1tVuWyfw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
 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...@googlegroups.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAPLZMbMsH-55Z_KK3byho-BqMDHaXWmWQcwnmn1ZDuKHUB56eg%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPUw6WbCeF%2BUuQVfOBoNEzM1vZo9dheKTQYoMz%3DQXfQmtgeTSQ%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google 

left join without where condition

2019-04-26 Thread pythonwebdjango
What exactly I need?
  I have 2 models Product and Photo(having ForeignKey relationship with 
Product). Now suppose I inserted 3 products in Product table. For the 3rd 
product I not inserted any photo in Photo table. I want to fetch all the 
Products along with Photos but for the 3rd product photo should come as 
null(or None) because I not inserted. why I am doing like this because for 
the product for which no photos are uploaded I can check in the template 
that if null or None is coming as a photo then show a default image 
referring it from the static folder. I know we can achieve it using left 
join but how to achieve it in Django style?

What I have tried?
q=Product.objects.all().filter(photo__isnull=True)
print(q.query)
SELECT "app_product"."id", "app_product"."name"  FROM "app_product" LEFT 
OUTER JOIN "app_photo" ON
("app_product"."id" = "app_photo"."product_id") WHERE "app_photo"."id" IS 
NOT NULL

If in the above query I remove the where clause my problem will be resolved?
So how to do that in a django way?


-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c00d69-f136-4c65-a87b-8466bcb2d866%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Like button for user pictures.

2019-04-26 Thread Malick Cisse
Hi, what have you tried? Help us help you

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a18de499-0dc4-40f8-9ba4-50e6aae5da8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: left join without where condition

2019-04-26 Thread Matthew Pava
Use select_related or just reference it in the template as an attribute.
https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related

Product.objects.select_related(‘photo’)

{% if product.photo %}
…
{% endif %}

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of pythonwebdja...@gmail.com
Sent: Friday, April 26, 2019 8:03 AM
To: Django users
Subject: left join without where condition

What exactly I need?
  I have 2 models Product and Photo(having ForeignKey relationship with 
Product). Now suppose I inserted 3 products in Product table. For the 3rd 
product I not inserted any photo in Photo table. I want to fetch all the 
Products along with Photos but for the 3rd product photo should come as null(or 
None) because I not inserted. why I am doing like this because for the product 
for which no photos are uploaded I can check in the template that if null or 
None is coming as a photo then show a default image referring it from the 
static folder. I know we can achieve it using left join but how to achieve it 
in Django style?

What I have tried?
q=Product.objects.all().filter(photo__isnull=True)
print(q.query)
SELECT "app_product"."id", "app_product"."name"  FROM "app_product" LEFT OUTER 
JOIN "app_photo" ON
("app_product"."id" = "app_photo"."product_id") WHERE "app_photo"."id" IS NOT 
NULL

If in the above query I remove the where clause my problem will be resolved?
So how to do that in a django way?


--
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...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c00d69-f136-4c65-a87b-8466bcb2d866%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ecf48599ce9d44629e2d0bd68dfbfa34%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


How to Update Database

2019-04-26 Thread Aayush Bhattarai
How can I update database. I am not using forms.py and I am using function 
based view. Can you how example and link for docs. Thanks for help.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41384b09-ed76-4485-9518-8dc10e26f2fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Autoreloader looping Django 2.2

2019-04-26 Thread Dan
Forgot to mention that this is on a mac osx host with ubuntu 16 virtualbox 
guest, I'm not sure that has something to do with it?

On Thursday, April 25, 2019 at 10:06:59 PM UTC+2, Dan wrote:
>
> I'm using Django 2.2 on a new project and suddenly the autoreloader is 
> looping when I change a file
>
>
> DEBUG:
>
>
> /urls.py. is_changed: False, is_new: True
>
> /urls.py previous mtime: None, current mtime: 1556221457.0
>
> /urls.py notified as changed. Signal results: [( translation_file_changed at 0x7fd933e05d90>, None)].
>
> /urls.py changed, reloading
>
> It says the file is new but it was just changed - it refers 
> to translation_file_changed but I have no translation files in my project.
>
>
> My project is on a virtualbox shared folder, if I start a new project from 
> scratch it works ok and previous versions of Django work fine.
>
>
> I tried using watchman + pywatchman and it doesn't seem to work at all, I 
> dont think it works with shared virtualbox folders. 
>
>
> Is there anyway I can get this working with 2.2 can I use the old reloader 
> or do I need to revert to 2.1?
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7b35e7bf-65cd-447c-84db-aafd1ba2fc45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: How to Update Database

2019-04-26 Thread Matthew Pava
You would use the data from request.POST or request.GET.
Here’s everything you need to know about views:
https://docs.djangoproject.com/en/2.2/topics/http/views/

Here’s an example:

def my_view(request):
   if request.POST:
  field1 = request.POST.get(‘field1’)
  field2 = request.POST.get(‘field2’)
  model = MyModel.objects.create(field1=field1, 
field2=field2)
  return redirect(model.get_absolute_url())
   return whatever

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Aayush Bhattarai
Sent: Friday, April 26, 2019 8:53 AM
To: Django users
Subject: How to Update Database

How can I update database. I am not using forms.py and I am using function 
based view. Can you how example and link for docs. Thanks for help.
--
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...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41384b09-ed76-4485-9518-8dc10e26f2fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f036748087c41598da4b7180f3aa231%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: left join without where condition

2019-04-26 Thread chirag soni
You are telling something which I know already. Please observe my question
keenly I need reverse of what you told. I. e.
Photo modal has Product as ForeignKey
class Photo:
   file=models.FileField()
   product=models.ForeignKey()


On 26 Apr 2019 19:16, "Matthew Pava"  wrote:

Use select_related or just reference it in the template as an attribute.

https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related



Product.objects.select_related(‘photo’)



{% if product.photo %}

…

{% endif %}



*From:* django-users@googlegroups.com [mailto:django-users@googlegroups.com]
*On Behalf Of *pythonwebdja...@gmail.com
*Sent:* Friday, April 26, 2019 8:03 AM
*To:* Django users
*Subject:* left join without where condition



What exactly I need?

  I have 2 models Product and Photo(having ForeignKey relationship with
Product). Now suppose I inserted 3 products in Product table. For the 3rd
product I not inserted any photo in Photo table. I want to fetch all the
Products along with Photos but for the 3rd product photo should come as
null(or None) because I not inserted. why I am doing like this because for
the product for which no photos are uploaded I can check in the template
that if null or None is coming as a photo then show a default image
referring it from the static folder. I know we can achieve it using left
join but how to achieve it in Django style?



What I have tried?

q=Product.objects.all().filter(photo__isnull=True)

print(q.query)

SELECT "app_product"."id", "app_product"."name"  FROM "app_product" LEFT
OUTER JOIN "app_photo" ON

("app_product"."id" = "app_photo"."product_id") WHERE "app_photo"."id" IS
NOT NULL



If in the above query I remove the where clause my problem will be resolved?

So how to do that in a django way?





-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/c8c00d69-f136-4c65-a87b-8466bcb2d866%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/ecf48599ce9d44629e2d0bd68dfbfa34%40iss2.ISS.LOCAL

.

For more options, visit https://groups.google.com/d/optout.

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABCRpYOKy7ZaC0xh%3D8m6AtoeLx0fCvo3irPhPh8SK7YZJ5YC6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: left join without where condition

2019-04-26 Thread Matthew Pava
Then use the reverse accessor:
https://docs.djangoproject.com/en/dev/topics/db/queries/#following-relationships-backward
Product.objects.select_related(‘photo_set’)
{% for photo in product.photo_set.all %}
{{ photo }}
{% empty %}
This product has no photos.
{% endfor %}



From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of chirag soni
Sent: Friday, April 26, 2019 10:58 AM
To: django-users@googlegroups.com
Subject: Re: left join without where condition

You are telling something which I know already. Please observe my question 
keenly I need reverse of what you told. I. e.
Photo modal has Product as ForeignKey
class Photo:
   file=models.FileField()
   product=models.ForeignKey()


On 26 Apr 2019 19:16, "Matthew Pava" 
mailto:matthew.p...@iss.com>> wrote:
Use select_related or just reference it in the template as an attribute.
https://docs.djangoproject.com/en/2.1/ref/models/querysets/#select-related

Product.objects.select_related(‘photo’)

{% if product.photo %}
…
{% endif %}

From: django-users@googlegroups.com 
[mailto:django-users@googlegroups.com] On 
Behalf Of pythonwebdja...@gmail.com
Sent: Friday, April 26, 2019 8:03 AM
To: Django users
Subject: left join without where condition

What exactly I need?
  I have 2 models Product and Photo(having ForeignKey relationship with 
Product). Now suppose I inserted 3 products in Product table. For the 3rd 
product I not inserted any photo in Photo table. I want to fetch all the 
Products along with Photos but for the 3rd product photo should come as null(or 
None) because I not inserted. why I am doing like this because for the product 
for which no photos are uploaded I can check in the template that if null or 
None is coming as a photo then show a default image referring it from the 
static folder. I know we can achieve it using left join but how to achieve it 
in Django style?

What I have tried?
q=Product.objects.all().filter(photo__isnull=True)
print(q.query)
SELECT "app_product"."id", "app_product"."name"  FROM "app_product" LEFT OUTER 
JOIN "app_photo" ON
("app_product"."id" = "app_photo"."product_id") WHERE "app_photo"."id" IS NOT 
NULL

If in the above query I remove the where clause my problem will be resolved?
So how to do that in a django way?


--
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...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8c00d69-f136-4c65-a87b-8466bcb2d866%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ecf48599ce9d44629e2d0bd68dfbfa34%40iss2.ISS.LOCAL.

For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.
To post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABCRpYOKy7ZaC0xh%3D8m6AtoeLx0fCvo3irPhPh8SK7YZJ5YC6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop rece

Razorpay imtegration

2019-04-26 Thread Soumen Khatua
Hi folks,

Anyone have the source code to integrate Razorpay along with full
security,actually I saw their documentation but I'm still confused. If
anyone have please share with me??

Thank You.

Regards,
Soumen

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WZs5_5BHwgsbwe%3D-pxuuP6_3roBMYr4568_TZgUb8v7Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Chat Help

2019-04-26 Thread Amna Afifi
how I can real time in the chat


‫في الاثنين، 22 أبريل 2019 في 3:57 ص تمت كتابة ما يلي بواسطة ‪Ahmed
Ishtiaque‬‏ <‪ahmedisht...@gmail.com‬‏>:‬

> Hello!
>
> Shameless plug: I've been working towards making a chat app for Django
> developers to be able to use. You could check it out here
>  if you want!
>
> Best,
> Ahmed
>
> On Sun, Apr 21, 2019 at 10:50 AM Fahad Bin Munir 
> wrote:
>
>> how to create chatting system using api in djano?
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/398fbc6b-aaf7-4d2f-8107-6ea7ec1c2b81%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKizqR7Hy_iaHf1aY5EsmAH%2BVbrp0VCWsLBtM_r27BL23CqxDw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHGfxW_JKe13qVdKrafPbbH8cJEqMm_u8vEZ_RdsZjn5dxjNqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.