django admin widget

2018-10-12 Thread thebobbobsled
Hi, I'm still a bit new to django, but making slow progress. I'm wondering how to move forward with a book class as model which has an author field which allows adding additional authors. I have three fields allocated in the SQLite db for up to three different authors. What I'm trying to do

Re: Problems with code in shell (Django 2 and python 3.6)

2018-10-12 Thread Stefan Bethke
Am 12.10.2018 um 22:46 schrieb User1 : > > Hello, I am practicing the tutorial part 5, Test and I got an error I can > solve. > The code in shell is: > > (mientorno) C:\Users\user1\djangowom>python manage.py shell > Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit >

Problems with code in shell (Django 2 and python 3.6)

2018-10-12 Thread User1
Hello, I am practicing the tutorial part 5, Test and I got an error I can solve. The code in shell is: (mientorno) C:\Users\user1\djangowom>python manage.py shell Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or

Re: Connecting Sql server to Django

2018-10-12 Thread Gurmeet Kaur
I did it in my project. Use pyodbc to connect to sql server and i am using django 2.0.8 On Fri, Oct 12, 2018, 11:04 AM Pradeep Singh wrote: > bro...will you help me ... > i am getting django 404 error ...please tell how to fix it... > i am using python 3.6 + django 1.11 > > On Fri, 12 Oct 2018

[no subject]

2018-10-12 Thread Peter Mudoko
L -- 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.

Re: Connecting Sql server to Django

2018-10-12 Thread Pradeep Singh
bro...will you help me ... i am getting django 404 error ...please tell how to fix it... i am using python 3.6 + django 1.11 On Fri, 12 Oct 2018 at 19:35, vineeth sagar wrote: > I don't know if it works for 1.8, you would've tested it by now. The link > I haven given is a current method to

Re: Django Admin Filtering Drop Down Menu by Date

2018-10-12 Thread Nelson Varela
> > You could make a custom form for your admin which is a model form which > points to EmployeeSchedule. And in the form its init you can change the > queryset of the events field: > self.fields['events'].queryset = WineryEvents.objects.filter(publish='Y').

Re: Connecting Sql server to Django

2018-10-12 Thread vineeth sagar
I don't know if it works for 1.8, you would've tested it by now. The link I haven given is a current method to connect with sql server with newer versions of django, also I think it's about time your company updated your django version. For 2.1 the link I have given works seemlessly. On Oct 12,

Re: "Project object has no attribute review_set"

2018-10-12 Thread Nelson Varela
Use the .review you've defined as related name. The _set is when you don't have a related name. -- 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

Re: "Project object has no attribute review_set"

2018-10-12 Thread Vijay Khemlani
Since the related name in the project foreign key is "review" you have to use that keyword for the related query from project, so it should be "self.review.all()" instead of "self.review_set.all()" in your Project methods. Regards! On Fri, Oct 12, 2018 at 9:25 AM Melissa Malala wrote: >

Re: view must be a callable or a list/tuple in the case of include()

2018-10-12 Thread Gift Emmanuel Alua
Thanks. I fixed it On Fri, Oct 12, 2018 at 3:07 PM Ігор Магур wrote: > You need to import polls.views, and pass view.index into path func > Ex from polls import views > urlpatterns = [ > path('polls/', views.index), > ] > > -- > You received this message because you are subscribed to the

"Project object has no attribute review_set"

