Commits

Mikhail Korobov committed 0e89611

Improved docs

  • Participants
  • Parent commits 8d09082

Comments (0)

Files changed (7)

docs/_build/doctrees/environment.pickle

Binary file modified.

docs/_build/doctrees/index.doctree

Binary file modified.

docs/_build/html/_sources/index.txt

 ==============
 
 .. automodule:: photo_albums.urls
+
+	.. autoclass:: photo_albums.urls.PhotoAlbumSite()
+		
 	
-.. autoclass:: photo_albums.urls.PhotoAlbumSite
-	:members: __init__
 
 
 Templates used by django-photo-albums
 =====================================
 
-Templates should be placed in ``templates/albums/<app_name>`` folder. App_name 
-should be the name of queryset model's app as it appears in contenttypes 
-table (e.g. 'auth' for User).
+Templates usually should be placed in ``templates/albums/<app_name>/`` folder. 
+App_name should be the name of queryset model's app as it appears in contenttypes 
+table (e.g. 'auth' for User). It is possible to override templates per-model
+(by placing them in ``templates/albums/<app_name>/<model_name>/`` folder) or to have
+a kind of default fallback templates for several apps (by placing them in 
+``templates/albums/`` folder).
 
 Each view have at least 2 variables in context:
 
 * ``<template_object_name>``: object for which gallery is attached to (the name of variable
-	is set in PhotoAlbumsSite constructor, default is ``object``)	
+	is set in PhotoAlbumsSite constructor (:ref:`here<template_object_name>`), default is ``object``)	
 	
 * ``current_app``: app name, 'albums' by default
 
-The views included in django-photo-albums make use of 7 templates:
+
+The views included in django-photo-albums make use of these templates:
+
+Templates
+---------
 
 * ``show_album.html`` displays entire album
 
 * ``edit_album.html`` displays entire album. Used by edit_album view.
 
 * ``reorder_images.html`` displays entire album. Used by reorder_images view. 
-	Theese 3 templates have ``images`` variable in context with iterable of all 
+	These 3 templates have ``images`` variable in context with iterable of all 
 	images in gallery. 
+	
+Example::
+	
+    {% for image in images %}
+        <img src='{{ image.image }}' alt='{{image.caption}}'>
+    {% endfor %}
+    
+With sorl-thumbnails::
+    
+    {% for image in images %}
+        <img src='{% thumbnail image.image 100x50 %}' alt='{{ image.caption }}'>
+    {% endfor %}
+	
 
 * ``show_image.html`` - displays one image. Has ``image``, ``prev`` and ``next`` 
-	variables in context. ``prev`` and `next` are id's of previous and next 
+	variables in context. ``prev`` and ``next`` are id's of previous and next 
 	(by image.order field) images in gallery.
 
+* ``edit_image.html`` - displays one image for editing purposes. Has ``form``, ``image``, 
+	``prev`` and ``next`` variables in context. ``prev`` and `next` are id's of previous and next 
+	(by image.order field) images in gallery. ``form`` is a form of :ref:`edit_form_class<edit_form_class>` class
+
+Example::
+    
+    <img src='{{ image.image }}' alt='{{image.caption}}'>
+    
+    <a href='{% url user_images:edit_image album_user.id prev %}'>previous image</a>
+    <a href='{% url user_images:edit_image album_user.id next %}'>next image</a>
+    
+    <form action='' method='POST'>
+        {{ form }}
+        <input type='submit' value='Save'>
+    </form>
+
+
 * ``upload_images.html`` - displays the formset for bulk image upload. 
-	Formset is of PhotoFormSet type (defined in photo_albums.forms module) and is 
-	available as `formset` context variable. 
+	Formset is of :ref:`upload_formset_class<upload_formset_class>` class and is 
+	available as ``formset`` context variable. 
+	
+Example::
+
+    <form action="" method="POST" enctype="multipart/form-data">
+        {{ formset }}
+        <input type="submit" value="Upload images">
+    </form>    
+    	
 
 * ``upload_main_image.html`` - displays form for uploading one image. Uploaded 
 	image becomes main in gallery. Has ``form`` in context, it's a form of type 
-	AttachedImageForm defined in generic_images.forms module.
+	:ref:`upload_form_class<upload_form_class>`.
 
 * ``confirm_delete.html`` - displays confirmation dialog for deleting image. 
 	Has ``image`` in context. Should have a form that do POST request to delete view
 	on submit.
-
 	
 	
 Views
 	:members:
 	:undoc-members:
 
+
 *******
 Testing
 *******
 	:show-inheritance:
 	:members:
 	:undoc-members:
-	
+	
+Bugs
+====
+
+Issue tracker is here: http://bitbucket.org/kmike/django-photo-albums/issues/
+
+Bug reports, feature requests, enhancement suggestions are always welcome.

docs/_build/html/index.html

 <p>Included urls looks like <tt class="docutils literal"><span class="pre">&lt;object_id&gt;/&lt;app_name&gt;/&lt;action&gt;</span></tt> or 
 <tt class="docutils literal"><span class="pre">&lt;object_id&gt;/&lt;app_name&gt;/&lt;image_id&gt;/&lt;action&gt;</span></tt>,
 where object_id is the id of object which is gallery attached to, 
