Created
September 24, 2020 01:24
-
-
Save toxinu/7f1c073ff66286bec7277bdf474f0b57 to your computer and use it in GitHub Desktop.
blog/filtering-and-ordering-with-restless
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 restless.dj import DjangoResource | |
| from restless.preparers import FieldsPreparer | |
| from .models import Pizza | |
| class PizzaResource(DjangoResource): | |
| preparer = FieldsPreparer(fields={ | |
| 'id': 'id', 'name': 'name'}) | |
| def list(self): | |
| return Pizza.objects.all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment