Loading tests/basic/models.py +1 −1 Original line number Diff line number Diff line # -*- coding: utf-8 -*- """ 1. Bare-bones model Bare-bones model This is a basic model with only two non-primary-key fields. """ Loading tests/choices/models.py +1 −1 Original line number Diff line number Diff line """ 21. Specifying 'choices' for a field Specifying 'choices' for a field Most fields take a ``choices`` parameter, which should be a tuple of tuples specifying which are the valid values for that field. Loading tests/custom_columns/models.py +1 −1 Original line number Diff line number Diff line """ 17. Custom column/table names Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column Loading tests/custom_managers/models.py +1 −1 Original line number Diff line number Diff line """ 23. Giving models a custom manager Giving models a custom manager You can use a custom ``Manager`` in a particular model by extending the base ``Manager`` class and instantiating your custom ``Manager`` in your model. Loading tests/custom_methods/models.py +1 −1 Original line number Diff line number Diff line """ 3. Giving models custom methods Giving models custom methods Any method you add to a model will be available to instances. """ Loading Loading
tests/basic/models.py +1 −1 Original line number Diff line number Diff line # -*- coding: utf-8 -*- """ 1. Bare-bones model Bare-bones model This is a basic model with only two non-primary-key fields. """ Loading
tests/choices/models.py +1 −1 Original line number Diff line number Diff line """ 21. Specifying 'choices' for a field Specifying 'choices' for a field Most fields take a ``choices`` parameter, which should be a tuple of tuples specifying which are the valid values for that field. Loading
tests/custom_columns/models.py +1 −1 Original line number Diff line number Diff line """ 17. Custom column/table names Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column Loading
tests/custom_managers/models.py +1 −1 Original line number Diff line number Diff line """ 23. Giving models a custom manager Giving models a custom manager You can use a custom ``Manager`` in a particular model by extending the base ``Manager`` class and instantiating your custom ``Manager`` in your model. Loading
tests/custom_methods/models.py +1 −1 Original line number Diff line number Diff line """ 3. Giving models custom methods Giving models custom methods Any method you add to a model will be available to instances. """ Loading