-
Notifications
You must be signed in to change notification settings - Fork 24
Home
This documentation is related to version 0.6.xx
You can install django-is-core very simply with command:
pip install https://github.com/matllubos/django-is-core/tarball/master
Firstly you must add 'is_core'
to INSTALLED_APPS
and 'is_core.middleware.RequestKwargsMiddleware'
to MIDDLEWARE_CLASSES
Example of usage you can see in directory example of this repository.
There is one model class Issue
` class Issue(models.Model): title = models.CharField(_('Subject'), max_length=100, null=False, blank=False)
def __unicode__(self):
return self.title
`
It is possible define rest fields inside Model
class RestMeta:
image_field = 'photo'
selectbox_fields = ('pk', '_obj_name')
rest_fields = ('email', 'first_name', 'last_name', 'is_active', 'role', 'photo', 'salutation','language_code', 'is_verified')
default_obj_fields('email', 'first_name', 'last_name')
default_list_fields('role', 'email')
value for related selectbox. If you want show image with options (default: None
)
fields that should be dowloaded for selectbox (default: ('id', '_obj_name')
)
allowed rest fiels (default: all model fields
)
default fields that is send for one object (can be changed with X-Fields header) (default: default_obj_fields = rest_fields
)
default fields that is send for objects list (can be changed with X-Fields header) (default: default_list_fields = rest_fields
)
You can get RestMeta from model: model._rest_meta