X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/cec32849d48d9e36c030224e2eb9631d31ef17a2..79e89d2c15b86b7b8d4ccf76c85d2fa2154cd2e8:/docs/models/entities.rst diff --git a/docs/models/entities.rst b/docs/models/entities.rst index fee27c1..4127f56 100644 --- a/docs/models/entities.rst +++ b/docs/models/entities.rst @@ -1,72 +1,56 @@ Entities and Attributes ======================= -One of the core concepts in philo is the relationship between the :class:`Entity` and :class:`Attribute` classes. :class:`Attribute`\ s represent an arbitrary key/value pair by having one :class:`GenericForeignKey` to an :class:`Entity` and another to an :class:`AttributeValue`. +.. automodule:: philo.models.base -Functions ---------- +One of the core concepts in Philo is the relationship between the :class:`Entity` and :class:`Attribute` classes. :class:`Attribute`\ s represent an arbitrary key/value pair by having one :class:`GenericForeignKey` to an :class:`Entity` and another to an :class:`AttributeValue`. -.. function:: register_value_model(model) -.. function:: unregister_value_model(model) - Helper functions to register/unregister a model as a valid content type for a :class:`ForeignKeyValue` or :class:`ManyToManyValue`. +Attributes +---------- +.. autoclass:: Attribute + :members: -Classes -------- +.. autoclass:: AttributeValue + :members: -.. class:: AttributeValue +.. automodule:: philo.models.base + :members: attribute_value_limiter - This is an abstract base class for models that can be used as values for :class:`Attribute`\ s. See the code for examples of implementations. +.. autoclass:: JSONValue + :show-inheritance: - .. attribute:: attribute_set +.. autoclass:: ForeignKeyValue + :show-inheritance: - :class:`GenericRelation` back to :class:`Attribute` +.. autoclass:: ManyToManyValue + :show-inheritance: - .. method:: set_value(value) +.. automodule:: philo.models.base + :noindex: + :members: value_content_type_limiter - Interpret ``value`` and set the appropriate fields so that the value displayed to the world is equivalent to ``value``. +.. autofunction:: register_value_model(model) +.. autofunction:: unregister_value_model(model) - .. method:: value_formfields(**kwargs) +Entities +-------- - Define any formfields that would be used to construct an instance of this value. +.. autoclass:: Entity + :members: + :exclude-members: attribute_set - .. method:: construct_instance(**kwargs) +.. autoclass:: TreeManager + :members: - Apply cleaned data from the formfields generated by valid_formfields to oneself. +.. autoclass:: TreeEntity + :show-inheritance: + :members: + :exclude-members: attribute_set -.. class:: Attribute + .. attribute:: objects - Represents an arbitrary key/value pair attached to a model. - - .. attribute:: entity - - :class:`GenericForeignKey` to anything. - - .. attribute:: value - - :class:`GenericForeignKey` to a subclass of :class:`AttributeValue`. - - .. attribute:: key - - :class:`CharField` containing a key (up to 255 characters) consisting of alphanumeric characters and underscores. - -.. class:: Entity - - A class that simplifies access to related attributes. - - .. attribute:: attribute_set - - :class:`GenericRelation` back to :class:`Attribute`. - - .. attribute:: attributes - - Property that returns a dictionary-like object which can be used to retrieve :class:`Attribute`\ s values directly. - - Example:: - - >>> attr = entity.attribute_set.get(key='spam') - >>> attr.value.value - u'eggs' - >>> entity.attributes['spam'] - u'eggs' \ No newline at end of file + An instance of :class:`TreeManager`. + + .. automethod:: get_path \ No newline at end of file