Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent 6b60947 commit b2193c7c6b3467d7409b8fb638386b6e09f149ba @Mimino666 committed with Dec 5, 2013
Showing with 28 additions and 4 deletions.
  1. +28 −4 README.md
View
@@ -39,28 +39,35 @@ autoregister_admin(models)
And that's it! All the models in the module have admin views successfully created and registered.
+#### exclude_models
-If you want to exclude some models and manully create admin for them, use optional *exclude_models* parameter:
+To exclude some models and manully create admin for them, use optional *exclude_models* parameter:
```python
autoregister(models, exclude_models=['ModelName1', 'ModelName2'])
```
-If you want to display some additional fields for the models (e.g. some properties),
+#### model_fields
+
+To display some additional fields for the models (e.g. some properties),
use optional *model_fields* parameter:
```python
autoregister(models, model_fields={'ModelName': ['property_1', 'property_2']})
```
-On the other hand, if you want to exclude some field from displaying, use
+#### exclude_fields
+
+To exclude some fields from displaying, use
optional *exclude_fields* parameter:
```python
autoregister(models, exclude_fields={'ModelName': ['exclude_field1', 'exclude_field2']})
```
-If you want to do a little modifications to the generated admins (e.g. add search fields),
+#### admin_fields
+
+To do a little modifications to the generated admins (e.g. add search fields),
use optional *admin_fields* parameter:
```python
@@ -70,3 +77,20 @@ autoregister(models,
}
)
```
+
+#### reversed_relations
+
+To include links to reversed relations of ForeignKey or Many2Many fields,
+use optional *reversed_relations* parameter:
+
+```python
+# suppose we have the following models
+class Model1(models.Model):
+ pass
+
+class Model2(models.Model):
+ model1 = models.ForeignKey(Model1) # this will be added automatically
+#-------------------------------------------------------------------------
+
+autoregister(models, reversed_relations={'Model1': ['model2']})
+```

0 comments on commit b2193c7

Please sign in to comment.