Re: Django ORM query with joins

2020-03-30 Thread Anoop Thiparala
thanks that worked On Monday, March 30, 2020 at 7:49:07 PM UTC+5:30, Suraj Thapa FC wrote: > > Sorry its like this... > posts.objects.values('id', 'details', 'user__name' ) > > On Mon, 30 Mar 2020, 7:46 pm Suraj Thapa FC, > wrote: > >> posts.model.values('id', 'details', 'user__name' ) >> >> On

Re: Having issue sending email when model is save and not updated.

2020-03-30 Thread Sunil H N
Hi, Use Django signals presave and postsave. Regards, Sunil H N sunil.kann...@gmail.com -sent from MacBook Air > On 31-Mar-2020, at 01:48, Isaac Imafidon wrote: > > Am working on an ecommerce project and i want to be able to do two things >

Re: drawing a venn diagram with css and html

2020-03-30 Thread Perceval Maturure
thanks for all your input, for those that might need to use this i managed this way; solution is to write css on style.css and them import it on a template that the cms will use and it works like a charm reply here for details and i will help those in need of it. cheers On 3/28/20, Perceval

Re: HTML code not being read

2020-03-30 Thread Ryan Nowakowski
Here is the change I suggest: https://gist.github.com/tubaman/bf49949f8a9369ad3db1f56d5ce7dbc0/revisions On 3/30/20 1:03 PM, Jeff Waters wrote: @login_required def add_comment(request, image_id): new_comment = None template_name = 'add_comment.html' image = 

Extending Django admin delete confirmation page

2020-03-30 Thread Gagan Deep
Greetings, I am wondering if it is possible to extend Django Admin's delete confirmation page. I tried the following but the received template does not exist error page. > % extends 'admin:admin/delete_confirmation.html' %} > I refer to this website which stated it is possible to do so

Re: HTML code not being read

2020-03-30 Thread Luqman Shofuleji
Let's see your url.py On Mon, Mar 30, 2020, 10:03 PM Jeff Waters wrote: > I've modified my code a bit to try (unsuccessfully!) to get this working. > > My views.py is now as follows: > > @login_required > def add_comment(request, image_id): > new_comment = None > template_name =

Re: HTML code not being read

2020-03-30 Thread Jeff Waters
I've modified my code a bit to try (unsuccessfully!) to get this working. My views.py is now as follows: @login_required def add_comment(request, image_id): new_comment = None template_name = 'add_comment.html' image = get_object_or_404(Picture, id=image_id) comment =

Having issue sending email when model is save and not updated.

2020-03-30 Thread Isaac Imafidon
Am working on an ecommerce project and i want to be able to do two things before the model save . 1) I want to update the cost of an item 2) I want to send two email to the receiver . One when the object just gets created while the other when the object gets updated. I go through django

Re: HTML code not being read

2020-03-30 Thread Aly_34_04 MR_34_04
show me your views On Monday, March 30, 2020 at 5:13:49 PM UTC+3, Jeff Waters wrote: > > Hi > > I have written some code that allows users of a website to comment on > photos in a picture gallery, using a form. However, when I test the code, > no comments are displayed. > > It would appear

guys django form doesn't appear, what could I do?

2020-03-30 Thread Aly_34_04 MR_34_04
[image: Capture.JPG] template: Bildiris bermek Modal title

Re: HTML code not being read

2020-03-30 Thread Jeff Waters
Thanks guys I previously had 'comments' in the plural in views.py, but had the same problem. Am I right in thinking that Django recognises that 'comments' is the plural of 'comment', so if it knows from the view what a comment is, it knows what comments are? Thanks, Jeff -- You received

Re: HTML code not being read

2020-03-30 Thread Luqman Shofuleji
What you passed to the context in your views.py is 'comment', but you are looping through 'comments' in the template On Mon, Mar 30, 2020, 3:52 PM Jeff Waters wrote: > Hi > > Thanks for getting back to me. > > This is from my views.py: > > @login_required > def add_comment(request, image_id): >

