-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some registration notes to start the docs
- Loading branch information
Corey Oordt
committed
Feb 1, 2010
1 parent
59cf711
commit 0ec1fa7
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
================== | ||
Registering Models | ||
================== | ||
|
||
|
||
|
||
|
||
You can register models with the | ||
|
||
import categories | ||
categories.register_fk(MyModel) | ||
|
||
or | ||
|
||
import categories | ||
categories.register_m2m(MyModel) | ||
|
||
If you want more than one field on a model you have to have some extra arguments | ||
|
||
import categories | ||
categories.register_fk(MyModel, 'primary_category') | ||
categories.register_fk(MyModel, 'secondary_category', {'related_name':'mymodel_sec_set'}) | ||
|
||
The ``extra_args`` allows you to specify the related_name of one of the fields so it doesn't clash. |