def articleUnderArchive(request,year,month): queryset=articles.objects.filter(publishTime__year=year,publishTime__month=month,type='article').order_by('-publishTime') search_fields = ['title'] return get_datatables_records( request, queryset, search_fields, 'themes/'+getBlogTheme()+'/archive.html', extra_context={ 'year':year, 'month':month } )
def getTagList(request, template_name): queryset=tags.objects.order_by('-actionLatest') search_fields = ['name'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'page_title':_('Tag List'), 'search_url':reverse('gettaglist'), 'search_field':_('Tag Name') } )
def getFileList(request, template_name): queryset=blogFiles.objects.order_by('-uploadTime') search_fields = ['filename'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'page_title':_('File List'), 'search_url':reverse('getfilelist'), 'search_field':_('Filename') } )
def getCategoryList(request, template_name): queryset=categories.objects.all() search_fields = ['name','url'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'page_title':_('Category List'), 'search_url':reverse('getcategorylist'), 'search_field':_('Category Name') } )
def getLinkList(request, template_name): queryset=links.objects.all() search_fields = ['name','url'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'page_title':_('Link List'), 'search_url':reverse('getlinklist'), 'search_field':_('Name,Url') } )
def getPageList(request, template_name): queryset=articles.objects.filter(type='page').order_by('-publishTime') search_fields = ['title'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'page_title':_('Page List'), 'search_url':reverse('getpagelist'), 'search_field':_('Title') } )
def getCommentList(request, template_name): queryset = comments.objects.filter(status="Enabled").order_by("-submitTime") search_fields = [] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ "commentsStatus": commentsStatus, "tstatus": _("Status"), "page_title": _("Comment List"), "search_url": reverse("getcommentlist"), "search_field": _("Content"), }, )
def getArticleList(request, template_name): queryset=articles.objects.filter(type='article').order_by('-publishTime') if request.user.get_user_role() == 'writer': queryset = queryset.filter(author=request.user) search_fields = ['title'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'page_title':_('Article List'), 'search_url':reverse('getarticlelist'), 'search_field':_('Title') } )
def getUserList(request, template_name): queryset=User.objects.all() search_fields = ['username','email'] return get_datatables_records( request, queryset, search_fields, template_name, extra_context={ 'userRole':userRole, 'userStatus':userStatus, 'tstatus':_('Status'), 'page_title':_('User List'), 'search_url':reverse('getuserlist'), 'search_field':_('Username,Email') } )
def articleUnderTag(request,tslug): try: ttag = tags.objects.get(name=tslug) queryset=articles.objects.filter(tags=ttag,type='article').order_by('-publishTime') search_fields = ['title'] return get_datatables_records( request, queryset, search_fields, 'themes/'+getBlogTheme()+'/tag.html', extra_context={ 'tag':ttag } ) except tags.DoesNotExist: return render_to_response( 'themes/'+getBlogTheme()+'/tag.html', {'message':_('Tag does not exist.')}, context_instance=RequestContext(request) )
def articleUnderCategory(request,tslug): try: tcategory = categories.objects.get(slug=tslug) queryset=articles.objects.filter(categories=tcategory,type='article').order_by('-publishTime') search_fields = ['title'] return get_datatables_records( request, queryset, search_fields, 'themes/'+getBlogTheme()+'/category.html', extra_context={ 'category':tcategory } ) except categories.DoesNotExist: return render_to_response( 'themes/'+getBlogTheme()+'/category.html', {'message':_('Category does not exist.')}, context_instance=RequestContext(request) )