##// END OF EJS Templates
Added post versions to list request, changed list request to include additional attributes
Added post versions to list request, changed list request to include additional attributes

File last commit:

r1419:b30b6ad2 default
r1571:7712a723 default
Show More
mixins.py
40 lines | 1019 B | text/x-python | PythonLexer
neko259
Show max file size in the posting templates
r1396 import boards
neko259
Views refactoring
r900 PARAM_NEXT = 'next'
neko259
Moved tag subscribe and unsubscribe methods to the tag view. Added a...
r563 PARAMETER_METHOD = 'method'
class DispatcherMixin:
"""
This class contains a dispather method that can run a method specified by
'method' request parameter.
"""
neko259
Added ability to hide a post
r1366 def __init__(self):
self.user = None
neko259
Added post admin page with tags edit capability
r566 def dispatch_method(self, *args, **kwargs):
request = args[0]
neko259
Added ability to hide a post
r1366 self.user = request.user
neko259
Added post admin page with tags edit capability
r566 method_name = None
neko259
Moved tag subscribe and unsubscribe methods to the tag view. Added a...
r563 if PARAMETER_METHOD in request.GET:
method_name = request.GET[PARAMETER_METHOD]
neko259
Added post admin page with tags edit capability
r566 elif PARAMETER_METHOD in request.POST:
method_name = request.POST[PARAMETER_METHOD]
neko259
Moved tag subscribe and unsubscribe methods to the tag view. Added a...
r563
neko259
Added post admin page with tags edit capability
r566 if method_name:
return getattr(self, method_name)(*args, **kwargs)
neko259
Show max file size in the posting templates
r1396
class FileUploadMixin:
def get_max_upload_size(self):
return boards.settings.get_int('Forms', 'MaxFileSize')
neko259
Added tag gallery
r1419
class PaginatedMixin:
def set_page_urls(self, paginator, params):
params['prev_page_link'] = paginator.get_prev_page_url()
params['next_page_link'] = paginator.get_next_page_url()