cc1  v2.1
CC1 source code docs
All Classes Namespaces Files Functions Variables Pages
src.clm.views.admin_clm.news Namespace Reference

Functions

def add
 Creates and saves new News.
def delete
 Deletes permanently specified News.
def edit
def get_by_id

Detailed Description

Note
All functions here are decorated by src.clm.utils.decorators.admin_clm_log. It's recommended to read src.clm.utils.decorators.admin_clm_log docs before using functions below.

Function Documentation

def src.clm.views.admin_clm.news.add (   cm_id,
  caller_id,
  topic = '',
  content = '',
  sticky = False 
)

Creates and saves new News.

Such a News appears on the Web Interface's home screen.

Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
topic(POST string)
content(POST string)
sticky(POST bool) whether the News should stay displayed long-term

Definition at line 54 of file news.py.

def src.clm.views.admin_clm.news.delete (   cm_id,
  caller_id,
  news_id 
)

Deletes permanently specified News.

Deleted News can i no way be recovered.

Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
news_id(POST int) id of the News to delete

Definition at line 77 of file news.py.

def src.clm.views.admin_clm.news.edit (   cm_id,
  caller_id,
  news_id,
  topic = None,
  content = None,
  sticky = None 
)
Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
news_id(POST int) id of the News to edit
topic(POST string) new topic of the News
content(POST string) new content of the News
sticky(POST bool) whether the News should stay displayed long-term

Definition at line 96 of file news.py.

def src.clm.views.admin_clm.news.get_by_id (   cm_id,
  caller_id,
  news_id 
)
Note
The clm.utils.decorators.admin_clm_log decorator performs CLMAdmin authentication. It also provides handling/logging mechanism for each Exception raised in view. see also: clm.utils.decorators.admin_clm_log
Parameters
http_request(HttpRequest)
cm_id(POST int) session cm_id
login(POST string)
admin_password(POST string)
news_id(POST)
Returns
HttpResponse with JSON content:
  • response: response status,
  • data: (dict) dict property of the requested News

Definition at line 39 of file news.py.