Created
May 27, 2012 12:04
-
-
Save bohde/2811271 to your computer and use it in GitHub Desktop.
Example ToMany Resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tastypie import fields | |
from tastypie.resources import ModelResource | |
class LeagueResource(ModelResource): | |
registrations = fields.ToMany(LeagueRegistrationResource, attribute="leagueregistrations_set") | |
class Meta: | |
queryset = League.objects.all() | |
resource_name = 'league' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment