Skip to content

Commit

Permalink
model attributes added to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Afonso Caldas committed Jan 18, 2016
1 parent 47373db commit 702924f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 15 additions & 1 deletion doc/models.md
@@ -1,8 +1,21 @@
# Models

Models that inherit from ``appier_extras.admin.Base`` are automatically added to the admin interface.

You can find more information about Appier models [here](http://appier.hive.pt/doc/models.md).

## Model Attributes

The admin interface has support for the attribute types provided by Appier:
* A text field is presented for attributes of type ``str``, ``unicode``, ``int`` and ``float``
* ``bool``attributes are set with a toggle switch.
* Attributes of type ``list`` or ``dict`` can be edited in JSON format.
* If the attribute is an ``appier.File`` object then a file upload input is shown.
* For an ``appier.reference`` attribute its text field has support for autocomplete.

Attributes with the ``private`` <em>keyword</em> set to ``True`` are only shown in the model edit view.
Immutable attributes cannot be edited.

## Model Operations

To add an operation accessible from the the admin interface be executed on a model, add this to the model definition:
Expand Down Expand Up @@ -76,4 +89,5 @@ Links can receive parameters as well:
start_record = start_record,
number_records = number_records
)
```
```

2 changes: 0 additions & 2 deletions readme.md
Expand Up @@ -25,8 +25,6 @@ After running the previous examples, go to [http://localhost:8080/admin](http://
and login with root/root.

## Learn more

### Basic
* [Models](doc/models.md) - admin interface for the app's models

## License
Expand Down

0 comments on commit 702924f

Please sign in to comment.