<commit_before>Django Content:
===============
**Django CMS base content app.**


Models:
=======

ModelBase:
----------
class models.ModelBase
    
Base Model delivering common CMS type functiopnality through inheritance.
Child classes should provide model fields specific to their requirements.  


API Reference:
~~~~~~~~~~~~~~

FIELDS
******
state
    Set the item state. The 'Published' state makes the item visible to the public, 'Unpublished' retracts it and 'Staging' makes the item visible to staff users.
slug
    Unique URL friendly slug. Not editable.
title
    A short descriptive title.
description
    A short description. More verbose than the title but limited to one or two sentences.
created
    Date and time on which this item was created. This is automatically set on creation, but can be changed subsequently.
modified
    Date and time on which this item was last modified. This is automatically set each time the item is saved.
owner
    Content owner.
content_type
    Content type of the leaf class as provided by the Content Types framework.
class_name
    Class name of the leaf class.
categories
    Categories are used to broadly categorize items in order to determine where they appear a site.
tags
    Keyword tagging.
sites
    Makes item eligible to be published on selected sites.
publishers
    Makes item eligible to be published on selected platform.

METHODS
*******
as_leaf_class::

    ModelBase.as_leaf_class()
Returns the leaf class no matter where the calling instance is in the inheritance hierarchy.

generate_slug::

    utils.generate_slug(obj, text)
Sets a slug on provided object based on text and tail number. A URL friendly slug is generated using django.template.defaultfilters' slugify. Numbers are added to the end of slugs for uniqueness.

*Required arguments*

obj
    An object on which to set the slug. The object must provide a django.db.models.SlugField called **slug**.

text
    text from which to generate slug.

MANAGERS
********
permitted::
    ModelBase.permitted
Creates a queryset that only contains objects for the current site with the state field set to 'published'. In case settings.STAGING = True, the queryset will also include objects with the state field set to 'staging'.


Tag Reference:
==============

Enable in your template with the {% load content_inclusion_tags %} tag.

render_object:
--------------
Polymorphically outputs varying simple object templates based on provided object and type.
The template used is determined as follows: <app_label>/inclusion_tags/<model_name>_<type>.html. If a template of that name is not found content/inclusion_tags/modelbase_<type>.html is used by default.

Argument: object to render, type of template to render 

For example:
    {% render_object object type %}<commit_msg>filter docs<commit_after>Django Content:
===============
**Django CMS base content app.**


Models:
=======

ModelBase:
----------
class models.ModelBase
    
Base Model delivering common CMS type functiopnality through inheritance.
Child classes should provide model fields specific to their requirements.  


API Reference:
~~~~~~~~~~~~~~

FIELDS
******
state
    Set the item state. The 'Published' state makes the item visible to the public, 'Unpublished' retracts it and 'Staging' makes the item visible to staff users.
slug
    Unique URL friendly slug. Not editable.
title
    A short descriptive title.
description
    A short description. More verbose than the title but limited to one or two sentences.
created
    Date and time on which this item was created. This is automatically set on creation, but can be changed subsequently.
modified
    Date and time on which this item was last modified. This is automatically set each time the item is saved.
owner
    Content owner.
content_type
    Content type of the leaf class as provided by the Content Types framework.
class_name
    Class name of the leaf class.
categories
    Categories are used to broadly categorize items in order to determine where they appear a site.
tags
    Keyword tagging.
sites
    Makes item eligible to be published on selected sites.
publishers
    Makes item eligible to be published on selected platform.

METHODS
*******
as_leaf_class::

    ModelBase.as_leaf_class()
Returns the leaf class no matter where the calling instance is in the inheritance hierarchy.

generate_slug::

    utils.generate_slug(obj, text)
Sets a slug on provided object based on text and tail number. A URL friendly slug is generated using django.template.defaultfilters' slugify. Numbers are added to the end of slugs for uniqueness.

*Required arguments*

obj
    An object on which to set the slug. The object must provide a django.db.models.SlugField called **slug**.

text
    text from which to generate slug.

MANAGERS
********
permitted::
    ModelBase.permitted
Creates a queryset that only contains objects for the current site with the state field set to 'published'. In case settings.STAGING = True, the queryset will also include objects with the state field set to 'staging'.


Tag Reference:
==============

Enable in your template with the {% load content_inclusion_tags %} tag.

render_object:
--------------
Polymorphically outputs varying simple object templates based on provided object and type.
The template used is determined as follows: <app_label>/inclusion_tags/<model_name>_<type>.html. If a template of that name is not found content/inclusion_tags/modelbase_<type>.html is used by default.

Argument: object to render, type of template to render 

For example:
    {% render_object object type %}


Filtering
=========
Custom filters and filtersets adding custom functionality to the 3rd party django-filter app.

Filters
-------

IntervalFilter
~~~~~~~~~~~~~~
Filters queryset on week (in reality the last 7 days) or month.

    
OrderFilter
~~~~~~~~~~~
Ordering filter ordering queryset items by most-recent(by created) or most-liked(with score being calculated by positive votes).

FilterSets
----------

IntervalOrderFilterSet
~~~~~~~~~~~~~~~~~~~~~~
Filters queryset through an IntervalFilter('interval'). Orders queryset through an OrderFilter('order').
{'fraction_non_alphanumeric': 0.0836582196231319, 'fraction_numerical': 0.0003248862897985705, 'mean_word_length': 4.030228758169935, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1391981', 'n_tokens_mistral': 1581, 'n_tokens_neox': 1510, 'n_words': 798}