-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add opal.core.enum docs and fix a number of renaming bugs in our docs
- Loading branch information
1 parent
47ff0e8
commit 556944a
Showing
5 changed files
with
40 additions
and
3 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
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
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,34 @@ | ||
# opal.core.fields | ||
|
||
The `opal.core.fields` module contains helper functions for working | ||
with fields, as well as custom Opal field definitions. | ||
|
||
## is_numeric | ||
|
||
A helper function that returns true if a field is numeric. For our | ||
purposes, Integers, Decimals, BigIntegers, Floats and Positive Integers | ||
are considered numeric. | ||
|
||
```python | ||
is_numeric(models.IntegerField()) | ||
# -> True | ||
``` | ||
|
||
|
||
## enum | ||
|
||
A helper function that returns a Django choices definition from star args. | ||
|
||
```Python | ||
enum('one', '2', 'III') | ||
# -> ( | ||
# ('one', 'one'), | ||
# ('2', '2'), | ||
# ('III', 'III') | ||
# ) | ||
``` | ||
|
||
## ForeignKeyOrFreeText | ||
|
||
A field that stores it's value as a generic foreign key to an Opal LookupList | ||
or as the value in a CharField. |
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
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