Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some minor sphinx markup issues

Added internal docs for nani.compat.date
Fixed `meta` keyword for `TranslatedField` documentation not to be useful
Changed any mention of project-nani to django-nani in the docs
  • Loading branch information...
commit 41cf337e4c0a83dd21db51ed9ebecce13e0fa300 1 parent 212b3ae
@ojii authored
View
2  .gitignore
@@ -8,3 +8,5 @@ htmlcov
*.sqlite
docs/_build
junit-*
+gorun_settings.py
+docs/src/
View
22 docs/conf.py
@@ -25,7 +25,11 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = []
+extensions = ['sphinx.ext.intersphinx']
+intersphinx_mapping = {
+ 'python': ('http://docs.python.org/2.6', None),
+ 'django': ('http://readthedocs.org/docs/django/en/latest/', None),
+}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -40,17 +44,17 @@
master_doc = 'index'
# General information about the project.
-project = u'Project 何'
-copyright = u'2011, Jonas Obrist'
+project = u'django-nani'
+copyright = u'2011, Jonas Obrist & contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = 'EXPERIMENTAL'
+version = '0.0'
# The full version, including alpha/beta/rc tags.
-release = 'EXPERIMENTAL'
+release = '0.0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -178,8 +182,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'Project.tex', u'Project 何 Documentation',
- u'Jonas Obrist', 'manual'),
+ ('index', 'Project.tex', u'Django Nani Documentation',
+ u'Jonas Obrist & contributors', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -211,6 +215,6 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'project', u'Project 何 Documentation',
- [u'Jonas Obrist'], 1)
+ ('index', 'project', u'Django Nani Documentation',
+ [u'Jonas Obrist & contributors'], 1)
]
View
15 docs/index.rst
@@ -1,17 +1,16 @@
-######################################
-Welcome to Project 何's documentation!
-######################################
+#########################################
+Welcome to the Django Nani documentation!
+#########################################
-.. warning:: Please **do NOT** use this project yet! It's in a very early and
- experimental stage and not all APIs are implemented or finalized
- yet.
+.. warning:: Please note that django-nani is still in alpha status and should be
+ used with caution.
******************
About this project
******************
-project-nani provides a high level API to maintain multilingual content in your
+django-nani provides a high level API to maintain multilingual content in your
database using the Django ORM.
*************************
@@ -21,7 +20,7 @@ Before you dive into this
Please note that this documentation assumes that you are very familiar with
Django and Python, if you are not, please familiarize yourself with those first.
-While project-nani tries to be as simple to use as possible, it's still
+While django-nani tries to be as simple to use as possible, it's still
recommended that you only use it if you consider yourself to be very strong in
Python and Django.
View
28 docs/internal/compat_date.rst
@@ -0,0 +1,28 @@
+########################
+:mod:`nani.compat.date`
+########################
+
+.. module:: nani.compat.date
+
+This module provides backwards compatiblity for Django 1.2 for the
+:meth:`django.db.models.query.QuerySet.dates` API, which in Django 1.3 allows
+the fieldname to span relations.
+
+
+************
+DateQuerySet
+************
+
+.. class:: DateQuerySet
+
+ Backport of :class:`django.db.models.query.DateQuerySet` from Django 1.3.
+
+
+*********
+DateQuery
+*********
+
+.. class:: DateQuery
+
+ Backport of :class:`django.db.models.sql.subqueries.DateQuery` from Django
+ 1.3.
View
4 docs/internal/general.rst
@@ -1,5 +1,5 @@
#############################################
-General information on project-nani internals
+General information on django-nani internals
#############################################
@@ -33,7 +33,7 @@ In the database, two tables are created:
Queries
=======
-The main idea of project-nani is that when you query the :term:`Shared Model`
+The main idea of django-nani is that when you query the :term:`Shared Model`
using the Django ORM, what actually happens behind the scenes (in the queryset)
is that it queries the :term:`Translations Model` and selects the relation to
the :term:`Shared Model`. This means that model instances can only be queried if
View
5 docs/internal/index.rst
@@ -10,7 +10,7 @@ About this part of the documentation
mentioned in the public API documentation are internal and are
subject to change without prior notice.
This part of the documentation is for developers who wish to work
- on project-nani, not with it. It may also be useful to get a better
+ on django-nani, not with it. It may also be useful to get a better
insight on how things work and may proof helpful during
troubleshooting.
@@ -31,4 +31,5 @@ This part of the documentation is grouped by file, not by topic.
forms
manager
models
- utils
+ utils
+ compat_date
View
4 docs/internal/utils.rst
@@ -12,7 +12,7 @@
.. function:: get_cached_translation(instance)
- Returns the cached translation from an instance or ``None`.
+ Returns the cached translation from an instance or ``None``.
.. function:: get_translation_aware_manager(model)
@@ -33,4 +33,4 @@
.. function:: permissive_field_by_name(self, name)
Returns the field from the :term:`Shared Model` or
- :term:`Translations Model`, if it is on either.
+ :term:`Translations Model`, if it is on either.
View
2  docs/public/admin.rst
@@ -37,7 +37,7 @@ change_form_template
If you wish to alter the template to be used to render your admin, use the
implicit template fallback in the Django admin by creating a template named
``admin/<appname>/<modelname>/change_form.html`` or
-``admin/<appname>/change_form.html``. The template used in project-nani will
+``admin/<appname>/change_form.html``. The template used in django-nani will
automatically extend that template if it's available.
get_form
View
2  docs/public/installation.rst
@@ -2,7 +2,7 @@
Installation
############
-project-nani can be installed like any Django application. Since the admin uses
+django-nani can be installed like any Django application. Since the admin uses
a custom template, you must put it into ``INSTALLED_APPS``.
No offense, but if you don't know how to install a Django application, you
View
9 docs/public/models.rst
@@ -29,13 +29,14 @@ A full example of a model with translations::
from nani.models import TranslatableModel, TranslatedFields
- class Book(TranslatableModel):
- isbn = models.CharField(max_length=13, unique=True)
+ class TVSeries(TranslatableModel):
+ distributor = models.CharField(max_length=255)
translations = TranslatedFields(
- title = models.CharField(max_length=255),
+ title = models.CharField(max_length=100),
+ subtitle = models.CharField(max_length=255),
released = models.DateTimeField(),
- meta={'ordering': ['-released']},
+ meta={'unique_together': [('title', 'subtitle')]},
)
View
16 docs/public/queryset.rst
@@ -27,7 +27,7 @@ The following methods run two queries where standard querysets would run one:
New methods
===========
-Methods described here are unique to project-nani and cannot be used on normal
+Methods described here are unique to django-nani and cannot be used on normal
querysets.
@@ -73,7 +73,7 @@ Not implemented public queryset methods
=======================================
The following are methods on a queryset which are public APIs in Django, but are
-not implemented (yet) in project-nani:
+not implemented (yet) in django-nani:
* :meth:`nani.manager.TranslationQueryset.in_bulk`
* :meth:`nani.manager.TranslationQueryset.complex_filter`
@@ -84,16 +84,8 @@ not implemented (yet) in project-nani:
Using any of these methods will raise a :exc:`NotImplementedError`.
-Implemented public queryset methods
-===================================
-The following public manager functions are implemented:
-
-* :meth:`nani.manager.TranslationQueryset.aggregate`
-* :meth:`nani.manager.TranslationQueryset.dates`
-* :meth:`nani.manager.TranslationQueryset.exclude`
-
-.. _FallbackQueryset-public
+.. FallbackQueryset-public
****************
FallbackQueryset
@@ -125,4 +117,4 @@ use_fallbacks
case 1 + (n * x) with n being the amount of rows being fetched
and x the amount of languages given as fallbacks. Only ever use
this method when absolutely necessary and on a queryset with as
- few results as possibel.
+ few results as possibel.
View
12 docs/public/quickstart.rst
@@ -50,9 +50,9 @@ Import our model::
Create an **untranslated** instance::
- >>> nani = DjangoApplication.objects.create(name='project-nani', author='Jonas Obrist')
+ >>> nani = DjangoApplication.objects.create(name='django-nani', author='Jonas Obrist')
>>> nani.name
- 'project-nani'
+ 'django-nani'
>>> nani.author
'Jonas Obrist'
@@ -60,7 +60,7 @@ Turn the **untranslated** instance into a **translated** instance with the
language ``'en'`` (English)::
>>> nani.translate('en')
- <DjangoApplication: project-nani>
+ <DjangoApplication: django-nani>
Set some translated fields and save the instance::
@@ -71,9 +71,9 @@ Set some translated fields and save the instance::
Get the instance again and check that the fields are correct. Please note the
usage of :meth:`nani.manager.TranslationManager.language` here::
- >>> obj = DjangoApplication.objects.language('en').get(name='project-nani')
+ >>> obj = DjangoApplication.objects.language('en').get(name='django-nani')
>>> obj.name
- u'project-nani'
+ u'django-nani'
>>> obj.author
u'Jonas Obrist'
>>> obj.description
@@ -85,4 +85,4 @@ Let's get all Django applications which have a description written by
``'Jonas Obrist'``::
>>> DjangoApplication.objects.filter(description_author='Jonas Obrist')
- [<DjangoApplication: project-nani>]
+ [<DjangoApplication: django-nani>]
Please sign in to comment.
Something went wrong with that request. Please try again.