-app_name is &#8220;albums&#8221; by default, image_id is image id :) and action 
-is performed action (view, edit, etc). It is possible to use slug 
-instead of object&#8217;s id (look at <tt class="docutils literal"><span class="pre">object_regex</span></tt> and <tt class="docutils literal"><span class="pre">lookup_field</span></tt> 
-parameters).</p>
+app_name is &#8220;album&#8221; by default (you can change it <a class="reference" href="#app-name-param"><em>here</em></a>), 
+image_id is image id :-) and action is the performed action (view, edit, etc). 
+It is possible to use slug instead of object&#8217;s id 
+(look at <tt class="docutils literal"><span class="pre">object_regex</span></tt> and <tt class="docutils literal"><span class="pre">lookup_field</span></tt> <a class="reference" href="#custom-url-scheme"><em>parameters</em></a>).</p>
 <ol class="arabic simple" start="2">
 <li>Create the necessary templates.</li>
 <li>Link people to image gallery using <tt class="docutils literal"><span class="pre">{%</span> <span class="pre">url</span> <span class="pre">..</span> <span class="pre">%}</span></tt> template tags.</li>
 </ol>
-<p>You can use these urls (assuming that <cite>user_images</cite> in an instance name,
-<cite>album_user</cite> is object for which gallery is attached to, <cite>image</cite> is image 
-in gallery):</p>
+<p>You can use these urls (assuming that <tt class="docutils literal"><span class="pre">user_images</span></tt> is an instance name,
+<tt class="docutils literal"><span class="pre">album_user</span></tt> is the object for which gallery is attached to, <tt class="docutils literal"><span class="pre">image</span></tt> is an image 
+in gallery and slugs are not used):</p>
 <div class="highlight-python"><pre>{% url user_images:show_album album_user.id %}
 
 {% url user_images:edit_album album_user.id %}
 <dl class="class">
 <dt id="photo_albums.urls.PhotoAlbumSite">
 <em class="property">
-class </em><tt class="descclassname">photo_albums.urls.</tt><tt class="descname">PhotoAlbumSite</tt><big>(</big><em>instance_name</em>, <em>queryset</em>, <em>app_name='album'</em>, <em>object_regex='\d+'</em>, <em>lookup_field='pk'</em>, <em>extra_context=None</em>, <em>template_object_name='object'</em>, <em>has_edit_permission=&lt;function &lt;lambda&gt; at 0x1a19b70&gt;</em>, <em>context_processors=None</em>, <em>edit_form_class=&lt;class 'photo_albums.forms.ImageEditForm'&gt;</em>, <em>upload_form_class=&lt;class 'generic_images.forms.AttachedImageForm'&gt;</em>, <em>upload_formset_class=&lt;class 'django.forms.formsets.AttachedImageFormFormSet'&gt;</em><big>)</big><a class="headerlink" href="#photo_albums.urls.PhotoAlbumSite" title="Permalink to this definition">¶</a></dt>
-<dd><p>Constructor parameters:</p>
+class </em><tt class="descclassname">photo_albums.urls.</tt><tt class="descname">PhotoAlbumSite</tt><a class="headerlink" href="#photo_albums.urls.PhotoAlbumSite" title="Permalink to this definition">¶</a></dt>
+<dd><blockquote>
+<p>Constructor parameters:</p>
 <p><tt class="docutils literal"><span class="pre">instance_name</span></tt>: String. Required. App instance name for url 
 reversing. Must be unique.</p>
 <p><tt class="docutils literal"><span class="pre">queryset</span></tt>: QuerySet. Required. Albums will be attached to objects 
 in this queryset.</p>
-<p><tt class="docutils literal"><span class="pre">object_regex</span></tt>: String. Optional, default is &#8216;d+&#8217;. It should be a 
+<p id="custom-url-scheme"><tt class="docutils literal"><span class="pre">object_regex</span></tt>: String. Optional, default is <tt class="docutils literal"><span class="pre">'\d+'</span></tt>. It should be a 
 URL regular expression for object in URL. You should use smth. 
-like &#8216;[wd-]+&#8217; for slugs.</p>
-<p><tt class="docutils literal"><span class="pre">lookup_field</span></tt>: String. Optional, default is &#8216;pk&#8217;. It is a field 
+like <tt class="docutils literal"><span class="pre">'[\w\d-]+'</span></tt> for slugs.</p>
+<p><tt class="docutils literal"><span class="pre">lookup_field</span></tt>: String. Optional, default is <tt class="docutils literal"><span class="pre">'pk'</span></tt>. It is a field 
 name to lookup. It may contain <tt class="docutils literal"><span class="pre">__</span></tt> and follow relations 
-(ex.: <cite>userprofile__slug</cite>).</p>
-<p><tt class="docutils literal"><span class="pre">app_name</span></tt>: String. Optional, default value is &#8216;album&#8217;. Used by url 
+(ex.: <tt class="docutils literal"><span class="pre">userprofile__slug</span></tt>).</p>
+<p id="app-name-param"><tt class="docutils literal"><span class="pre">app_name</span></tt>: String. Optional, default value is <tt class="docutils literal"><span class="pre">'album'</span></tt>. Used by url 
 namespaces stuff.</p>
 <p><tt class="docutils literal"><span class="pre">extra_context</span></tt>: Dict. Optional. Extra context that will be passed 
 to each view.</p>