Re: HTML code not being read

2020-03-30 Thread Ryan Nowakowski
Your view context uses 'comment'(singular), while your template uses 'comments'(plural).  I'd chnage your view context to match the template. On 3/30/20 9:51 AM, Jeff Waters wrote: Hi Thanks for getting back to me. This is from my views.py: @login_required def add_comment(request,

Re: Custom login in django

2020-03-30 Thread Will Meyers
We'd need more info, but most likely the actual token is not being sent to the template properly. See this thread for suggestions. On Mon, Mar 30, 2020 at 11:18 AM Kushal Neupane wrote: > Forbidden

Re: Custom login in django

2020-03-30 Thread Kasper Laudrup
https://stackoverflow.com/help/how-to-ask -- 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 view this discussion on

Custom login in django

2020-03-30 Thread Kushal Neupane
Forbidden (403) CSRF verification failed. Request aborted. Help Reason given for failure: CSRF token missing or incorrect. In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism

Re: HTML code not being read

2020-03-30 Thread Jeff Waters
Hi I'm not sure what you mean by 'Have you all ready use a content that define your content'. I'm new to Django, so am not familiar with all of the terminology yet. Can you elaborate please? Thanks Jeff -- You received this message because you are subscribed to the Google Groups "Django

Issue with passing parameters in urls

2020-03-30 Thread aniket kamthe
Hey All, I have been watching your youtube tutorials and have been stuck on an issue for a while now. Can you help me out pls - I am trying to pass a parameter via a button in an HTML file and using that in the next link to access a specific set of entries from the database - HTML File code

Re: HTML code not being read

2020-03-30 Thread Jeff Waters
Hi Thanks for getting back to me. This is from my views.py: @login_required def add_comment(request, image_id): new_comment = None template_name = 'add_comment.html' image = get_object_or_404(Picture, id=image_id) comment = image.comment.filter(active=True) new_comment =

Re: HTML code not being read

2020-03-30 Thread LGBS fine soul coders
Have you all ready use a content that define your content On Mon, 30 Mar 2020, 17:14 Jeff Waters, wrote: > Hi > > I have written some code that allows users of a website to comment on > photos in a picture gallery, using a form. However, when I test the code, > no comments are displayed. > > It

Re: HTML code not being read

2020-03-30 Thread Luqman Shofuleji
The problem might not be from the HTML template but the View. All the HTML elements within your for loop will not display if there are no records to loop through in "comments" On Mon, Mar 30, 2020, 3:14 PM Jeff Waters wrote: > Hi > > I have written some code that allows users of a website to

Re: Django ORM query with joins

2020-03-30 Thread Suraj Thapa FC
Sorry its like this... posts.objects.values('id', 'details', 'user__name' ) On Mon, 30 Mar 2020, 7:46 pm Suraj Thapa FC, wrote: > posts.model.values('id', 'details', 'user__name' ) > > On Mon, 30 Mar 2020, 5:26 pm Anoop Thiparala, > wrote: > >> I need help with a django query...I have two

Re: Django ORM query with joins

2020-03-30 Thread Suraj Thapa FC
posts.model.values('id', 'details', 'user__name' ) On Mon, 30 Mar 2020, 5:26 pm Anoop Thiparala, wrote: > I need help with a django query...I have two models > > 1)* POSTS* > ==>id > ==>details > ==>user(foreign key to user table) > > 2) *USER* > ==>id > ==>email > ==>name > > *SQL VERSION:*

HTML code not being read

2020-03-30 Thread Jeff Waters
Hi I have written some code that allows users of a website to comment on photos in a picture gallery, using a form. However, when I test the code, no comments are displayed. It would appear that Django is not processing the following code (from my HTML file for the photo gallery), given that

Re: Looking for Django developers to work on a new and an existing project with our team

2020-03-30 Thread Satish Pal
Hi I have total of 2 years of experience and I am interested to join your team. please check my Linkedin profile https://www.linkedin.com/in/satish-kumar-2230b3158/ Thanks in Advance. On Mon, Mar 30, 2020 at 8:51 AM Phako Perez <13.phak...@gmail.com> wrote: > Hi, > > I’m also interested to

