Created
July 25, 2014 11:00
-
-
Save bogsio/94d797711bda8b8f9e96 to your computer and use it in GitHub Desktop.
TPT3 - add foreign key
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.resources import ModelResource, fields | |
# ... | |
class TodoItemResource(ModelResource): | |
todo_list = fields.ForeignKey(TodoListResource, 'todo_list') | |
class Meta: | |
authentication = SessionAuthentication() | |
authorization = AuthorizationByList() | |
queryset = TodoItem.objects.all() | |
resource_name = 'item' | |
filtering = { | |
'text': ('icontains',) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment