I'm struggling with something that I'm sure is a very easy way, but I'm not getting it right . I am trying to pass a value from urlconf to a feeds.py file, I am trying to generate specific feeds for comments on one page.
I am reading examples in the documentation:
How to use the Get_object () method, but I can not pass the correct values.
What I'm trying here is in the Url.py file:
('^ post / (? P & lt; sl & gt ;. *) / Comment_feed / $ ', CommentFid ()), and in the feeds.py file:
class comment feed (feed): def get_object (auto , Request, SL): return get_object_or_404 (post, ????) and I'm assuming the value:
with the original 10: Illegal verbatim for (Test-1):
What is the correct way to pass an object to CommnetFeed class feeds?
It looks like you were post / test-1 / comment_feed / Were testing with?
Django is expected to have an integer as the post id. Give it a number in post / 12 / comment_feed / and use pk = sl in the example given in the link page.
return get_object_or_404 (post, pk = sl)
Comments
Post a Comment