In the test case (the test suite is set up with their own registry):
def test_getting_an_issue_list(self):
from pyramid import request
# the same code is in the route configuration, with the number being
# a parameter in that view:
path = '/' + root_path + '/createissue/1'
req = request.Request.blank(path)
req.registry = self.config.registry
# The following bails out, due to the code shown below:
result = getNewsletterIssues(req, 1) # BOOM!
def getNewsletterIssues(request, id_):
...
tid = int(request.matchdict['templateid'])
The traceback:
...
tid = int(request.matchdict['templateid'])
TypeError: 'NoneType' object is unsubscriptable
> In the test case (the test suite is set up with their own registry):
> def test_getting_an_issue_list(self):
> from pyramid import request
> # the same code is in the route configuration, with the number being
> # a parameter in that view:
> path = '/' + root_path + '/createissue/1'
> req = request.Request.blank(path)
> req.registry = self.config.registry
> # The following bails out, due to the code shown below:
> result = getNewsletterIssues(req, 1) # BOOM!
> def getNewsletterIssues(request, id_):
> ...
> tid = int(request.matchdict['templateid'])
> The traceback:
> ...
> tid = int(request.matchdict['templateid'])
> TypeError: 'NoneType' object is unsubscriptable
> What am I doing wrong?
> TIA!
> Kind regards,
> --Toni++
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>> In the test case (the test suite is set up with their own registry):
>> def test_getting_an_issue_list(self):
>> from pyramid import request
>> # the same code is in the route configuration, with the number
>> being
>> # a parameter in that view:
>> path = '/' + root_path + '/createissue/1'
>> req = request.Request.blank(path)
>> req.registry = self.config.registry
>> # The following bails out, due to the code shown below:
>> result = getNewsletterIssues(req, 1) # BOOM!
>> def getNewsletterIssues(request, id_):
>> ...
>> tid = int(request.matchdict['templateid'])
>> The traceback:
>> ...
>> tid = int(request.matchdict['templateid'])
>> TypeError: 'NoneType' object is unsubscriptable
>> What am I doing wrong?
>> TIA!
>> Kind regards,
>> --Toni++
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To post to this group, send email to pylons-discuss@googlegroups.com.
>> To unsubscribe from this group, send email to
>> pylons-discuss+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/pylons-discuss?hl=en.
On Fri, Jun 22, 2012 at 3:43 PM, Toni Mueller <d...@tonimueller.org> wrote:
> Hi,
> On Fri, Jun 22, 2012 at 02:37:55PM -0700, Joe Dallago wrote:
> > req.matchdict['templateid'] = 1
> ummm... yes, but I thought that it should be created automatically.
> > Pyramid doesn't actually route the URL, so the matchdict isn't populated.
> Ok, but I didn't find this in the docs. Will have to dig through them
> again.
> To answer your other question:
> That's an artifact after some refactoring. Thanks for pointing it
> out to me - it will be deleted.
> Kind regards,
> --Toni++
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.