Search code examples
djangotastypie

Using a default resource_name in Tastypie


I'm getting started with Tastypie and so far so good! I have an aesthetic requirement though. I have an django app called 'Application', and within that, a model called Application.

I can successfully retrieve a list of my Application entries by accessing /Application/Application/, which makes perfect sense. I understand that later, when I want to create additional models, they'll fit well in this structure (such as /Application/User).

My question is: how can I make the "Application" model the default model? The effect I'm looking for is that when someone goes to Application/, it is the same as if they went to Application/Application.

Should I do this through a URLconf, or is there an option in Tastypie (I couldn't fine one).

Thanks!


Solution

  • Tastypie doesn't have any "default model" concept. Use the urlconf.