Added SaaS readme file

This commit is contained in:
Marc Aymerich 2016-05-27 10:05:32 +00:00
parent 00ad3cfe98
commit dc5c64f186
1 changed files with 2 additions and 2 deletions

View File

@ -36,14 +36,14 @@ class WordPressChangeForm(WordPressForm):
help_text=_("ID of this blog used by WordPress, the only attribute that doesn't change.")) help_text=_("ID of this blog used by WordPress, the only attribute that doesn't change."))
``` ```
WordPressForm provides the email field, and WordPressChangeForm adds the `blog_id` on top of it. `blog_id` will be represented as a *readonly* field on the form, so no modification will be allowed. `WordPressForm` provides the email field, and `WordPressChangeForm` adds the `blog_id` on top of it. `blog_id` will be represented as a *readonly* field on the form (`widget=widgets.SpanWidget`), so no modification will be allowed.
`SaaSPasswordForm` provides a password field for the common case when a password needs to be provided in order to create a new account. You can subclass `SaaSPasswordForm` or use it directly on the `Service.form` field. `SaaSPasswordForm` provides a password field for the common case when a password needs to be provided in order to create a new account. You can subclass `SaaSPasswordForm` or use it directly on the `Service.form` field.
### Serializer for extra data ### Serializer for extra data
Additionally, we should provide a serializer in order to save the form extra pieces of information into the database (into field *data*). In case we need to save extra information of the service (email and blog_id in our current example) we should provide a serializer that will save this bits of information in JSON format inot the database data field.
```python ```python
class WordPressDataSerializer(serializers.Serializer): class WordPressDataSerializer(serializers.Serializer):