<commit_before>.. _topics-db-models:

==============
Writing models
==============

.. module:: django.db.models

A model is the single, definitive source of data about your data. It contains
the essential fields and behaviors of the data you're storing. Generally, each
model maps to a single database table.

The basics:

    * Each model is a Python class that subclasses
      :class:`django.db.models.Model`.

    * Each attribute of the model represents a database field.

    * With all of this, Django gives you an automatically-generated
      database-access API; see :ref:`topics-db-queries`.

.. seealso::

    A companion to this document is the `official repository of model
    examples`_. (In the Django source distribution, these examples are in the
    ``tests/modeltests`` directory.)

    .. _official repository of model examples: http://www.djangoproject.com/documentation/models/

Quick example
=============<commit_msg>Fixed #9012: Changed inappropriate title of models documentation.<commit_after>.. _topics-db-models:

======
Models
======

.. module:: django.db.models

A model is the single, definitive source of data about your data. It contains
the essential fields and behaviors of the data you're storing. Generally, each
model maps to a single database table.

The basics:

    * Each model is a Python class that subclasses
      :class:`django.db.models.Model`.

    * Each attribute of the model represents a database field.

    * With all of this, Django gives you an automatically-generated
      database-access API; see :ref:`topics-db-queries`.

.. seealso::

    A companion to this document is the `official repository of model
    examples`_. (In the Django source distribution, these examples are in the
    ``tests/modeltests`` directory.)

    .. _official repository of model examples: http://www.djangoproject.com/documentation/models/

Quick example
=============
{'fraction_non_alphanumeric': 0.11024033437826541, 'fraction_numerical': 0.0020898641588296763, 'mean_word_length': 3.7167487684729066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '781496', 'n_tokens_mistral': 522, 'n_tokens_neox': 476, 'n_words': 216}