+</blockquote>
+<blockquote id="template-object-name">
 <p><tt class="docutils literal"><span class="pre">template_object_name</span></tt>: String. Optional. The name of template 
 context variable with object for which album is attached. 
 Default is &#8216;object&#8217;.</p>
 object and False otherwise. Default behaviour is to always 
 return True.</p>
 <p><tt class="docutils literal"><span class="pre">context_processors</span></tt>: Optional. A list of callables that will be 
-used as additional context_processors in each view</p>
-<p><tt class="docutils literal"><span class="pre">edit_form_class</span></tt>: Optional. ModelForm subclass to be used in 
-edit_image view</p>
-<p><tt class="docutils literal"><span class="pre">upload_form_class</span></tt>: Optional. ModelForm subclass to be used in 
-upload_main_image view</p>
-<p><tt class="docutils literal"><span class="pre">upload_formset_class</span></tt>: Optional. ModelFormSet to be used in 
-upload_images view</p>
+used as additional context_processors in each view.</p>
+<p id="edit-form-class"><tt class="docutils literal"><span class="pre">edit_form_class</span></tt>: Optional, default is <tt class="docutils literal"><span class="pre">ImageEditForm</span></tt> (defined 
+in <tt class="docutils literal"><span class="pre">photo_albums.forms</span></tt> module). ModelForm subclass to be used in 
+edit_image view.</p>
+<p id="upload-form-class"><tt class="docutils literal"><span class="pre">upload_form_class</span></tt>: Optional, default is <tt class="docutils literal"><span class="pre">AttachedImageForm</span></tt> (defined in 
+<tt class="docutils literal"><span class="pre">generic_images.forms</span></tt> module). ModelForm subclass to be used in 
+upload_main_image view.</p>
+<p id="upload-formset-class"><tt class="docutils literal"><span class="pre">upload_formset_class</span></tt>: Optional, default is <tt class="docutils literal"><span class="pre">PhotoFormSet</span></tt> (defined in 
+<tt class="docutils literal"><span class="pre">photo_albums.forms</span></tt> module). ModelFormSet to be used in upload_images view.</p>
+</blockquote>
 </dd></dl>
 
 </div>
 <div class="section" id="templates-used-by-django-photo-albums">
 <h3>Templates used by django-photo-albums<a class="headerlink" href="#templates-used-by-django-photo-albums" title="Permalink to this headline">¶</a></h3>
-<p>Templates should be placed in <tt class="docutils literal"><span class="pre">templates/albums/&lt;app_name&gt;</span></tt> folder. App_name
-should be the name of queryset model&#8217;s app as it appears in contenttypes
-table (e.g. &#8216;auth&#8217; for User).</p>
+<p>Templates usually should be placed in <tt class="docutils literal"><span class="pre">templates/albums/&lt;app_name&gt;/</span></tt> folder.
+App_name should be the name of queryset model&#8217;s app as it appears in contenttypes
+table (e.g. &#8216;auth&#8217; for User). It is possible to override templates per-model
+(by placing them in <tt class="docutils literal"><span class="pre">templates/albums/&lt;app_name&gt;/&lt;model_name&gt;/</span></tt> folder) or to have
+a kind of default fallback templates for several apps (by placing them in
+<tt class="docutils literal"><span class="pre">templates/albums/</span></tt> folder).</p>
 <p>Each view have at least 2 variables in context:</p>
 <ul>
 <li><dl class="first docutils">
 <dt><tt class="docutils literal"><span class="pre">&lt;template_object_name&gt;</span></tt>: object for which gallery is attached to (the name of variable</dt>
-<dd><p class="first last">is set in PhotoAlbumsSite constructor, default is <tt class="docutils literal"><span class="pre">object</span></tt>)</p>
+<dd><p class="first last">is set in PhotoAlbumsSite constructor (<a class="reference" href="#template-object-name"><em>here</em></a>), default is <tt class="docutils literal"><span class="pre">object</span></tt>)</p>
 </dd>
 </dl>
 </li>
 <li><p class="first"><tt class="docutils literal"><span class="pre">current_app</span></tt>: app name, &#8216;albums&#8217; by default</p>
 </li>
 </ul>
-<p>The views included in django-photo-albums make use of 7 templates:</p>
+<p>The views included in django-photo-albums make use of these templates:</p>
+<div class="section" id="templates">
+<h4>Templates<a class="headerlink" href="#templates" title="Permalink to this headline">¶</a></h4>
 <ul>
 <li><p class="first"><tt class="docutils literal"><span class="pre">show_album.html</span></tt> displays entire album</p>
 </li>
 </li>
 <li><dl class="first docutils">
 <dt><tt class="docutils literal"><span class="pre">reorder_images.html</span></tt> displays entire album. Used by reorder_images view.</dt>
-<dd><p class="first last">Theese 3 templates have <tt class="docutils literal"><span class="pre">images</span></tt> variable in context with iterable of all
+<dd><p class="first last">These 3 templates have <tt class="docutils literal"><span class="pre">images</span></tt> variable in context with iterable of all
 images in gallery.</p>
 </dd>
 </dl>
 </li>
+</ul>
+<p>Example:</p>
+<div class="highlight-python"><pre>{% for image in images %}
+    &lt;img src='{{ image.image }}' alt='{{image.caption}}'&gt;
+{% endfor %}</pre>
+</div>
+<p>With sorl-thumbnails:</p>
+<div class="highlight-python"><pre>{% for image in images %}
+    &lt;img src='{% thumbnail image.image 100x50 %}' alt='{{ image.caption }}'&gt;
+{% endfor %}</pre>
+</div>
+<ul>
 <li><dl class="first docutils">
 <dt><tt class="docutils literal"><span class="pre">show_image.html</span></tt> - displays one image. Has <tt class="docutils literal"><span class="pre">image</span></tt>, <tt class="docutils literal"><span class="pre">prev</span></tt> and <tt class="docutils literal"><span class="pre">next</span></tt></dt>
-<dd><p class="first last">variables in context. <tt class="docutils literal"><span class="pre">prev</span></tt> and <cite>next</cite> are id&#8217;s of previous and next
+<dd><p class="first last">variables in context. <tt class="docutils literal"><span class="pre">prev</span></tt> and <tt class="docutils literal"><span class="pre">next</span></tt> are id&#8217;s of previous and next
 (by image.order field) images in gallery.</p>
 </dd>
 </dl>
 </li>
 <li><dl class="first docutils">
-<dt><tt class="docutils literal"><span class="pre">upload_images.html</span></tt> - displays the formset for bulk image upload.</dt>
-<dd><p class="first last">Formset is of PhotoFormSet type (defined in photo_albums.forms module) and is
-available as <cite>formset</cite> context variable.</p>
+<dt><tt class="docutils literal"><span class="pre">edit_image.html</span></tt> - displays one image for editing purposes. Has <tt class="docutils literal"><span class="pre">form</span></tt>, <tt class="docutils literal"><span class="pre">image</span></tt>,</dt>
+<dd><p class="first last"><tt class="docutils literal"><span class="pre">prev</span></tt> and <tt class="docutils literal"><span class="pre">next</span></tt> variables in context. <tt class="docutils literal"><span class="pre">prev</span></tt> and <cite>next</cite> are id&#8217;s of previous and next
+(by image.order field) images in gallery. <tt class="docutils literal"><span class="pre">form</span></tt> is a form of <a class="reference" href="#edit-form-class"><em>edit_form_class</em></a> class</p>
 </dd>
 </dl>
 </li>
+</ul>
+<p>Example:</p>
+<div class="highlight-python"><pre>&lt;img src='{{ image.image }}' alt='{{image.caption}}'&gt;
+
+&lt;a href='{% url user_images:edit_image album_user.id prev %}'&gt;previous image&lt;/a&gt;
+&lt;a href='{% url user_images:edit_image album_user.id next %}'&gt;next image&lt;/a&gt;
+
+&lt;form action='' method='POST'&gt;
+    {{ form }}
+    &lt;input type='submit' value='Save'&gt;
+&lt;/form&gt;</pre>
+</div>
+<ul>
+<li><dl class="first docutils">
+<dt><tt class="docutils literal"><span class="pre">upload_images.html</span></tt> - displays the formset for bulk image upload.</dt>
+<dd><p class="first last">Formset is of <a class="reference" href="#upload-formset-class"><em>upload_formset_class</em></a> class and is
+available as <tt class="docutils literal"><span class="pre">formset</span></tt> context variable.</p>
+</dd>
+</dl>
+</li>
+</ul>
+<p>Example:</p>
+<div class="highlight-python"><pre>&lt;form action="" method="POST" enctype="multipart/form-data"&gt;
+    {{ formset }}
+    &lt;input type="submit" value="Upload images"&gt;
+&lt;/form&gt;</pre>
+</div>
+<ul>
 <li><dl class="first docutils">
 <dt><tt class="docutils literal"><span class="pre">upload_main_image.html</span></tt> - displays form for uploading one image. Uploaded</dt>
 <dd><p class="first last">image becomes main in gallery. Has <tt class="docutils literal"><span class="pre">form</span></tt> in context, it&#8217;s a form of type
-AttachedImageForm defined in generic_images.forms module.</p>
+<a class="reference" href="#upload-form-class"><em>upload_form_class</em></a>.</p>
 </dd>
 </dl>
 </li>
 </li>
 </ul>
 </div>
+</div>
 <div class="section" id="module-photo_albums.views">
 <h3>Views<a class="headerlink" href="#module-photo_albums.views" title="Permalink to this headline">¶</a></h3>
 <p>Views used by PhotoAlbumSite.</p>
 </dd></dl>
 
 </div>
+<div class="section" id="bugs">
+<h3>Bugs<a class="headerlink" href="#bugs" title="Permalink to this headline">¶</a></h3>
+<p>Issue tracker is here: <a class="reference" href="http://bitbucket.org/kmike/django-photo-albums/issues/">http://bitbucket.org/kmike/django-photo-albums/issues/</a></p>
+<p>Bug reports, feature requests, enhancement suggestions are always welcome.</p>
+</div>
 </div>
 </div>
 
 <li><a class="reference" href="#installation">Installation</a></li>
 <li><a class="reference" href="#basic-use">Basic use</a><ul>
 <li><a class="reference" href="#module-photo_albums.urls">PhotoAlbumSite</a></li>
-<li><a class="reference" href="#templates-used-by-django-photo-albums">Templates used by django-photo-albums</a></li>
+<li><a class="reference" href="#templates-used-by-django-photo-albums">Templates used by django-photo-albums</a><ul>
+<li><a class="reference" href="#templates">Templates</a></li>
+</ul>
+</li>
 <li><a class="reference" href="#module-photo_albums.views">Views</a></li>
 </ul>
 </li>
 <li><a class="reference" href="#testing">Testing</a><ul>
 <li><a class="reference" href="#module-photo_albums.test_utils">Integration testing</a></li>
+<li><a class="reference" href="#bugs">Bugs</a></li>
 </ul>
 </li>
 </ul>

docs/_build/html/searchindex.js

-Search.setIndex({desctypes:{"0":"class","1":"attribute","2":"function","3":"method"},terms:{pluggabl:0,has_edit_permiss:0,obiwanu:0,photo:0,formset:0,get_template_nam:[],becaus:0,python:0,clear_main_imag:0,prefix:[],object_id:0,test_util:0,follow:0,"0x1a1caf0":[],regular:0,paramet:0,redirect:0,note:0,photo_album:0,depend:0,thank:0,easi:0,name:0,template_nam:0,except:0,should:0,add:0,html:0,dict:0,folder:0,main:0,modul:0,photoalbumsit:0,good:0,"return":0,string:0,variou:0,fals:0,delete_imag:0,express:0,account:0,auth:0,upload_formset_class:0,util:[],mention:0,set_as_main_imag:0,veri:0,password:0,must:0,requir:0,like:0,test_help:0,template_object_nam:0,useralbumtest:0,contenttyp:0,attachedimageformformset:0,edit:0,modelform:0,photoalbumssit:0,revers:0,list:0,upload:0,iter:0,"0x1a1baf0":[],albumtest:0,"default":0,stuff:0,necessari:0,integr:0,have:0,each:0,where:0,page:[],attachedimag:[],view:0,pleas:0,show_imag:0,set:0,unmark:0,permiss:0,accounts_photo_sit:0,test_reord:0,uniqu:0,methodnam:0,second:0,meta:[],generic_util:0,my_fixtur:0,pass:0,testcas:0,syncdb:0,modelformset:0,librari:0,album:0,index:[],statu:0,upload_imag:0,appear:0,correctli:0,confirm:0,pattern:0,ned:0,extra:0,subclass:0,content:[],delet:0,version:0,pluggablesit:[],"import":0,imageeditform:0,method:0,album_for_id:0,id_:[],object:0,run:0,urlpattern:0,empty_permit:[],gener:0,contain:0,usag:0,errorlist:[],upload_form_class:0,image_id:0,step:0,base:0,org:0,post:0,viewtest:0,slug:0,valu:0,addit:0,plug:0,behaviour:0,search:[],kmike:0,confirm_delet:0,http:0,manag:0,etc:0,excluded_view:0,place:0,dialog:0,constructor:0,app_util:[],upload_main_imag:0,image_in_other_album_id:0,urlconf:0,lambda:0,load:0,instance_nam:0,set_image_ord:0,user:0,onc:0,app:0,easy_instal:0,reorder_imag:0,thumbnail:0,alreadi:0,least:0,instal:0,installed_app:0,assum:0,your:0,test_public_view:0,auto_id:[],differ:0,becom:0,from:0,generic_imag:0,show_album:0,current_app:0,submit:0,next:0,avail:0,attach:0,"0x1a1aaf0":[],possibl:0,includ:0,suit:0,show:0,test_forbidden_view:0,prev:0,type:0,entir:0,"function":0,"0x1a1bb30":[],option:0,form:0,namespac:0,peopl:0,imag:0,basic:0,setuptool:0,site:0,bulk:0,thi:0,link:0,templat:0,sorl:0,obj:0,"true":0,initi:[],runtest:0,none:0,extra_context:0,edit_imag:0,look:0,instanc:0,provid:0,alia:[],setup:0,work:0,displai:0,error_class:[],exampl:0,annoi:0,defin:0,kwarg:0,reorder:0,user_imag:0,otherwis:0,object_regex:0,fixtur:0,app_nam:0,overrid:0,"0x1a14af0":[],edit_form_class:0,login_requir:[],creat:0,"0x1a1bb70":[],can:0,queryset:0,ani:0,accept:0,edit_album:0,need:0,tag:0,smth:0,file:[],tabl:0,pip:0,exist:0,django:0,dedic:0,sever:0,alwai:0,decor:[],tou:0,multipl:0,welcom:[],want:0,vasia:0,perform:0,media:[],make:0,same:[],check:0,attachedimageform:0,field:0,other:0,lookup:0,"__init__":[],indic:[],test:0,instead:0,you:0,document:0,album_sit:0,complet:0,variabl:0,all:0,relat:0,photoformset:0,context:0,usernam:0,clone:0,previou:0,image_in_album_id:0,galleri:0,label_suffix:[],action:0,rais:0,album_us:0,userprofile__slug:0,deploi:0,mai:0,necesseri:0,lookup_field:0,data:0,"class":0,"0x1a19b70":0,svn:0,my_object_slug:0,bitbucket:0,don:0,context_processor:0,url:0,request:0,rule:0,exclud:0,mark:0,which:0,write:0,allow:0,test_auth_view:0,callabl:0,model:0,image2_in_album_id:0,order:0,thees:0},titles:["django-photo-albums&#8217;s documentation"],modules:{"photo_albums.views":0,"photo_albums.urls":0,"photo_albums.test_utils":0},descrefs:{"photo_albums.views":{upload_images:[0,1],edit_album:[0,1],set_as_main_image:[0,1],edit_image:[0,1],upload_main_image:[0,1],clear_main_image:[0,1],show_album:[0,2],show_image:[0,2],delete_image:[0,1]},"photo_albums.test_utils.AlbumTest":{test_reorder:[0,3],test_forbidden_views:[0,3],check:[0,3],test_public_views:[0,3],test_auth_views:[0,3]},"photo_albums.urls":{PhotoAlbumSite:[0,0]},"photo_albums.test_utils":{AlbumTest:[0,0]}},filenames:["index"]})
+Search.setIndex({desctypes:{"0":"class","1":"attribute","2":"function","3":"method"},terms:{pluggabl:0,has_edit_permiss:0,obiwanu:0,formset:0,all:0,prefix:[],subclass:0,follow:0,alt:0,photo_album:0,depend:0,string:0,fals:0,account:0,util:[],context_processor:0,veri:0,contenttyp:0,ref:[],list:0,upload:0,iter:0,pleas:0,unmark:0,accounts_photo_sit:0,second:0,pass:0,index:[],appear:0,ned:0,delet:0,version:0,method:0,gener:0,here:0,errorlist:[],upload_form_class:0,becom:0,valu:0,search:[],error_class:[],vasia:0,"0x1a1bb30":[],app_util:[],chang:0,extra:0,modul:0,href:0,instal:0,from:0,current_app:0,next:0,prev:0,type:0,reorder:0,peopl:0,relat:0,enhanc:0,accept:0,sorl:0,obj:0,must:0,none:0,edit_imag:0,alia:[],setup:0,work:0,uniqu:0,annoi:0,can:0,purpos:0,overrid:0,edit_form_class:0,want:0,view_us:[],templat:0,tag:0,smth:0,login_requir:[],alwai:0,multipl:0,attachedimageform:0,"__init__":[],instead:0,photoformset:0,clone:0,mai:0,data:0,"0x1a19b70":[],django:0,issu:0,object_regex:0,allow:0,media:[],callabl:0,fallback:0,order:0,becaus:0,clear_main_imag:0,"0x1a1caf0":[],paramet:0,write:0,thank:0,img:0,html:0,main:0,edit_album:0,good:0,"return":0,python:0,auth:0,mention:0,name:0,edit:0,photoalbumssit:0,revers:0,each:0,attachedimag:[],show_imag:0,runtest:0,meta:[],my_fixtur:0,album:0,upload_imag:0,test_auth_view:0,content:[],modelform:0,urlpattern:0,empty_permit:[],base:0,org:0,caption:0,place:0,urlconf:0,lambda:0,instance_nam:0,template_nam:0,onc:0,alreadi:0,installed_app:0,auto_id:[],differ:0,account_imag:[],least:0,tou:0,attach:0,"0x1a1aaf0":[],test_forbidden_view:0,scheme:[],option:0,namespac:0,setuptool:0,kind:0,provid:0,initi:[],"0x1a14af0":[],queryset:0,ani:0,have:0,tabl:0,need:0,dedic:0,exclud:0,object_id:0,note:0,indic:[],necesseri:0,album_sit:0,endfor:0,usernam:0,object:0,galleri:0,label_suffix:[],regular:0,deploi:0,lookup_field:0,"class":0,don:0,url:0,request:0,"100x50":0,enctyp:0,show:0,get_template_nam:[],model_nam:0,permiss:0,redirect:0,should:0,dict:0,folder:0,extra_context:0,variou:0,delete_imag:0,express:0,set_as_main_imag:0,report:0,requir:0,useralbumtest:0,attachedimageformformset:[],stuff:0,integr:0,contain:0,where:0,view:0,set:0,methodnam:0,see:[],multipart:0,testcas:0,modelformset:0,statu:0,correctli:0,pattern:0,user:0,thumb:[],"import":0,thumbnail:0,extend:[],image_id:0,entir:0,addit:0,behaviour:0,etc:0,excluded_view:0,context:0,load:0,upload_formset_class:0,reorder_imag:0,assum:0,mark:0,basic:0,imag:0,bulk:0,look:0,defin:0,fixtur:0,endblock:[],them:0,kwarg:0,sever:0,decor:[],welcom:0,perform:0,suggest:0,make:0,same:[],instanc:0,document:0,complet:0,http:0,action:0,rais:0,album_us:0,userprofile__slug:0,test_help:0,upload_main_imag:0,exampl:0,thi:0,model:0,usual:0,photo:0,test_public_view:0,test_util:0,thees:[],easi:0,except:0,add:0,input:0,save:0,app:0,photoalbumsit:0,which:0,password:0,template_object_nam:0,like:0,"0x1a1baf0":[],albumtest:0,album_for_id:0,necessari:0,page:[],test_reord:0,syncdb:0,librari:0,confirm:0,per:0,tracker:0,pluggablesit:[],imageeditform:0,id_:[],previou:0,run:0,usag:0,step:0,post:0,viewtest:0,slug:0,plug:0,src:0,kmike:0,manag:0,user_imag:0,dialog:0,constructor:0,image_in_other_album_id:0,block:[],image2_in_album_id:0,photo_smal:[],set_image_ord:0,easy_instal:0,your:0,submit:0,custom:[],avail:0,show_album:0,includ:0,suit:0,"function":0,form:0,"0x1a19bb0":[],link:0,"true":0,bug:0,possibl:0,"default":0,autoclass:[],displai:0,site:0,otherwis:0,confirm_delet:0,app_nam:0,featur:0,creat:0,"0x1a1bb70":[],exist:0,file:[],pip:0,check:0,"_custom_url_schem":[],field:0,other:0,lookup:0,test:0,you:0,variabl:0,image_in_album_id:0,get_profil:[],svn:0,my_object_slug:0,bitbucket:0,rule:0,generic_imag:0,generic_util:0},titles:["django-photo-albums&#8217;s documentation"],modules:{"photo_albums.views":0,"photo_albums.urls":0,"photo_albums.test_utils":0},descrefs:{"photo_albums.views":{upload_images:[0,1],edit_album:[0,1],set_as_main_image:[0,1],edit_image:[0,1],upload_main_image:[0,1],clear_main_image:[0,1],show_album:[0,2],show_image:[0,2],delete_image:[0,1]},"photo_albums.test_utils.AlbumTest":{test_reorder:[0,3],test_forbidden_views:[0,3],check:[0,3],test_public_views:[0,3],test_auth_views:[0,3]},"photo_albums.urls":{PhotoAlbumSite:[0,0]},"photo_albums.test_utils":{AlbumTest:[0,0]}},filenames:["index"]})
 ==============
 
 .. automodule:: photo_albums.urls
+
+	.. autoclass:: photo_albums.urls.PhotoAlbumSite()
+		
 	
-.. autoclass:: photo_albums.urls.PhotoAlbumSite
-	:members: __init__
 
 
 Templates used by django-photo-albums
 =====================================
 
-Templates should be placed in ``templates/albums/<app_name>`` folder. App_name 
-should be the name of queryset model's app as it appears in contenttypes 
-table (e.g. 'auth' for User).
+Templates usually should be placed in ``templates/albums/<app_name>/`` folder. 
+App_name should be the name of queryset model's app as it appears in contenttypes 
+table (e.g. 'auth' for User). It is possible to override templates per-model
+(by placing them in ``templates/albums/<app_name>/<model_name>/`` folder) or to have
+a kind of default fallback templates for several apps (by placing them in 
+``templates/albums/`` folder).
 
 Each view have at least 2 variables in context:
 
 * ``<template_object_name>``: object for which gallery is attached to (the name of variable
-	is set in PhotoAlbumsSite constructor, default is ``object``)	
+	is set in PhotoAlbumsSite constructor (:ref:`here<template_object_name>`), default is ``object``)	
 	
 * ``current_app``: app name, 'albums' by default
 
-The views included in django-photo-albums make use of 7 templates:
+
+The views included in django-photo-albums make use of these templates:
+
+Templates
+---------
 
 * ``show_album.html`` displays entire album
 
 * ``edit_album.html`` displays entire album. Used by edit_album view.
 
 * ``reorder_images.html`` displays entire album. Used by reorder_images view. 
-	Theese 3 templates have ``images`` variable in context with iterable of all 
+	These 3 templates have ``images`` variable in context with iterable of all 
 	images in gallery. 
+	
+Example::
+	
+    {% for image in images %}
+        <img src='{{ image.image }}' alt='{{image.caption}}'>
+    {% endfor %}
+    
+With sorl-thumbnails::
+    
+    {% for image in images %}
+        <img src='{% thumbnail image.image 100x50 %}' alt='{{ image.caption }}'>
+    {% endfor %}
+	
 
 * ``show_image.html`` - displays one image. Has ``image``, ``prev`` and ``next`` 
-	variables in context. ``prev`` and `next` are id's of previous and next 
+	variables in context. ``prev`` and ``next`` are id's of previous and next 
 	(by image.order field) images in gallery.
 
+* ``edit_image.html`` - displays one image for editing purposes. Has ``form``, ``image``, 
+	``prev`` and ``next`` variables in context. ``prev`` and `next` are id's of previous and next 
+	(by image.order field) images in gallery. ``form`` is a form of :ref:`edit_form_class<edit_form_class>` class
+
+Example::
+    
+    <img src='{{ image.image }}' alt='{{image.caption}}'>
+    
+    <a href='{% url user_images:edit_image album_user.id prev %}'>previous image</a>
+    <a href='{% url user_images:edit_image album_user.id next %}'>next image</a>
+    
+    <form action='' method='POST'>
+        {{ form }}
+        <input type='submit' value='Save'>
+    </form>
+
+
 * ``upload_images.html`` - displays the formset for bulk image upload. 
-	Formset is of PhotoFormSet type (defined in photo_albums.forms module) and is 
-	available as `formset` context variable. 
+	Formset is of :ref:`upload_formset_class<upload_formset_class>` class and is 
+	available as ``formset`` context variable. 
+	
+Example::
+
+    <form action="" method="POST" enctype="multipart/form-data">
+        {{ formset }}
+        <input type="submit" value="Upload images">
+    </form>    
+    	
 
 * ``upload_main_image.html`` - displays form for uploading one image. Uploaded 
 	image becomes main in gallery. Has ``form`` in context, it's a form of type 
-	AttachedImageForm defined in generic_images.forms module.
+	:ref:`upload_form_class<upload_form_class>`.
 
 * ``confirm_delete.html`` - displays confirmation dialog for deleting image. 
 	Has ``image`` in context. Should have a form that do POST request to delete view
 	on submit.
-
 	
 	
 Views
 	:members:
 	:undoc-members:
 
+
 *******
 Testing
 *******
 	:show-inheritance:
 	:members:
 	:undoc-members:
-	
+	
+Bugs
+====
+
+Issue tracker is here: http://bitbucket.org/kmike/django-photo-albums/issues/
+
+Bug reports, feature requests, enhancement suggestions are always welcome.

photo_albums/urls.py

     Included urls looks like ``<object_id>/<app_name>/<action>`` or 
     ``<object_id>/<app_name>/<image_id>/<action>``,
     where object_id is the id of object which is gallery attached to, 
-    app_name is "albums" by default, image_id is image id :) and action 
-    is performed action (view, edit, etc). It is possible to use slug 
-    instead of object's id (look at ``object_regex`` and ``lookup_field`` 
-    parameters). 
+    app_name is "album" by default (you can change it :ref:`here<app_name_param>`), 
+    image_id is image id :-) and action is the performed action (view, edit, etc). 
+    It is possible to use slug instead of object's id 
+    (look at ``object_regex`` and ``lookup_field`` :ref:`parameters<custom_url_scheme>`). 
     
     2. Create the necessary templates. 
        
     3. Link people to image gallery using ``{% url .. %}`` template tags.
     
-    You can use these urls (assuming that `user_images` in an instance name,
-    `album_user` is object for which gallery is attached to, `image` is image 
-    in gallery)::
+    You can use these urls (assuming that ``user_images`` is an instance name,
+    ``album_user`` is the object for which gallery is attached to, ``image`` is an image 
+    in gallery and slugs are not used)::
     
         {% url user_images:show_album album_user.id %}
         
 from generic_images.forms import AttachedImageForm
 
 class PhotoAlbumSite(PluggableSite):
-    '''
-        Constructor parameters:
-        
-        ``instance_name``: String. Required. App instance name for url 
-        reversing. Must be unique.
-        
-        ``queryset``: QuerySet. Required. Albums will be attached to objects 
-        in this queryset.
-        
-        ``object_regex``: String. Optional, default is '\d+'. It should be a 
-        URL regular expression for object in URL. You should use smth. 
-        like '[\w\d-]+' for slugs.
-        
-        ``lookup_field``: String. Optional, default is 'pk'. It is a field 
-        name to lookup. It may contain ``__`` and follow relations 
-        (ex.: `userprofile__slug`).
-        
-        ``app_name``: String. Optional, default value is 'album'. Used by url 
-        namespaces stuff.
-        
-        ``extra_context``: Dict. Optional. Extra context that will be passed 
-        to each view.
-        
-        ``template_object_name``: String. Optional. The name of template 
-        context variable with object for which album is attached. 
-        Default is 'object'.
-        
-        ``has_edit_permission``: Optional. Function that accepts request and 
-        object and returns True if user is allowed to edit album for 
-        object and False otherwise. Default behaviour is to always 
-        return True.
-        
-        ``context_processors``: Optional. A list of callables that will be 
-        used as additional context_processors in each view    
+    '''        
+    Constructor parameters:
+    
+    ``instance_name``: String. Required. App instance name for url 
+    reversing. Must be unique.
+    
+    ``queryset``: QuerySet. Required. Albums will be attached to objects 
+    in this queryset.
+    
+    .. _custom_url_scheme:
+    
+    ``object_regex``: String. Optional, default is ``'\d+'``. It should be a 
+    URL regular expression for object in URL. You should use smth. 
+    like ``'[\w\d-]+'`` for slugs.
+    
+    ``lookup_field``: String. Optional, default is ``'pk'``. It is a field 
+    name to lookup. It may contain ``__`` and follow relations 
+    (ex.: ``userprofile__slug``).
+    
+    .. _app_name_param:
+    
+    ``app_name``: String. Optional, default value is ``'album'``. Used by url 
+    namespaces stuff.
+    
+    ``extra_context``: Dict. Optional. Extra context that will be passed 
+    to each view.
+   
+   .. _template_object_name:
+    
+    ``template_object_name``: String. Optional. The name of template 
+    context variable with object for which album is attached. 
+    Default is 'object'.
+    
+    ``has_edit_permission``: Optional. Function that accepts request and 
+    object and returns True if user is allowed to edit album for 
+    object and False otherwise. Default behaviour is to always 
+    return True.
+    
+    ``context_processors``: Optional. A list of callables that will be 
+    used as additional context_processors in each view.    
 
-        ``edit_form_class``: Optional. ModelForm subclass to be used in 
-        edit_image view
-        
-        ``upload_form_class``: Optional. ModelForm subclass to be used in 
-        upload_main_image view
-        
-        ``upload_formset_class``: Optional. ModelFormSet to be used in 
-        upload_images view
+    .. _edit_form_class:
+    
+    ``edit_form_class``: Optional, default is ``ImageEditForm`` (defined 
+    in ``photo_albums.forms`` module). ModelForm subclass to be used in 
+    edit_image view.
+    
+    .. _upload_form_class:
+    
+    ``upload_form_class``: Optional, default is ``AttachedImageForm`` (defined in 
+    ``generic_images.forms`` module). ModelForm subclass to be used in 
+    upload_main_image view.
+    
+    .. _upload_formset_class:
+    
+    ``upload_formset_class``: Optional, default is ``PhotoFormSet`` (defined in 
+    ``photo_albums.forms`` module). ModelFormSet to be used in upload_images view.
         
     '''