2018-10-12 Thread Melissa Malala
Getting an error that says "Project object has no attribute review_set" when trying to get the mean of ratings using Numpy. HTML looks something like this, what could be the problem? Please have a look below and let us know what you think: {{ project.review.count }} reviews ({{

Re: Connecting Sql server to Django

2018-10-12 Thread Jason
well, considering that 1.8 is no longer supported, you're not getting any backports and updates. which if you're doing a production level app, is pretty bad. Unfortunately, seems if you want to use the recent LTS or newer versions, SQL server is not an option unless you're willing to update

view must be a callable or a list/tuple in the case of include()

2018-10-12 Thread Ігор Магур
You need to import polls.views, and pass view.index into path func Ex from polls import views urlpatterns = [ path('polls/', views.index), ] -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

view must be a callable or a list/tuple in the case of include()

2018-10-12 Thread Gift Emmanuel Alua
Hello everyone, I am new to Django. I have been following the documentation and getting started with my first app.I get the following TypeError: view must be a callable or a list/tuple in the case of include(). I added path(r'^polls/$' ,'polls.views.index'), in the mysite url file just because

Re: Connecting Sql server to Django

2018-10-12 Thread Rakhee Menon
Hi Vineeth, Just had to make some changes in an old project which uses Sql Server 2014 and yeah I am using django 1.8. Is it that for the link you have given should I use Django 2.1 version or 1.8would work??? Thanks Rakhee -- You received this message because you are subscribed to the

Re: Form Code getting executed during django project startup

2018-10-12 Thread Web Architect
Hi Michal, Thanks a lot. That was an eye-opener and a big help :) Thanks. On Friday, October 12, 2018 at 1:39:38 PM UTC+5:30, Michal Petrucha wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On Fri, Oct 12, 2018 at 12:52:31AM -0700, Web Architect wrote: > > Hi, > > > > We

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Robert CR
is it because i have forgotten to import CommentForm? -- 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

Re: Form Code getting executed during django project startup

2018-10-12 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Oct 12, 2018 at 12:52:31AM -0700, Web Architect wrote: > Hi, > > We are using Django for our ecommerce site. > > I have some confusion on when the code gets executed in Django. I have a > django form with a choice field in module m1.py:

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Robert CR
then a new error pops up: [image: Udklip3.PNG] -- 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

Form Code getting executed during django project startup

2018-10-12 Thread Web Architect
Hi, We are using Django for our ecommerce site. I have some confusion on when the code gets executed in Django. I have a django form with a choice field in module m1.py: class SomeForm(forms.Form): field = forms.ChoiceField(choices=get_choices()) def get_choices(): return some

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread daniel main
Use id instead of pk On Oct 12, 2018 10:34, "Glen D souza" wrote: > > *def add_comment(request, slug):* > *post = get_object_or_404(Post, slug=slug)* > *if request.method == 'POST':* > *form = CommentForm(request.POST)* > *if form.is_valid():* > *comment =

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Glen D souza
*def add_comment(request, slug):* *post = get_object_or_404(Post, slug=slug)* *if request.method == 'POST':* *form = CommentForm(request.POST)* *if form.is_valid():* *comment = form.save(commit=False)* *comment.post = post* *

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Robert CR
If i do that i get another error: [image: Udklip2.PNG] -- 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

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Glen D souza
try renaming path('post//comment/', views.add_comment, name= 'add-comment'), to path('post//comment/', views.add_comment, name='add-comment'), On Fri, 12 Oct 2018 at 12:36, Robert CR wrote: > i fixed the error, thanks. But there is already a new one when i try to > add a comment. D: > >

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Robert CR
i fixed the error, thanks. But there is already a new one when i try to add a comment. D: [image: Udklip.PNG] -- 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

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread daniel main
Hello, Have you tried adding an app_name = 'your_app_name' in the URLs.py file? Thanks On Oct 12, 2018 09:36, "Glen D souza" wrote: > Hi, > > Try after name-spacing url patterns i.e > > app_name = 'blog' > > urlpatterns = [ > path('', PostListView.as_view(), name='blog-home'), >

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Glen D souza
Hi, Try after name-spacing url patterns i.e app_name = 'blog' urlpatterns = [ path('', PostListView.as_view(), name='blog-home'), path('user//', UserProfileListView.as_view(), name= 'user-profile' ), path('user//posts/', UserPostListView.as_view(), name= 'user-posts'),

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Manjunath
Try adding for action to your add_comment url then submit the form. I guess currently form is getting submitted in the same page. On Friday, October 12, 2018 at 12:00:03 PM UTC+5:30, Robert CR wrote: > > here is the template file. > > *add_comment.html* > > > > *{% extends "blog/base.html" %}{%

Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread Robert CR
here is the template file. *add_comment.html* *{% extends "blog/base.html" %}{% load crispy_forms_tags %}{% block content %}{% csrf_token %} Comment {{ form|crispy }} Post Comment! {% endblock content %}* -- You

Re: Regarding static media setup

2018-10-12 Thread Joel
Post the relevant files if you want someone to help On Fri, 12 Oct, 2018, 11:44 AM ashok kumar reddy, < ashok1101kuma...@gmail.com> wrote: > Hello everyone . When I try to setup static Media ,I am repeatedly getting > error in URLs.py(urlpatterns not defined ). could you solve this. > > -- > You

Re: Django Admin Filtering Drop Down Menu by Date

2018-10-12 Thread Derek
Your question does not make sense (as written): "To add a new event I would like to pick from a drop down list of only the events that are in the future" .. Why should adding a new event depend on you selecting another event? Are the events related or dependant in some way; that is not clear?

Re: Regarding static media setup

2018-10-12 Thread Ігор Магур
If you wrote something like this: if settings.DEBUG: # static files (images, css, javascript, etc.) urlpatterns += path(...) Make shure that you defined urlpatterns before, like urlpatterns = [], or probably missing definition sign. Need your's urls.py content for a correct answer)

Re: Rest API for plane tracker

2018-10-12 Thread Derek
It looks like they supply an API. So all you should have to do is create views to process calls to & results from that API. You only need DRF if you are storing data locally via your own models. On Monday, 8 October 2018 18:31:28 UTC+2, Caleb Bryson wrote: > > Hey guys I am trying to figure

Regarding static media setup

2018-10-12 Thread ashok kumar reddy
Hello everyone . When I try to setup static Media ,I am repeatedly getting error in URLs.py(urlpatterns not defined ). could you solve this. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving