Skip to content

Commit e09bee9

Browse files
committed
Upgrade all the documentation
1 parent 1b5e6b8 commit e09bee9

29 files changed

+225
-601
lines changed

dajaxice/core/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ class DajaxiceConfig(object):
77
""" Provide an easy to use way to read the dajaxice configuration and
88
return the default values if no configuration is present."""
99

10-
default_config = {'DAJAXICE_MEDIA_PREFIX': 'dajaxice',
11-
'DAJAXICE_DEBUG': False,
12-
'DAJAXICE_NOTIFY_EXCEPTIONS': False,
13-
'DAJAXICE_XMLHTTPREQUEST_JS_IMPORT': True,
10+
default_config = {'DAJAXICE_XMLHTTPREQUEST_JS_IMPORT': True,
1411
'DAJAXICE_JSON2_JS_IMPORT': True,
15-
'DAJAXICE_EXCEPTION': 'DAJAXICE_EXCEPTION'}
12+
'DAJAXICE_EXCEPTION': 'DAJAXICE_EXCEPTION',
13+
'DAJAXICE_MEDIA_PREFIX': 'dajaxice'}
1614

1715
def __getattr__(self, name):
1816
""" Return the customized value for a setting (if it exists) or the
@@ -24,6 +22,10 @@ def __getattr__(self, name):
2422
return self.default_config.get(name)
2523
return None
2624

25+
@property
26+
def dajaxice_url(self):
27+
return r'^%s/' % self.DAJAXICE_MEDIA_PREFIX
28+
2729
def modules(self):
2830
return dajaxice_functions.modules
2931

dajaxice/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
from .views import DajaxiceRequest
33

44
urlpatterns = patterns('dajaxice.views',
5-
url(r'^(.+)/$', DajaxiceRequest.as_view(), name='dajaxice-call-endpoint'),
6-
url(r'', DajaxiceRequest.as_view(), name='dajaxice-endpoint'),
7-
)
5+
url(r'^(.+)/$', DajaxiceRequest.as_view(), name='dajaxice-call-endpoint'),
6+
url(r'', DajaxiceRequest.as_view(), name='dajaxice-endpoint'),
7+
)

docs/available-settings.rst

Lines changed: 10 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,38 @@
11
Available Settings
2-
===========================================
2+
==================
33

44
DAJAXICE_MEDIA_PREFIX
5-
------------------------
6-
**Optional**
5+
-----------------------------------
76

8-
Dajaxice internally generates urls to every method registered, this prefix will be include in that url. http://domain.com/dajaxice/...
7+
This will be the namespace that dajaxice will use as endpoint.
98

109
Defaults to ``dajaxice``
1110

12-
DAJAXICE_DEBUG
13-
------------------------
14-
15-
**Optional**
16-
17-
Force/Avoid show debug info in development server.
18-
19-
Defaults to ``True``
20-
21-
DAJAXICE_NOTIFY_EXCEPTIONS
22-
----------------------------
23-
24-
**Optional**
25-
26-
Force/Avoid send Exception messages to settings.ADMINS
27-
28-
Defaults to ``False``
29-
30-
DAJAXICE_CACHE_CONTROL
31-
------------------------
32-
33-
**Optional**
34-
35-
Cache max_age for dajaxice.core.js file.
36-
37-
Defaults to ``5 x 24 x 60 x 60``
11+
Optional: ``True``
3812

3913
DAJAXICE_XMLHTTPREQUEST_JS_IMPORT
4014
-----------------------------------
4115

42-
**Optional**
43-
44-
include XmlHttpRequest.js inside dajaxice.core.js
16+
Include XmlHttpRequest.js inside dajaxice.core.js
4517

4618
Defaults to ``True``
4719

20+
Optional: ``True``
21+
4822
DAJAXICE_JSON2_JS_IMPORT
4923
-----------------------------------
5024

5125
Include json2.js inside dajaxice.core.js
5226

53-
**Optional**
54-
5527
Defaults to ``True``
5628

29+
Optional: ``True``
30+
5731
DAJAXICE_EXCEPTION
5832
-----------------------------------
5933

60-
**Optional**
61-
6234
Default data sent when an exception occurs.
6335

6436
Defaults to ``"DAJAXICE_EXCEPTION"``
6537

66-
DAJAXICE_JS_DOCSTRINGS
67-
------------------------
68-
69-
**Optional**
70-
71-
If True, Dajaxice will add your ajax functions docstrings as a comment before the js functions in dajaxice.core.js
72-
73-
Defaults to ``False``
74-
75-
76-
DAJAXICE_FUNCTIONS
77-
-----------------------------------
78-
79-
.. note::
80-
81-
Deprecated since **django-dajaxice 0.1.5**
82-
83-
This option contains a list of all functions callable via ajax.
84-
85-
**Since 0.1.5 dajaxice functions should be registered using.**::
86-
87-
dajaxice_functions.register(function)
88-
89-
Defaults to ``()``
38+
Optional: ``True``

docs/conf.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
# django-dajaxice documentation build configuration file, created by
4-
# sphinx-quickstart on Wed Nov 3 14:58:47 2010.
4+
# sphinx-quickstart on Fri May 25 08:02:23 2012.
55
#
66
# This file is execfile()d with the current directory set to its containing dir.
77
#
@@ -18,17 +18,14 @@
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
1919
#sys.path.insert(0, os.path.abspath('.'))
2020

21-
from django.conf import settings
22-
settings.configure()
23-
2421
# -- General configuration -----------------------------------------------------
2522

2623
# If your documentation needs a minimal Sphinx version, state it here.
2724
#needs_sphinx = '1.0'
2825

2926
# Add any Sphinx extension module names here, as strings. They can be extensions
3027
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
31-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
28+
extensions = []
3229

3330
# Add any paths that contain templates here, relative to this directory.
3431
templates_path = ['_templates']
@@ -44,16 +41,24 @@
4441

4542
# General information about the project.
4643
project = u'django-dajaxice'
47-
copyright = u'2011, Benito Jorge Bastida'
44+
copyright = u'2012, Jorge Bastida'
4845

4946
# The version info for the project you're documenting, acts as replacement for
5047
# |version| and |release|, also used in various other places throughout the
5148
# built documents.
5249
#
53-
# The short X.Y version.
54-
version = '0.2'
55-
# The full version, including alpha/beta/rc tags.
56-
release = '0.2'
50+
import pkg_resources
51+
try:
52+
release = pkg_resources.get_distribution('glue').version
53+
except pkg_resources.DistributionNotFound:
54+
print 'To build the documentation, The distribution information of glue'
55+
print 'Has to be available. Either install the package into your'
56+
print 'development environment or run "setup.py develop" to setup the'
57+
print 'metadata. A virtualenv is recommended!'
58+
sys.exit(1)
59+
del pkg_resources
60+
61+
version = '.'.join(release.split('.')[:2])
5762

5863
# The language for content autogenerated by Sphinx. Refer to documentation
5964
# for a list of supported languages.
@@ -67,7 +72,7 @@
6772

6873
# List of patterns, relative to source directory, that match files and
6974
# directories to ignore when looking for source files.
70-
exclude_patterns = []
75+
exclude_patterns = ['_build']
7176

7277
# The reST default role (used for this markup: `text`) to use for all documents.
7378
#default_role = None
@@ -182,7 +187,7 @@
182187
# (source start file, target name, title, author, documentclass [howto/manual]).
183188
latex_documents = [
184189
('index', 'django-dajaxice.tex', u'django-dajaxice Documentation',
185-
u'Benito Jorge Bastida', 'manual'),
190+
u'Jorge Bastida', 'manual'),
186191
]
187192

188193
# The name of an image file (relative to this directory) to place at the top of
@@ -215,5 +220,5 @@
215220
# (source start file, name, description, authors, manual section).
216221
man_pages = [
217222
('index', 'django-dajaxice', u'django-dajaxice Documentation',
218-
[u'Benito Jorge Bastida'], 1)
223+
[u'Jorge Bastida'], 1)
219224
]

docs/create-my-first-dajaxice-function.rst

Lines changed: 0 additions & 71 deletions
This file was deleted.

docs/csrftoken-issues.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/custom-error-callbacks.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ Custom error callbacks
55
How dajaxice handle errors
66
------------------------------
77

8-
.. note::
9-
New in **django-dajaxice 0.2**
10-
118
When one of your functions raises an exception dajaxice returns as response the ``DAJAXICE_EXCEPTION`` message.
129
On every response ``dajaxice.core.js`` checks if that response was an error or not and shows the user a default
1310
error message ``Something goes wrong``.

docs/index.rst

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
.. django-dajaxice documentation master file, created by
2-
sphinx-quickstart on Wed Nov 3 14:58:47 2010.
2+
sphinx-quickstart on Fri May 25 08:02:23 2012.
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to dajaxice!
7-
===========================================
8-
Dajaxice is the *communication core* of dajaxproject. Its main goal is to trivialize the asynchronous communication within the django server side code and your js code.
6+
7+
django-dajaxice
8+
===============
9+
10+
Dajaxixe is an Easy to use AJAX library for django. Its main goal is to trivialize the asynchronous communication within the django server code and your js code. Dajaxice uses the unobtrusive standard-compliant (W3C) XMLHttpRequest 1.0 object.
911

1012
django-dajaxice is a **JS-framework agnostic** library and focuses on decoupling the presentation logic from the server-side logic. dajaxice only requieres **5 minutes to start working.**
1113

@@ -18,35 +20,20 @@ Dajaxice has the following aims:
1820
* Crossbrowsing ready.
1921
* `Unobtrusive standard-compliant (W3C) XMLHttpRequest 1.0 <http://code.google.com/p/xmlhttprequest/>`_ object usage.
2022

21-
Why should I use dajaxice?
22-
--------------------------
23-
* Cleaner code. Your ajax functions works uniform.
24-
* All your presentation logic resides in JS.
25-
* dajaxice didn’t require any JS Framework.
26-
27-
Gettting Started
28-
--------------------
29-
If you’re new to dajaxice, you may want to start with these documents:
30-
23+
Documentation
24+
-------------
3125
.. toctree::
3226
:maxdepth: 2
3327

3428
installation
35-
create-my-first-dajaxice-function
29+
quickstart
30+
3631
custom-error-callbacks
3732
production-environment
38-
migrating-to-02
39-
csrftoken-issues
33+
migrating-to-05
4034
available-settings
41-
modules.rst
42-
43-
How does it works
44-
==================
45-
.. image:: overview.png
46-
:scale: 50 %
47-
:alt: django-dajaxice overview
48-
:align: center
4935

36+
changelog
5037

5138
Indices and tables
5239
==================
@@ -55,11 +42,3 @@ Indices and tables
5542
* :ref:`modindex`
5643
* :ref:`search`
5744

58-
Requirements
59-
--------------------------
60-
Dajaxice doesn't require any special package to start working.
61-
62-
* Python>=2.4
63-
* Django>=1.1.4
64-
65-

0 commit comments

Comments
 (0)