mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 03:32:55 +03:00
Better headings in README
This commit is contained in:
parent
4d47351b36
commit
dfe587d03b
18
.travis.yml
Normal file
18
.travis.yml
Normal file
@ -0,0 +1,18 @@
|
||||
env:
|
||||
- DJANGO_SETTINGS_MODULE=settings
|
||||
sudo: true
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
|
||||
- sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev
|
||||
- sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip
|
||||
- sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev
|
||||
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
|
||||
language: python
|
||||
python:
|
||||
- "3.5"
|
||||
services:
|
||||
- postgresql
|
||||
install: "pip install -r requirements/test.txt"
|
||||
script:
|
||||
- coverage run manage.py test
|
15
README.rst
15
README.rst
@ -3,8 +3,17 @@ django-localized-fields
|
||||
|
||||
``django-localized-fields`` is an implementation of a field class for Django models that allows the field's value to be set in multiple languages. It does this by utilizing the ``hstore`` type (PostgreSQL specific), which is available as ``models.HStoreField`` in Django 1.10.
|
||||
|
||||
* [Usage](#usage)
|
||||
* [Basic usage](#basic-usage)
|
||||
* [Constraints](#constraints)
|
||||
* [Other fields](#other-fields)
|
||||
* [Installation](#installation)
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Basic usage
|
||||
-----------------
|
||||
^^^^^^^^^^^
|
||||
Declare fields on your model as ``LocalizedField``:
|
||||
|
||||
.. code-block:: python
|
||||
@ -68,7 +77,7 @@ You can also explicitly set a value in a certain language:
|
||||
new.title.ro = 'other romanian title'
|
||||
|
||||
Constraints
|
||||
------------
|
||||
^^^^^^^^^^
|
||||
By default, the following constraints apply to a ``LocalizedField``:
|
||||
|
||||
* Only the default language is ``required``. The other languages are optional and can be ``NULL``.
|
||||
@ -77,7 +86,7 @@ By default, the following constraints apply to a ``LocalizedField``:
|
||||
At the moment it is *not* possible to specifically instruct ``LocalizedField`` to mark certain languages as required or optional.
|
||||
|
||||
Other fields
|
||||
------------
|
||||
^^^^^^^^^^^
|
||||
Besides ``LocalizedField``, there's also:
|
||||
|
||||
* ``LocalizedAutoSlugField``
|
||||
|
Loading…
x
Reference in New Issue
Block a user