https://github.com/toastdriven/filtering
Probably not useful to you.
https://github.com/toastdriven/filtering
Last synced: 7 months ago
JSON representation
Probably not useful to you.
- Host: GitHub
- URL: https://github.com/toastdriven/filtering
- Owner: toastdriven
- Created: 2011-06-26T07:19:08.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-06-26T07:24:30.000Z (almost 15 years ago)
- Last Synced: 2025-08-13T14:54:33.957Z (9 months ago)
- Language: Python
- Homepage: http://groups.google.com/group/django-tastypie/browse_thread/thread/99e0a4b5070c7d82
- Size: 89.8 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
M2M Filtering
=============
To setup:
* Clone this repo.
* Use a virtualenv (or symlink in tastypie).
* ``./manage.py syncdb``
* ``./manage.py loaddata base_data``
* ``./manage.py runserver``
To test:
* In browser:
* Hit http://localhost:8000/api/v1/parent/?format=json - there should be two
parents there. (Same as your setup)
* Hit http://localhost:8000/api/v1/child/?format=json - there should be three
children there. (Same as your setup)
* Hit http://localhost:8000/api/v1/child/?format=json&parents=1 - there should
be **ONLY** two children there, both of which have ``/api/v1/parent/1/`` in
their ``parents`` field.
* Hit http://localhost:8000/api/v1/child/?format=json&parents=2 - there should
be **ONLY** two children there, both of which have ``/api/v1/parent/2/`` in
their ``parents`` field.
* Hit http://localhost:8000/api/v1/child/?format=json&parents=3 - there should
be no children (because that parent doesn't exist).