Re: capturing url pattern from html forms

2017-09-24 Thread Mel DeJesus
I found the problem - the key of the object that I was passing in the view's item_detail function's return render line was in quotes. After removing the quotes, the problem went away. I wonder why the quotes didn't post an issue before altering the url pattern. On Sunday, September 24,

Re: capturing url pattern from html forms

2017-09-24 Thread Mel DeJesus
When I try to go to index.html, I get: Exception Type: NoReverseMatch Exception Value: Reverse for 'item_detail' with arguments '(1, 1)' not found. 2 pattern(s) tried: [u'item\\.(?P[a-z0-9]+)/?$', 'item/$'] My Views: def index(request): items = Item.objects.exclude(amount=0)

Re: capturing url pattern from html forms

2017-09-23 Thread James Schneider
On Sep 23, 2017 1:27 PM, "Mel DeJesus" wrote: Unfortunately, I didn't show my entire URLpatterns list, and the ^item/$ seems to interfere with the ^$ of the previous: Any suggestions for a work around? thanks again. from django.conf.urls import include, url from

Re: capturing url pattern from html forms

2017-09-23 Thread Mel DeJesus
Unfortunately, I didn't show my entire URLpatterns list, and the ^item/$ seems to interfere with the ^$ of the previous: Any suggestions for a work around? thanks again. from django.conf.urls import include, url from django.contrib import admin from rest_framework.urlpatterns import

Re: capturing url pattern from html forms

2017-09-23 Thread Mel DeJesus
Awesome, thanks! Following your suggestion, I went to views and I assigned the request.GET['id'] to a variable and was able to use it! On Saturday, September 23, 2017 at 3:41:16 PM UTC-4, Daniel Roseman wrote: > > > > On Saturday, 23 September 2017 19:48:37 UTC+1, Mel DeJesus wrote: >> >> >>

Re: capturing url pattern from html forms

2017-09-23 Thread Daniel Roseman
On Saturday, 23 September 2017 19:48:37 UTC+1, Mel DeJesus wrote: > > > Hi - > > If the number '1' is submitted with the form below, the following url is > created: http://localhost:8000/item/?id=1 > > But I continually get a page not found. How can I style the regex in the > urlpatterns so

capturing url pattern from html forms

2017-09-23 Thread Mel DeJesus
Hi - If the number '1' is submitted with the form below, the following url is created: http://localhost:8000/item/?id=1 But I continually get a page not found. How can I style the regex in the urlpatterns so that this url registers? Thanks. Item Name: I'm attempting to capture