1. Maciej Wiśniowski
  2. django-photo-albums

Commits

Mikhail Korobov  committed 8d09082

small changes in documentation

  • Participants
  • Parent commits 5a433b5
  • Branches default

Comments (0)

Files changed (5)

File docs/_build/doctrees/environment.pickle

  • Ignore whitespace
Binary file modified.

File docs/_build/doctrees/index.doctree

  • Ignore whitespace
Binary file modified.

File docs/_build/html/index.html

View file
  • Ignore whitespace
 <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 0x1a1bb70&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>
+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>
 <p><tt class="docutils literal"><span class="pre">instance_name</span></tt>: String. Required. App instance name for url 
 reversing. Must be unique.</p>
 </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 for use with PhotoAlbumSite.</p>
+<p>Views used by PhotoAlbumSite.</p>
 <dl class="attribute">
 <dt id="photo_albums.views.clear_main_image">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">clear_main_image</tt><a class="headerlink" href="#photo_albums.views.clear_main_image" title="Permalink to this definition">¶</a></dt>
-<dd>mark image as not main and redirect to <tt class="docutils literal"><span class="pre">show_image</span></tt> view</dd></dl>
+<dd>Mark image as not main and redirect to <tt class="docutils literal"><span class="pre">show_image</span></tt> view</dd></dl>
 
 <dl class="attribute">
 <dt id="photo_albums.views.delete_image">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">delete_image</tt><a class="headerlink" href="#photo_albums.views.delete_image" title="Permalink to this definition">¶</a></dt>
-<dd>delete image if request method is POST, displays 
+<dd>Delete image if request method is POST, displays 
 <tt class="docutils literal"><span class="pre">confirm_delete.html</span></tt> template otherwise</dd></dl>
 
 <dl class="attribute">
 <dt id="photo_albums.views.edit_album">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">edit_album</tt><a class="headerlink" href="#photo_albums.views.edit_album" title="Permalink to this definition">¶</a></dt>
-<dd>same as <tt class="docutils literal"><span class="pre">show_album</span></tt> view but with login_required decorator</dd></dl>
+<dd>Show album for object using edit_album.html template, with permission checks.</dd></dl>
 
 <dl class="attribute">
 <dt id="photo_albums.views.edit_image">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">edit_image</tt><a class="headerlink" href="#photo_albums.views.edit_image" title="Permalink to this definition">¶</a></dt>
-<dd>show one image, use login_required decorator and provide edit form</dd></dl>
+<dd>Show one image. Checks permissions and provides edit form.</dd></dl>
 
 <dl class="attribute">
 <dt id="photo_albums.views.set_as_main_image">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">set_as_main_image</tt><a class="headerlink" href="#photo_albums.views.set_as_main_image" title="Permalink to this definition">¶</a></dt>
-<dd>mark image as main and redirect to <tt class="docutils literal"><span class="pre">show_image</span></tt> view</dd></dl>
+<dd>Mark image as main and redirect to <tt class="docutils literal"><span class="pre">show_image</span></tt> view</dd></dl>
 
 <dl class="function">
 <dt id="photo_albums.views.show_album">
 <dl class="function">
 <dt id="photo_albums.views.show_image">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">show_image</tt><big>(</big><em>request</em>, <em>object_id</em>, <em>image_id</em>, <em>album_site</em><big>)</big><a class="headerlink" href="#photo_albums.views.show_image" title="Permalink to this definition">¶</a></dt>
-<dd>show one image</dd></dl>
+<dd>Show one image</dd></dl>
 
 <dl class="attribute">
 <dt id="photo_albums.views.upload_images">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">upload_images</tt><a class="headerlink" href="#photo_albums.views.upload_images" title="Permalink to this definition">¶</a></dt>
-<dd>upload several images at once</dd></dl>
+<dd>Upload several images at once</dd></dl>
 
 <dl class="attribute">
 <dt id="photo_albums.views.upload_main_image">
 <tt class="descclassname">photo_albums.views.</tt><tt class="descname">upload_main_image</tt><a class="headerlink" href="#photo_albums.views.upload_main_image" title="Permalink to this definition">¶</a></dt>
-<dd>upload 1 image and make it main image in gallery</dd></dl>
+<dd>Upload 1 image and make it main image in gallery</dd></dl>
 
 </div>
 </div>

File docs/_build/html/searchindex.js

View file
  • Ignore whitespace
-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,permiss:0,follow:0,"0x1a1caf0":[],regular:0,paramet:0,redirect:0,note:0,photo_album:0,depend:0,thank:0,easi:0,extra: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,test_util: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,subclass:0,object_regex: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,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:[],avail:0,differ:0,becom:0,from:0,generic_imag:0,show_album:0,current_app:0,submit:0,next:0,template_nam: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,name: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,rais:0,fixtur:0,app_nam:0,overrid:0,"0x1a14af0":[],edit_form_class:0,login_requir:0,creat:0,"0x1a1bb70":0,can:0,queryset:0,ani:0,accept:0,need:0,tag:0,smth:0,file:[],tabl:0,pip:0,exist:0,django:0,dedic:0,sever:0,alwai:0,decor:0,tou:0,multipl:0,form:0,want:0,vasia:0,perform:0,media:[],make:0,same:0,check:0,attachedimageform:0,field:0,other:0,lookup:0,"__init__":[],indic:[],test:0,instead:0,photoformset:0,document:0,album_sit:0,complet:0,variabl:0,all:0,relat:0,http:0,context:0,usernam:0,clone:0,previou:0,image_in_album_id:0,galleri:0,label_suffix:[],action:0,edit_album:0,album_us:0,userprofile__slug:0,deploi:0,mai:0,necesseri:0,lookup_field:0,data:0,"class":0,welcom:[],svn:0,my_object_slug:0,bitbucket:0,don:0,context_processor:0,url:0,test_auth_view:0,request:0,rule:0,exclud:0,mark:0,which:0,write:0,allow:0,you: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,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"]})

File photo_albums/views.py

View file
  • Ignore whitespace
 '''
-Views for use with PhotoAlbumSite. 
+Views used by PhotoAlbumSite. 
 '''
 
 from django.conf import settings
     
     images = AttachedImage.objects.for_model(object)
     context.update({'images': images})
+    
     return render_to_response(_get_template_names(object, template_name), 
                               context,
                               context_instance=RequestContext(request, processors=album_site.context_processors),
 
 @login_required
 def edit_album(request, object_id, album_site, template_name='edit_album.html'):
-    ''' same as ``show_album`` view but with login_required decorator '''
+    ''' Show album for object using edit_album.html template, with permission checks. '''
     
     object, context = album_site.get_object_and_context(object_id)
     album_site.check_permissions(request, object)
     
 @login_required
 def upload_main_image(request, object_id, album_site):    
-    ''' upload 1 image and make it main image in gallery '''
+    ''' Upload 1 image and make it main image in gallery '''
     
     object, context = album_site.get_object_and_context(object_id)
     album_site.check_permissions(request, object)
 
 @login_required
 def upload_images(request, object_id, album_site):    
-    ''' upload several images at once '''
+    ''' Upload several images at once '''
     
     object, context = album_site.get_object_and_context(object_id)
     album_site.check_permissions(request, object)
 
 
 def show_image(request, object_id, image_id, album_site):
-    '''  show one image '''
+    '''  Show one image '''
     
     object, context = album_site.get_object_and_context(object_id)        
     context.update(_one_image_context(image_id, object))
 
 @login_required
 def edit_image(request, object_id, image_id, album_site): 
-    ''' show one image, use login_required decorator and provide edit form '''   
+    ''' Show one image. Checks permissions and provides edit form. '''   
     
     object, context = album_site.get_object_and_context(object_id)
     album_site.check_permissions(request, object)
 
 @login_required
 def delete_image(request, object_id, image_id, album_site):
-    ''' delete image if request method is POST, displays 
+    ''' Delete image if request method is POST, displays 
         ``confirm_delete.html`` template otherwise 
     '''
     object, context = album_site.get_object_and_context(object_id)
     
 @login_required
 def set_as_main_image(request, object_id, image_id, album_site):
-    ''' mark image as main and redirect to ``show_image`` view '''
+    ''' Mark image as main and redirect to ``show_image`` view '''
     object, context = album_site.get_object_and_context(object_id)
     album_site.check_permissions(request, object)
     
     
 @login_required
 def clear_main_image(request, object_id, image_id, album_site):
-    ''' mark image as not main and redirect to ``show_image`` view '''
+    ''' Mark image as not main and redirect to ``show_image`` view '''
     object, context = album_site.get_object_and_context(object_id)
     album_site.check_permissions(request, object)