Re: django newb, python newb. HELP! URL link worked for days, now has stopped working. Have I found a bug?

13 views
Skip to first unread message

Melvyn Sopacua

unread,
Sep 21, 2017, 3:25:51 AM9/21/17
to django...@googlegroups.com
Did you really write "focus_pk= 0"? So a space there?

On Tue, Sep 19, 2017 at 2:15 AM, Manches spainspots <manch...@gmail.com> wrote:

Edit.... this is the middle screen shot with the part circled that I have a question about.


On Monday, September 18, 2017 at 4:49:41 PM UTC-7, Manches spainspots wrote:
     Sorry to be a bother, this probably has a quick easy answer that I am just not seeing. 
The template code that calls the url:

<p><a href={% url 'my_tree_view' focus_pk= 0 tree_user_pk=request.user.pk %}> My Tree</a></p>

The idea here is to construct a tree view that can focus on any Person object in my model, and database, based on pk of the Person you want to center on.
This is the base case, which calls the tree view for the user themselves, and is handled in the views.py under the def block for my_tree_view.

My problem is in the url call from the template.

In my system, right now there is only one user, me... at request.user.pk=1.


url.py has the following:

appname="kin"

urlpatterns = [
...
    url(r'^kin/my_tree/view/(?P<focus_pk>[0-9]+)/(?P<tree_user_pk>[0-9]+)/$', my_tree_view, name='my_tree_view'),
...
    ]

Again, this worked for several days, then yesterday, stopped working.

Attached are screen shots of the error page. I can see where the focus_pk loses the value '0' and suddenly becomes focus_pk = ''
It looks like the **kwargs are not being passed correctly here. 

Be the first to help a newb understand!!! Thanks in advance!




--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django...@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/0c8dd768-fdd0-42f4-9892-5b8604eecf88%40googlegroups.com.

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



--
Melvyn Sopacua
Reply all
Reply to author
Forward
0 new messages