core.spaces — Spaces/Processes

spaces.admin — Administration

e-cidadania administration models for django-admin. This administration models will make their respective data models available for management.

class core.spaces.admin.EntityAdmin(admin.ModelAdmin)

Entities administration model.

List fields:name, website, space
Search fields:name
class core.spaces.admin.EntityInline(admin.TabularInline)

TabularInline view for entities.

model

alias of Entity

class core.spaces.admin.SpaceAdmin(admin.ModelAdmin)

Administration view for django admin to create spaces. The save() method is overriden to store automatically the author of the space.

List fields:name, description, date
Search fields:name
class core.spaces.admin.DocumentAdmin(admin.ModelAdmin)

Administration view to upload/modify documents. The save() method is overriden to store the author automatically.

List fields:title, space, docfile, author, pub_date
Search fields:title, space, author, pub_date
class core.spaces.admin.EventAdmin(admin.ModelAdmin)

Meetings administration model.

List fields:title, space, meeting_date
Search fields:title

spaces.models — Data models

class core.spaces.models.Space(models.Model)

Spaces model. This model stores a “space” or “place” also known as a participative process in reality. Every place has a minimum set of settings for customization.

class core.spaces.models.Entity(models.Model)

This model stores the name of the entities responsible for the creation of the space or supporting it.

class core.spaces.models.Document(models.Model)

This models stores documents for the space, like a document repository, There is no restriction in what a user can upload to the space

class core.spaces.models.Event(models.Model)

Meeting data model. Every space (process) has N meetings. This will keep record of the assistants, meeting name, etc.

spaces.forms — Forms

This module contains all the space related forms, including the forms for documents, meetings and entities. Most of the forms are directly generated from the data models.

class core.spaces.forms.SpaceForm(ModelForm)

Returns a form to create or edit a space. SpaceForm inherits all the fields from the Space data model.

Return type:HTML Form

New in version 0.1.

class core.spaces.forms.DocForm(ModelForm)

Returns a form to create or edit a space related document, based on the spaces.Document data model.

Return type:HTML Form

New in version 0.1.

class core.spaces.forms.EventForm(ModelForm)

Returns a form to create or edit a space related meeting, based on the spaces.Meeting data model.

Return type:HTML Form

New in version 0.1.

EntityFormSet — modelformset_factory

spaces.views — Views

These are the views that control the spaces, meetings and documents.

General spaces views

class core.spaces.views.ListPosts(ListView)

Returns a list with all the posts attached to that space. It’s similar to an archive, but without classification or filtering.

Return type:Object list
Context :post_list

Spaces views

class core.spaces.views.GoToSpace(RedirectView)

Sends the user to the selected space. This view only accepts GET petitions. GoToSpace is a django generic RedirectView.

Attributes :self.place - Selected space object
Return type:Redirect
class core.spaces.views.ListSpaces(ListView)

Return a list of spaces in the system (except private ones) using a generic view. The users associated to a private spaces will see it, but not the other private spaces. ListSpaces is a django generic ListView.

Return type:Object list
Contexts :object_list
class core.spaces.views.ViewSpaceIndex(DetailView)

Returns the index page for a space. The access to spaces is restricted and filtered in the get_object method. This view gathers information from all the configured modules in the space.

Attributes :space_object, place
Return type:Object
Context :get_place, entities, documents, proposals, publication
class core.spaces.views.DeleteSpace(DeleteView)

Returns a confirmation page before deleting the space object completely. This does not delete the space related content. Only the site administrators can delete a space.

Return type:Confirmation
core.spaces.views.edit_space(request, space_name)

Returns a form filled with the current space data to edit. Access to this view is restricted only to site and space administrators. The filter for space administrators is given by the edit_space permission and their belonging to that space.

Attributes :
  • place: current space intance.
  • form: SpaceForm instance.
  • form_uncommited: form instance before commiting to the DB, so we can modify the data.
Parameters:

space_name – Space URL

Return type:

HTML Form

Context :

form, get_place

core.spaces.views.create_space(request)

Returns a SpaceForm form to fill with data to create a new space. There is an attached EntityFormset to save the entities related to the space. Only site administrators are allowed to create spaces.

Attributes :
  • space_form: empty SpaceForm instance
  • entity_forms: empty EntityFormSet
Return type:

Space object, multiple entity objects.

Context :

form, entityformset

Document views

class core.spaces.views.ListDocs(ListView)

Returns a list of documents attached to the current space.

Return type:Object list
Context :object_list, get_place
class core.spaces.views.DeleteDocument(DeleteView)

Returns a confirmation page before deleting the current document.

Return type:Confirmation
Context :get_place
class core.spaces.views.AddDocument(FormView)

Upload a new document and attach it to the current space.

Return type:Object
Context :form, get_place
class core.spaces.views.EditDocument(UpdateView)

Returns a DocForm filled with the current document data.

Return type:HTML Form
Context :doc, get_place

Meeting views

class core.spaces.views.ListEvents(ListView)

List all the events attached to a space.

Return type:Object list
Context :event_list, get_place
class core.spaces.views.ViewEvent(DetailView)

View the content of a event.

Return type:Object
Context :event, get_place
class core.spaces.views.DeleteEvent(DeleteView)

Returns a confirmation page before deleting the Meeting object.

Return type:Confirmation
Context :get_place
class core.spaces.views.AddEvent(FormView)

Returns an empty MeetingForm to create a new Meeting. Space and author fields are automatically filled with the request data.

Return type:HTML Form
Context :form, get_place
class core.spaces.views.EditEvent(UpdateView)

Returns a MeetingForm filled with the current Meeting data to be edited.

Return type:HTML Form
Context :event, get_place