restful route apparently ignored

2 views
Skip to first unread message

Guyren G Howe

unread,
Jul 12, 2010, 2:39:50 AM7/12/10
to turbo...@googlegroups.com
TG 2.1. I did:

$paster restcontroller thing things

Then in my routing.py, I have:

map = Mapper(…
map.minimization=False

map.resource('thing', 'things')

Then I have a controllers/things.py, which has this:


class ThingsController(self, format='html')

and so on, all just generated by paster.

I fire this up, go to /things, and I get a 404 error.

Okay, so:

- can anyone tell me from here what I've done wrong?
- (more importantly) how do I get more information than just "404"? I've got all my logging set to debug in my config file. If this was Rails, I'd have a detailed log being produced that tells me what controller it was going to, what arguments it received, and so on. All my log in TG is giving me is the SQL being generated. What am I missing?

Michael Pedersen

unread,
Jul 13, 2010, 3:13:04 PM7/13/10
to turbo...@googlegroups.com
I am confused by what you are doing. From the looks of it, you are doing more work than you need to do.

From what you are showing us, you could just do the following in your project/controllers/root.py and fix the whole problem.

-------
from project.controllers.things import ThingsController

class RootController(BaseController):
    things = ThingsController()
-------

And that's it. No fussing with mappers at all. It will just work.


--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.




--
Michael J. Pedersen
My IM IDs: Jabber/pede...@icelus.tzo.com, ICQ/103345809, AIM/pedermj022171
          Yahoo/pedermj2002, MSN/pederm...@hotmail.com

Reply all
Reply to author
Forward
0 new messages