From dfe587d03bba7ae93b4532a89e789aeff4d35468 Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Fri, 21 Oct 2016 13:32:17 +0300 Subject: [PATCH] Better headings in README --- .travis.yml | 18 ++++++++++++++++++ README.rst | 15 ++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..099de21 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/README.rst b/README.rst index 8afe8ba..10bf842 100644 --- a/README.rst +++ b/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``