REST scaffolding ================ Use the :func:`urls.rest` function to quickly create a REST interface for a specific model. Example `app.urls.py` file:: from api.urls import rest from django.contrib.auth.models import User from .models import List, Task # Add a REST endpoint for todo lists, which can represent the # relationship between a list, its creator and the tasks in that list. urlpatterns = rest( List, fields=( 'name', 'created', 'updated', 'icon' ), relations=( 'creator', 'tasks' ) ) # Add a REST endpoint for tasks, which can represent the relationship # back to the parent list. urlpatterns += rest( Task, fields=( 'name', 'created', 'updated', 'completed' ), relations=( 'list' ) ) # Add a REST endpoint for a user, which can represent the relationship # between the user and their tasks. urlpatterns += rest( User, fields=( 'first_name', 'last_name', 'date_joined', 'last_login' ), readonly_fields=( 'date_joined', 'last_login' ), pk_field='username', relations={ 'lists', } ) API reference ------------- .. automodule:: urls :members: