endi.views.workshops package

Submodules

endi.views.workshops.export module

class endi.views.workshops.export.CaeWorkshopCsvView(*args, **kwargs)

Bases : WorkshopCsvView

cae Workshop csv export view

dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

request: Request
session: ISession
class endi.views.workshops.export.CaeWorkshopOdsView(*args, **kwargs)

Bases : WorkshopOdsView

cae Workshop ods export view

dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

request: Request
session: ISession
class endi.views.workshops.export.CaeWorkshopXlsView(*args, **kwargs)

Bases : WorkshopXlsView

cae Workshop xls export view

dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

request: Request
session: ISession
class endi.views.workshops.export.CompanyWorkshopCsvView(*args, **kwargs)

Bases : WorkshopCsvView

company Workshop csv export view

dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

request: Request
session: ISession
class endi.views.workshops.export.CompanyWorkshopOdsView(*args, **kwargs)

Bases : WorkshopOdsView

company Workshop ods export view

dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

request: Request
session: ISession
class endi.views.workshops.export.CompanyWorkshopXlsView(*args, **kwargs)

Bases : WorkshopXlsView

company Workshop xls export view

dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

request: Request
session: ISession
class endi.views.workshops.export.WorkshopCsvView(*args, **kwargs)

Bases : WorkshopListTools, BaseCsvView

Workshop csv export view

dbsession: DBSESSION
property filename

To be implemented by the subclass

request: Request
session: ISession
writer

alias de WorkshopCsvWriter

class endi.views.workshops.export.WorkshopCsvWriter(**kw)

Bases : CsvExporter

headers = ({'name': 'date', 'label': 'Date'}, {'name': 'label', 'label': 'Intitulé'}, {'name': 'name', 'label': 'Nom'}, {'name': 'role', 'label': 'Rôle'}, {'name': 'duration', 'label': 'Durée'}, {'name': 'attended', 'label': 'Participation'}, {'name': 'info1', 'label': 'Action 1'}, {'name': 'info2', 'label': 'Action 2'}, {'name': 'info3', 'label': 'Action 3'})
class endi.views.workshops.export.WorkshopOdsView(*args, **kwargs)

Bases : WorkshopCsvView

Workshop ods export view

dbsession: DBSESSION
property filename

To be implemented by the subclass

request: Request
session: ISession
writer

alias de WorkshopOdsWriter

class endi.views.workshops.export.WorkshopOdsWriter(title=None, **kw)

Bases : OdsExporter

headers = ({'name': 'date', 'label': 'Date'}, {'name': 'label', 'label': 'Intitulé'}, {'name': 'name', 'label': 'Nom'}, {'name': 'role', 'label': 'Rôle'}, {'name': 'duration', 'label': 'Durée'}, {'name': 'attended', 'label': 'Participation'}, {'name': 'info1', 'label': 'Action 1'}, {'name': 'info2', 'label': 'Action 2'}, {'name': 'info3', 'label': 'Action 3'})
class endi.views.workshops.export.WorkshopXlsView(*args, **kwargs)

Bases : WorkshopCsvView

Workshop excel export view

dbsession: DBSESSION
property filename

To be implemented by the subclass

request: Request
session: ISession
writer

alias de WorkshopXlsWriter

class endi.views.workshops.export.WorkshopXlsWriter(guess_types=True, **kw)

Bases : XlsExporter

headers = ({'name': 'date', 'label': 'Date'}, {'name': 'label', 'label': 'Intitulé'}, {'name': 'name', 'label': 'Nom'}, {'name': 'role', 'label': 'Rôle'}, {'name': 'duration', 'label': 'Durée'}, {'name': 'attended', 'label': 'Participation'}, {'name': 'info1', 'label': 'Action 1'}, {'name': 'info2', 'label': 'Action 2'}, {'name': 'info3', 'label': 'Action 3'})
endi.views.workshops.export.includeme(config)
endi.views.workshops.export.stream_workshop_entries_for_export(query)

Stream workshop datas for csv export

endi.views.workshops.lists module

class endi.views.workshops.lists.BaseWorkshopListView(*args, **kwargs)

Bases : WorkshopListTools, BaseListView

add_template_vars = ('is_admin_view', 'is_edit_view', 'is_company', 'stream_actions', 'current_user_id')
property current_user_id
dbsession: DBSESSION
is_admin_view = True
is_company = False
is_edit_view = True
request: Request
session: ISession
signout_label = 'Me désincrire'
signup_label = "M'inscrire"
stream_actions(workshop)
class endi.views.workshops.lists.CaeWorkshopListView(*args, **kwargs)

Bases : BaseWorkshopListView

CAE Workshop list view

Accompagnement -> Ateliers

add_template_vars = ('is_admin_view', 'is_edit_view', 'is_company', 'stream_actions', 'current_user_id', 'route_name_root')
dbsession: DBSESSION
request: Request
route_name_root = 'cae_workshops{file_format}'
schema = <endi.forms.lists.BaseListsSchema object at 140624044266704 (named )>
session: ISession
title = 'Tous les ateliers de la CAE'
class endi.views.workshops.lists.CompanyWorkshopListView(*args, **kwargs)

Bases : BaseWorkshopListView

View for listing company’s workshops dedicated to EA and ES training roles

Outils métiers -> Organisation d’ateliers

add_template_vars = ('is_admin_view', 'is_edit_view', 'is_company', 'stream_actions', 'current_user_id', 'current_users', 'company_id')
property company_id
property current_user_id
property current_users
dbsession: DBSESSION
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

is_company = True
request: Request
schema = <endi.forms.lists.BaseListsSchema object at 140624043780176 (named )>
session: ISession
stream_actions(workshop)
title = "Organisation d'ateliers"
class endi.views.workshops.lists.CompanyWorkshopSubscribedListView(*args, **kwargs)

Bases : BaseWorkshopListView

View for listing company’s user participant to workshops dedicated to EA role

Gestion -> Mes inscriptions

add_template_vars = ('is_admin_view', 'is_edit_view', 'current_users', 'stream_actions')
property current_user_id
property current_users
dbsession: DBSESSION
filter_participant(query, appstruct)
is_admin_view = False
is_edit_view = False
request: Request
schema = <endi.forms.lists.BaseListsSchema object at 140624043781968 (named )>
session: ISession
stream_actions(workshop)
title = "Ateliers auxquels un des membres de l'enseigne est inscrit"
class endi.views.workshops.lists.UserWorkshopSubscribedListView(*args, **kwargs)

Bases : UserWorkshopSubscriptionsListView

View for listing user’s workshops as participant dedicated to EA role

Gestion sociale -> Accompagnement -> Ateliers

dbsession: DBSESSION
filter_participant(query, appstruct)
request: Request
schema = <endi.forms.lists.BaseListsSchema object at 140624045756624 (named )>
session: ISession
signout_label = "Désinscrire l'utilisateur"
signup_label = "Inscrire l'utilisateur"
stream_actions(workshop)
property title

str(object=””) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to “strict”.

class endi.views.workshops.lists.UserWorkshopSubscriptionsListView(*args, **kwargs)

Bases : BaseWorkshopListView

User workshops subscriptions listing view « Mes inscriptions »

List :
  • user’s workshops

  • open workshops

Ateliers

add_template_vars = ('is_admin_view', 'is_edit_view', 'current_users', 'stream_actions', 'current_user_id')
property current_user_id
property current_users
dbsession: DBSESSION
filter_participant(query, appstruct)
is_admin_view = False
is_edit_view = False
request: Request
schema = <endi.forms.lists.BaseListsSchema object at 140624045733520 (named )>
session: ISession
title = 'Mes inscriptions'
class endi.views.workshops.lists.WorkshopListTools

Bases : object

Tools for listing workshops

default_direction = 'desc'
default_sort = 'datetime'
filter_company_manager_or_cae(query, appstruct)

Show all workshops or only CAE workshops (workshops wihtout company name)

filter_date(query, appstruct)
filter_info_1_id(query, appstruct)
filter_notfilled(query, appstruct)

Filter the workshops for which timeslots have not been filled

filter_participant(query, appstruct)
filter_tags(query, appstruct)
filter_trainer(query, appstruct)
query()
schema = <endi.forms.lists.BaseListsSchema object at 140624043774864 (named )>
sort_columns = {'datetime': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
title = 'Liste des ateliers'
class endi.views.workshops.lists.WorkshopListView(*args, **kwargs)

Bases : BaseWorkshopListView

All Workshop listing view for EA

Formations -> Ateliers

add_template_vars = ('is_admin_view', 'is_edit_view', 'is_company', 'stream_actions', 'current_user_id', 'route_name_root')
dbsession: DBSESSION
request: Request
route_name_root = 'workshops{file_format}'
session: ISession
title = 'Tous les ateliers'
endi.views.workshops.lists.includeme(config)

endi.views.workshops.workshop module

Workshop related views

class endi.views.workshops.workshop.WorkShopDuplicateView(context, request=None)

Bases : DuplicateView

Workshop duplication view

dbsession: DBSESSION
message = 'Vous avez été redirigé vers le nouvel atelier'
request: Request
route_name = 'workshop'
session: ISession
class endi.views.workshops.workshop.WorkshopAddView(context, request=None)

Bases : BaseFormView

View for adding workshop

before(form)

Performs some processing on the form prior to rendering.

By default, this method does nothing. Override this method in your dervived class to modify the form. Your function will be executed immediately after instansiating the form instance in __call__() (thus before obtaining widget resources, considering buttons, or rendering).

dbsession: DBSESSION
request: Request
schema = <endi.forms.workshop.WorkshopSchema object at 140624501225808 (named )>

Colander schema instance to be used to create the form instance. Provide your schema in your derived class.

session: ISession
submit_success(appstruct)

Create a new workshop

title = 'Créer un nouvel atelier'
class endi.views.workshops.workshop.WorkshopEditView(context, request=None)

Bases : BaseFormView

Workshop edition view

Provide edition functionnality and display a form for attendance recording

add_template_vars = ('title', 'available_status')
property available_status
before(form)

Populate the form before rendering

form

The deform form object used in this form view (see parent class in pyramid_deform)

dbsession: DBSESSION
request: Request
schema = <endi.forms.workshop.WorkshopSchema object at 140624501225808 (named )>

Colander schema instance to be used to create the form instance. Provide your schema in your derived class.

session: ISession
submit_success(appstruct)

Handle successfull submission of our edition form

property title
endi.views.workshops.workshop.add_routes(config)

Add module’s related routes

endi.views.workshops.workshop.add_tree_to_navigation(request)

Add elements in the actionmenu regarding the current context

endi.views.workshops.workshop.add_views(config)
endi.views.workshops.workshop.get_default_timeslots()

Return default timeslots for workshop creation

endi.views.workshops.workshop.get_new_datetime(now, hour, minute=0)

Return a new datetime object based on the “now” element

hour

The hour we’d like to set

minute

The minute value we want to set (default 0)

endi.views.workshops.workshop.includeme(config)

Add view to the pyramid registry

endi.views.workshops.workshop.record_attendances_view(context, request)

Record attendances for the given context (workshop)

Special Note : Since we need a special layout in the form (with tabs and lines with the username as header, we can’t render it with deform. We use peppercorn’s parser and we build an appropriate form in the template

endi.views.workshops.workshop.timeslot_pdf_view(timeslot, request)

Return a pdf attendance sheet for the given timeslot

timeslot

A timeslot object returned as a current context by traversal

endi.views.workshops.workshop.timeslots_pdf_output(timeslots, workshop, request)

write the pdf output of an attendance sheet to the current request response

timeslots

The timeslots to render in the attendance sheet (one timeslot = one column)

workshop

The workshop object

request

The current request object

endi.views.workshops.workshop.workshop_delete_view(workshop, request)

Workshop deletion view

endi.views.workshops.workshop.workshop_pdf_view(workshop, request)

Return a pdf attendance sheet for all the timeslots of the given workshop

workshop

A workshop object returned as a current context by traversal

endi.views.workshops.workshop.workshop_signout_view(workshop, request)

Self-service user signout from a workshop.

endi.views.workshops.workshop.workshop_signup_view(workshop, request)

User signup service

Current user subscribe to a workshop (himself or user_id argument)

endi.views.workshops.workshop.workshop_view(workshop, request)

Workshop view_only view

workshop

the context returned by the traversal tree

Module contents

endi.views.workshops.includeme(config)