Django ORM query with joins

2020-03-30 Thread Anoop Thiparala
I need help with a django query...I have two models 1)* POSTS* ==>id ==>details ==>user(foreign key to user table) 2) *USER* ==>id ==>email ==>name *SQL VERSION:* SELECT POSTS.ID, POSTS.DETAILS, USER.NAME FROM POSTS, USER WHERE POSTS.USER == USER.ID; I require these details in the same

Re: Looking for Django developers to work on a new and an existing project with our team

2020-03-30 Thread ABHISHEK SAHU
Hi, I can join your team immediately. I have 2 years of experience working with python and web development using django framework. Thanks and Regards, Abhishek On Sun, Mar 29, 2020, 11:26 PM Lax Nayak wrote: > I am looking for a django developer who has expertise in building > enterprise

Re: Is there any possibility integrate django and tkinter?

2020-03-30 Thread Anoop Thiparala
One possible way would be to make an API using django rest framework and use API calls from your tkinter application On Sunday, March 29, 2020 at 11:00:07 PM UTC+5:30, Walter santos wrote: > > Hi > > Is there any possibility integrate django and tkinter? > -- You received this message because

Re: Form not displaying

2020-03-30 Thread Jeff Waters
Will do, thanks -- 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 view this discussion on the web visit

Re: Form not displaying

2020-03-30 Thread Ernest Thuku
There in your template...that closing form tag...is it a typing error?I can't see the second closing tag On Mar 30, 2020 13:23, "Ernest Thuku" wrote: > Try this > On Mar 30, 2020 12:58, "Jeff Waters" wrote: > >> Thanks Ernest. >> >> I'm not sure I follow (forgive me, I am very new to Django).

Re: Form not being published

2020-03-30 Thread Metehan Gülaç
There is no problem in the code. Look again at the quote and typos in the form class. and do a trial with this view: from django.shortcuts import render from django.http import HttpResponseRedirect from .forms import CommentForm def my_view(request): if request.method == 'POST':

Re: Form not displaying

2020-03-30 Thread Jeff Waters
Thanks Ernest. I'm not sure I follow (forgive me, I am very new to Django). Given that template_name is defined earlier in the method as 'add_comment.html', surely what I've written is equivalent to: return render(request, add_comment.html, {'image': image,

Re: Forienkey to same table

2020-03-30 Thread Motaz Hejaze
What are the usages lf such a technique ?? On Mon, 30 Mar 2020, 11:16 am Metehan Gülaç, wrote: > first of all, you can remove the *1. id (pK)* line. django already create > this field for you in background. I think you want to reference id field of > A table to himself; it is known as

Re: Forienkey to same table

2020-03-30 Thread Metehan Gülaç
first of all, you can remove the *1. id (pK)* line. django already create this field for you in background. I think you want to reference id field of A table to himself; it is known as *recursive relationship*. Speaking the which, you can use: models.ForeignKey('self',

Re: Form not displaying

2020-03-30 Thread Ernest Thuku
In the views why have you used templane_name while you not using class based views...try and change that to render the template using request On Mar 30, 2020 11:55, "Jeff Waters" wrote: > Sure. It's as follows: > > @login_required > def add_comment(request, image_id): > template_name =

Re: Form not displaying

2020-03-30 Thread Jeff Waters
Sure. It's as follows: @login_required def add_comment(request, image_id): template_name = 'add_comment.html' image = get_object_or_404(Picture, id=image_id) comments = image.comments.filter(active=True) new_comment = None # Comment posted if request.method == 'POST':

Re: Form not displaying

2020-03-30 Thread Ernest Thuku
Can you display your views please? On Mar 30, 2020 05:13, "Jeff Waters" wrote: > Apologies if I'm posting this twice - my original message isn't displayed > in the list of messages. > > I am creating a website using Django. I'd like to give users the chance to > comment on pictures they have