Permalink
Browse files

nani->hvad in docs

  • Loading branch information...
1 parent da398f2 commit e75b3e91738bcddf94264df832a13ac47e979394 @ojii committed Jul 18, 2012
View
@@ -27,4 +27,4 @@ Glossary
A Django model that does not have :term:`Translated Fields`.
Translated Model
- A Django model that subclasses :class:`nani.models.TranslatableModel`.
+ A Django model that subclasses :class:`hvad.models.TranslatableModel`.
View
@@ -2,12 +2,8 @@
Welcome to the Django hvad documentation!
#########################################
-.. warning:: Please note that django-hvad is still in alpha status and should be
- used with caution.
-
-.. note:: django-hvad is closely related to (and derives from) django-nani.
- Don't be confused if that name is used in the docs or elsewhere,
- many of the functions are also compatible with django-nani.
+.. warning:: The previously used ``nani`` package name is now deprecated,
+ please upgrade your code to use ``hvad``.
******************
About this project
@@ -29,10 +25,12 @@ Python and Django.
************************
-Notes on django versions
+Notes on Django versions
************************
-django-hvad is tested on python 2.6 and 2.7 with django 1.2.7, 1.3.1 and 1.4. These should all work as expected, but for django 1.2.x you need you need to install django-cbv to use the class based views.
+django-hvad is tested on python 2.6 and 2.7 with django 1.2.7, 1.3.1 and 1.4.
+These should all work as expected, but for django 1.2.x you need you need to
+install django-cbv to use the class based views.
***************
@@ -64,4 +62,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
-* :ref:`glossary`
+* :ref:`glossary`
View
@@ -1,8 +1,8 @@
#################
-:mod:`nani.admin`
+:mod:`hvad.admin`
#################
-.. module:: nani.admin
+.. module:: hvad.admin
.. function:: translatable_modelform_factory(model, form=TranslatableModelForm, fields=None, exclude=None, formfield_callback=None)
@@ -18,7 +18,7 @@ TranslatableAdmin
.. class:: TranslatableAdmin
A subclass of :class:`django.contrib.admin.ModelAdmin` to be used for
- :class:`nani.models.TranslatableModel` subclasses.
+ :class:`hvad.models.TranslatableModel` subclasses.
.. attribute:: query_language_key
@@ -28,12 +28,12 @@ TranslatableAdmin
.. attribute:: form
The form to be used for this admin class, defaults to
- :class:`nani.forms.TranslatableModelForm` and if overwritten should
+ :class:`hvad.forms.TranslatableModelForm` and if overwritten should
always be a subclass of that class.
.. attribute:: change_form_template
- We use ``'admin/nani/change_form.html'`` here which extends the correct
+ We use ``'admin/hvad/change_form.html'`` here which extends the correct
template using the logic from django admin, see
:meth:`get_change_form_base_template`. This attribute should never
change.
@@ -60,7 +60,7 @@ TranslatableAdmin
.. method:: queryset(self, request)
- Calls :meth:`nani.manager.TranslationQueryset.language` with the current
+ Calls :meth:`hvad.manager.TranslationQueryset.language` with the current
language from :meth:`_language` on the queryset returned by the call to
the super class and returns that queryset.
@@ -1,8 +1,8 @@
########################
-:mod:`nani.compat.date`
+:mod:`hvad.compat.date`
########################
-.. module:: nani.compat.date
+.. module:: hvad.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
@@ -1,8 +1,8 @@
#######################
-:mod:`nani.descriptors`
+:mod:`hvad.descriptors`
#######################
-.. module:: nani.descriptors
+.. module:: hvad.descriptors
.. class:: NULL
@@ -1,15 +1,15 @@
######################
-:mod:`nani.exceptions`
+:mod:`hvad.exceptions`
######################
-.. module:: nani.exceptions
+.. module:: hvad.exceptions
.. exception:: WrongManager
Raised when trying to access the related manager of a foreign key pointing
from a normal model to a translated model using the standard manager instead
- of one returned by :func:`nani.utils.get_translation_aware_manager`. Used to
+ of one returned by :func:`hvad.utils.get_translation_aware_manager`. Used to
give developers an easier to understand exception than a
:exc:`django.core.exceptions.FieldError`. This exception is raised by the
- :class:`nani.utils.SmartGetFieldByName` which gets patched onto the options
+ :class:`hvad.utils.SmartGetFieldByName` which gets patched onto the options
(meta) of translated models.
@@ -1,8 +1,8 @@
###########################
-:mod:`nani.fieldtranslator`
+:mod:`hvad.fieldtranslator`
###########################
-.. module:: nani.fieldtranslator
+.. module:: hvad.fieldtranslator
.. data:: TRANSLATIONS
View
@@ -1,8 +1,8 @@
#################
-:mod:`nani.forms`
+:mod:`hvad.forms`
#################
-.. module:: nani.forms
+.. module:: hvad.forms
*******************************
View
@@ -1,5 +1,5 @@
#############################################
-General information on django-nani internals
+General information on django-hvad internals
#############################################
@@ -11,14 +11,14 @@ How it works
Model Definition
================
-The :class:`nani.models.TranslatableModelBase` metaclass scans all attributes
-on the model defined for instances of :class:`nani.models.TranslatedFields`, and
+The :class:`hvad.models.TranslatableModelBase` metaclass scans all attributes
+on the model defined for instances of :class:`hvad.models.TranslatedFields`, and
if it finds one, sets the respective options onto meta.
-:class:`nani.models.TranslatedFields` both creates the
+:class:`hvad.models.TranslatedFields` both creates the
:term:`Translations Model` and makes a foreign key from that model to point to
the :term:`Shared Model` which has the name of the attribute of the
-:class:`nani.models.TranslatedFields` instance as related name.
+:class:`hvad.models.TranslatedFields` instance as related name.
In the database, two tables are created:
@@ -33,17 +33,17 @@ In the database, two tables are created:
Queries
=======
-The main idea of django-nani is that when you query the :term:`Shared Model`
+The main idea of django-hvad 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
they have a translation in the language queried in, unless an alternative
manager is used, for example by using
-:meth:`nani.manager.FallbackManager.untranslated`.
+:meth:`hvad.manager.FallbackManager.untranslated`.
Due to the way the Django ORM works, this approach does not seem to be possible
when querying from a :term:`Normal Model`, even when using
-:func:`nani.utils.get_translations_aware_manager` and therefore in that case we
+:func:`hvad.utils.get_translations_aware_manager` and therefore in that case we
just add extra filters to limit the lookups to rows in the database where the
:term:`Translations Model` row existist in a specific language, using
``<translations_accessor>__language_code=<current_language>``. This is
View
@@ -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 django-nani, not with it. It may also be useful to get a better
+ on django-hvad, not with it. It may also be useful to get a better
insight on how things work and may proof helpful during
troubleshooting.
View
@@ -1,8 +1,8 @@
###################
-:mod:`nani.manager`
+:mod:`hvad.manager`
###################
-.. module:: nani.manager
+.. module:: hvad.manager
This module is where most of the functionality is implemented.
@@ -24,7 +24,7 @@ FieldTranslator
Possibly this class is not feature complete since it does not care about
multi-relation queries. It should probably use
- :func:`nani.fieldtranslator.translate` after the first level if it hits
+ :func:`hvad.fieldtranslator.translate` after the first level if it hits
the :term:`Shared Model`.てz
.. method:: get(self, key)
@@ -73,7 +73,7 @@ TranslationQueryset
.. attribute:: override_classes
- A dictionary of django classes to nani classes to mixin when
+ A dictionary of django classes to hvad classes to mixin when
:meth:`_clone` is called with an explicit *klass* argument.
.. attribute:: _local_field_names
@@ -344,7 +344,7 @@ TranslationManager
.. class:: TranslationManager
- Manager to be used on :class:`nani.models.TranslatableModel`.
+ Manager to be used on :class:`hvad.models.TranslatableModel`.
.. attribute:: translations_model
@@ -452,7 +452,7 @@ TranslationAwareQueryset
as an argument.
Translates *args* and *kwargs* into translation aware *args* and
- *kwargs* using :func:`nani.fieldtranslator.translate` by iterating over
+ *kwargs* using :func:`hvad.fieldtranslator.translate` by iterating over
the *kwargs* dictionary and translating it's keys and recursing over the
:class:`django.db.models.expressions.Q` objects in *args* using
:meth:`_recurse_q`.
@@ -467,7 +467,7 @@ TranslationAwareQueryset
Recursively translate the keys in the
:class:`django.db.models.expressions.Q` object given using
- :func:`nani.fieldtranslator.translate`. For more information about
+ :func:`hvad.fieldtranslator.translate`. For more information about
:class:`django.db.models.expressions.Q`, see
:meth:`TranslationQueryset._recurse_q`.
@@ -482,7 +482,7 @@ TranslationAwareQueryset
as an argument.
Translates the fieldnames given using
- :func:`nani.fieldtranslator.translate`
+ :func:`hvad.fieldtranslator.translate`
Returns a tuple of *newfields* and *extra_filters* where *newfields* is
a list of translated fieldnames and *extra_filters* is a
@@ -520,9 +520,9 @@ TranslationAwareQueryset
.. method:: latest(self, field_name=None)
- If a fieldname is given, uses :func:`nani.fieldtranslator.translate` to
+ If a fieldname is given, uses :func:`hvad.fieldtranslator.translate` to
translate that fieldname. Calls :meth:`_filter_extra` with the
- *extra_filters* returned by :func:`nani.fieldtranslator.translate` if it
+ *extra_filters* returned by :func:`hvad.fieldtranslator.translate` if it
was used, otherwise with an empty
:class:`django.db.models.expressions.Q` object.
View
@@ -1,8 +1,8 @@
##################
-:mod:`nani.models`
+:mod:`hvad.models`
##################
-.. module:: nani.models
+.. module:: hvad.models
.. function:: create_translations_model(model, related_name, meta, **fields)
@@ -77,7 +77,7 @@ TranslatableModel
.. attribute:: objects
- An instance of :class:`nani.manager.TranslationManager`.
+ An instance of :class:`hvad.manager.TranslationManager`.
.. attribute:: _shared_field_names
View
@@ -1,8 +1,8 @@
#################
-:mod:`nani.utils`
+:mod:`hvad.utils`
#################
-.. module:: nani.utils
+.. module:: hvad.utils
.. function:: combine(trans)
View
@@ -3,7 +3,7 @@ Admin
#####
When you want to use a :term:`Translated Model` in the Django
-admin, you have to subclass :class:`nani.admin.TranslatableAdmin` instead of
+admin, you have to subclass :class:`hvad.admin.TranslatableAdmin` instead of
:class:`django.contrib.admin.ModelAdmin`.
@@ -25,7 +25,7 @@ ModelAdmin APIs you should not change on TranslatableAdmin
***********************************************************
Some public APIs on :class:`django.contrib.admin.ModelAdmin` are crucial for
-:class:`nani.admin.TranslatableAdmin` to work and should not be altered in
+:class:`hvad.admin.TranslatableAdmin` to work and should not be altered in
subclasses. Only do so if you have a good understanding of what the API you want
to change does.
@@ -37,13 +37,13 @@ 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 django-nani will
+``admin/<appname>/change_form.html``. The template used in django-hvad will
automatically extend that template if it's available.
get_form
========
-Use :attr:`nani.admin.TranslatableAdmin.form` instead, but please see the notes
+Use :attr:`hvad.admin.TranslatableAdmin.form` instead, but please see the notes
regarding :ref:`admin-forms-public`.
render_change_form
@@ -77,8 +77,8 @@ Forms in admin
**************
If you want to alter the form to be used on your
-:class:`nani.admin.TranslatableAdmin` subclass, it must inherit from
-:class:`nani.forms.TranslatableModelForm`. For more informations, see
+:class:`hvad.admin.TranslatableAdmin` subclass, it must inherit from
+:class:`hvad.forms.TranslatableModelForm`. For more informations, see
:ref:`forms-public`.
@@ -87,7 +87,7 @@ ModelAdmin APIs not available on TranslatableAdmin
***************************************************
A list of public APIs on :class:`django.contrib.admin.ModelAdmin` which are not
-implemented on :class:`nani.admin.TranslatableAdmin`.
+implemented on :class:`hvad.admin.TranslatableAdmin`.
* :attr:`list_display` [#f1]_
* :attr:`list_display_links` [#f1]_
View
@@ -3,7 +3,4 @@ Contact and support channels
############################
* IRC: irc.freenode.net/#django-hvad
-* Twitter: `@ojiidotch`_
-* Github: https://github.com/ojii/
-
-.. _@ojiidotch: https://www.twitter.com/ojiidotch
+* Github: https://github.com/KristianOellegaard/django-hvad
@@ -12,7 +12,7 @@ the :doc:`/internal/index`. It was written for developers who want to
understand how things work.
Patches can be sent as pull requests on Github to
-https://github.com/ojii/django-nani.
+https://github.com/KristianOellegaard/django-hvad.
Code Style
@@ -51,4 +51,4 @@ documentation, please follow the following style guidelines:
* ``"``, for paragraphs
.. _RestructuredText: http://docutils.sourceforge.net/rst.html
-.. _Sphinx: http://sphinx.pocoo.org
+.. _Sphinx: http://sphinx.pocoo.org
Oops, something went wrong.

0 comments on commit e75b3e9

Please sign in to comment.