seshat.apps.core.views
Attributes
Classes
Create a new Capital. |
|
Delete a Capital. |
|
List all Capitals. |
|
Update a Capital. |
|
Create a new citation. |
|
Delete a citation. |
|
Display the details of a citation. |
|
List all citations. |
|
Update a citation. |
|
Create a new NGA. |
|
Show details of an NGA. |
|
List all NGAs. |
|
Update an NGA. |
|
List all NLP references. |
|
Create a new Polity. |
|
Show details of a polity. |
|
List all polities. |
|
List all polities. |
|
List all polities with comments. |
|
List all polities. |
|
List all polities. |
|
List all polities. |
|
Update a Polity. |
|
Create a new reference. |
|
Delete a reference. |
|
Display the details of a reference. |
|
List all references. |
|
Update a reference. |
|
List all religions. |
|
Create a new comment. |
|
Delete a comment. |
|
Display the details of a comment. |
|
List all comments. |
|
Create a new comment part. |
|
Create a new comment part. |
|
Delete a comment part. |
|
List all comment parts. |
|
List all comment parts. |
|
Update a comment part. |
|
Update a comment. |
|
Create a new private comment part. |
|
Update a private comment part. |
|
View to update a SeshatPrivateComment instance. |
Functions
|
Render the account activation sent page. |
|
Activate user account. |
|
Test if the request is an AJAX request. |
|
Assign the categorical variables to the shapes. |
|
Assign the absent/present variables to the shapes. |
|
Download all Capitals as CSV. |
|
|
|
Create a Comment and assign it to a model instance. |
|
Create the first chunk of a new comment and assign it to a model instance and a seshat comment. |
Create a PrivateComment and assign it to a model instance. |
|
|
Render the discussion room page. |
|
Process the results from the Zotero API. |
|
Process the results from the Zotero API. |
|
Download a CSV file containing all polities. |
|
Download a CSV file. |
|
Return a 404 error page. |
Get capital cities for polities that have them. |
|
|
Get or create a Citation instance. If a matching citation already exists, it |
|
Get the data for a single polity. The returned data includes the number of |
|
This function returns the polity shapes and other content for the map. |
|
Get all the province or country shapes for the map base layer. |
|
Returns a simple "Hello World" response. |
|
Return True if the request is an AJAX request, False otherwise. |
|
This view is used to display a map with polities plotted on it. The view |
|
This view is used to display a map with polities plotted on it. The view |
|
|
|
Render the NLP data points page. |
|
Render the NLP data points page. |
|
List all references without a Zotero link. |
|
This view returns the options for the polity filter. |
|
This view is used to get the provinces and countries for the map. |
|
This function is used to get a pseudo-random polity for the map_view_initial and map_view_initial views to display. |
|
Update a reference using a modal or a standalone page depending on the |
|
Download all references as a CSV file. |
|
Create a new religion. |
|
Update an existing religion. |
|
View to get search suggestions for a polity. |
|
View to search for a polity. |
|
Create a new comment part. |
|
Create a new comment part. |
Create a new private comment part. |
|
|
Return the Seshat "Acknowledgements" page. |
|
|
|
Return the Seshat "Codebook" page. |
|
View to create a SeshatComment instance. |
|
Create a new SeshatCommentPart instance. |
|
Create a new SeshatCommentPart instance. |
|
Render the Seshat landing page. |
|
Return the Seshat landing page. |
|
Return the Seshat "Methods" page. |
|
Return the Seshat "Downloads" page. |
|
Return the Seshat "Who We are" page. |
|
Handle user signup. |
|
Handle user signup follow-up. |
|
This function is used to sync the Zotero data with the database. |
|
This function is used to sync the Zotero data with the database. |
|
This function is used to manually input the references from the Zotero data |
|
This function takes all the references and build a citation for them. |
This function takes all the references and build a citation for them. |
|
|
View to update a SeshatCommentPart instance. |
|
Handle variable hierarchy setting. This is a view for the admin to set the |
|
Module Contents
- class seshat.apps.core.views.CapitalCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.CreateViewCreate a new Capital.
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'You successfully created a new Capital.'
- success_url
- template_name = 'core/capital/capital_form_create.html'
- class seshat.apps.core.views.CapitalDelete
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.DeleteViewDelete a Capital.
- model
- permission_required = 'core.add_capital'
- success_message = 'You successfully deleted one Capital.'
- success_url
- template_name = 'core/delete_general.html'
- class seshat.apps.core.views.CapitalListView
Bases:
django.views.generic.ListViewList all Capitals.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- model
- template_name = 'core/capital/capital_list.html'
- class seshat.apps.core.views.CapitalUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.UpdateViewUpdate a Capital.
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'You successfully updated the Capital.'
- success_url
- template_name = 'core/capital/capital_form.html'
- class seshat.apps.core.views.CitationCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.CreateViewCreate a new citation.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'Yoohoooo...'
- template_name = 'core/references/citation_form.html'
- class seshat.apps.core.views.CitationDelete
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.DeleteViewDelete a citation.
- model
- permission_required = 'core.add_capital'
- success_url
- template_name = 'core/delete_general.html'
- class seshat.apps.core.views.CitationDetailView
Bases:
django.views.generic.DetailViewDisplay the details of a citation.
- model
- template_name = 'core/references/citation_detail.html'
- class seshat.apps.core.views.CitationListView
Bases:
django.views.generic.ListViewList all citations.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- model
- paginate_by = 20
- template_name = 'core/references/citation_list.html'
- class seshat.apps.core.views.CitationUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.UpdateViewUpdate a citation.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'Yoohoooo...'
- template_name = 'core/references/citation_update.html'
- class seshat.apps.core.views.NgaCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new NGA.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_class
- model
- permission_required = 'core.add_capital'
- success_url
- template_name = 'core/nga/nga_form.html'
- class seshat.apps.core.views.NgaDetailView
Bases:
django.views.generic.DetailViewShow details of an NGA.
- model
- template_name = 'core/nga/nga_detail.html'
- class seshat.apps.core.views.NgaListView
Bases:
django.views.generic.ListViewList all NGAs.
- model
- template_name = 'core/nga/nga_list.html'
- class seshat.apps.core.views.NgaUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.UpdateViewUpdate an NGA.
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'You successfully updated the Nga.'
- success_url
- template_name = 'core/nga/nga_update.html'
- class seshat.apps.core.views.NlpReferenceListView
Bases:
django.views.generic.ListViewList all NLP references.
- get_absolute_url()
Return the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_queryset()
Return the queryset of NLP references.
- Returns:
The queryset of NLP references.
- Return type:
QuerySet
- model
- paginate_by = 50
- template_name = 'core/references/nlp_reference_list.html'
- class seshat.apps.core.views.PolityCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new Polity.
- form_invalid(form)
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_class
- model
- permission_required = 'core.add_capital'
- success_url
- template_name = 'core/polity/polity_form.html'
- class seshat.apps.core.views.PolityDetailView
Bases:
django.contrib.messages.views.SuccessMessageMixin,django.views.generic.DetailViewShow details of a polity.
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- get_object(queryset=None)
Get the object of the view.
- Parameters:
queryset – The queryset to use.
- Returns:
The object of the view.
- Return type:
- Raises:
Http404 – If no polity matches the given name.
Http404 – If multiple polities are found with the same name.
- model
- template_name = 'core/polity/polity_detail.html'
- class seshat.apps.core.views.PolityListView
Bases:
django.contrib.messages.views.SuccessMessageMixin,django.views.generic.ListViewList all polities.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- model
- template_name = 'core/polity/polity_list.html'
- class seshat.apps.core.views.PolityListView1
Bases:
django.contrib.messages.views.SuccessMessageMixin,django.views.generic.ListViewList all polities.
Note
This class is not used in the current implementation.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- model
- template_name = 'core/polity/polity_list.html'
- class seshat.apps.core.views.PolityListViewCommented
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.ListViewList all polities with comments.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- model
- permission_required = 'core.add_seshatprivatecommentpart'
- template_name = 'core/polity/polity_list_commented.html'
- class seshat.apps.core.views.PolityListViewLight
Bases:
django.contrib.messages.views.SuccessMessageMixin,django.views.generic.ListViewList all polities.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- model
- template_name = 'core/polity/polity_list_light.html'
- class seshat.apps.core.views.PolityListViewX
Bases:
django.contrib.messages.views.SuccessMessageMixin,django.views.generic.ListViewList all polities.
Note
This class is not used in the current implementation.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- model
- template_name = 'core/polity/polity_list.html'
- class seshat.apps.core.views.PolityListView_old
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.ListViewList all polities.
Note
This class is not used in the current implementation.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- model
- permission_required = 'core.add_capital'
- template_name = 'core/polity/polity_list.html'
- class seshat.apps.core.views.PolityUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.UpdateViewUpdate a Polity.
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- get_success_url()
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'You successfully updated the Polity.'
- template_name = 'core/polity/polity_form.html'
- class seshat.apps.core.views.ReferenceCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new reference.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- template_name = 'core/references/reference_form.html'
- class seshat.apps.core.views.ReferenceDelete
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.DeleteViewDelete a reference.
- model
- permission_required = 'core.add_capital'
- success_url
- template_name = 'core/delete_general.html'
- class seshat.apps.core.views.ReferenceDetailView
Bases:
django.views.generic.DetailViewDisplay the details of a reference.
- model
- template_name = 'core/references/reference_detail.html'
- class seshat.apps.core.views.ReferenceListView
Bases:
django.views.generic.ListViewList all references.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_queryset()
Get the queryset of references.
- Returns:
The queryset of references.
- Return type:
QuerySet
- model
- paginate_by = 100
- template_name = 'core/references/reference_list.html'
- class seshat.apps.core.views.ReferenceUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.UpdateViewUpdate a reference.
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- template_name = 'core/references/reference_update.html'
- class seshat.apps.core.views.ReligionListView
Bases:
django.views.generic.ListViewList all religions.
- context_object_name = 'religions'
- model
- ordering = ['religion_name']
- permission_required = 'core.add_seshatprivatecommentpart'
- template_name = 'core/religion_list.html'
- class seshat.apps.core.views.SeshatCommentCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new comment.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- form_class
- model
- permission_required = 'core.add_capital'
- template_name = 'core/seshatcomments/seshatcomment_form.html'
- class seshat.apps.core.views.SeshatCommentDelete
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.DeleteViewDelete a comment.
- model
- permission_required = 'core.add_capital'
- success_url
- template_name = 'core/delete_general.html'
- class seshat.apps.core.views.SeshatCommentDetailView
Bases:
django.views.generic.DetailViewDisplay the details of a comment.
- model
- template_name = 'core/seshatcomments/seshatcomment_detail.html'
- class seshat.apps.core.views.SeshatCommentListView
Bases:
django.views.generic.ListViewList all comments.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- model
- paginate_by = 20
- template_name = 'core/seshatcomments/seshatcomment_list.html'
- class seshat.apps.core.views.SeshatCommentPartCreate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new comment part.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- form_class
- model
- permission_required = 'core.add_capital'
- template_name = 'core/seshatcomments/seshatcommentpart_form.html'
- class seshat.apps.core.views.SeshatCommentPartCreate2
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new comment part.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- template_name = 'core/seshatcomments/seshatcommentpart_form_prefilled.html'
- class seshat.apps.core.views.SeshatCommentPartDelete
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.DeleteViewDelete a comment part.
- get_success_url()
- model
- permission_required = 'core.add_capital'
- template_name = 'core/delete_general.html'
- class seshat.apps.core.views.SeshatCommentPartDetailView
Bases:
django.views.generic.DetailView- model
- template_name = 'core/seshatcomments/seshatcommentpart_detail.html'
- class seshat.apps.core.views.SeshatCommentPartListView
Bases:
django.views.generic.ListViewList all comment parts.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- model
- paginate_by = 20
- template_name = 'core/seshatcomments/seshatcommentpart_list.html'
- class seshat.apps.core.views.SeshatCommentPartListView3
Bases:
django.views.generic.ListViewList all comment parts.
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- model
- paginate_by = 20
- template_name = 'core/seshatcomments/seshatcommentpart_list3.html'
- class seshat.apps.core.views.SeshatCommentPartUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.UpdateViewUpdate a comment part.
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- success_message = 'You successfully updated the subdescription.'
- template_name = 'core/seshatcomments/seshatcommentpart_update.html'
- class seshat.apps.core.views.SeshatCommentUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.UpdateViewUpdate a comment.
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_capital'
- template_name = 'core/seshatcomments/seshatcomment_update.html'
- class seshat.apps.core.views.SeshatPrivateCommentPartCreate2
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.CreateViewCreate a new private comment part.
- form_invalid(form)
Handle invalid form data.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- form_valid(form)
Validate the form.
- Parameters:
form (Form) – The form object.
- Returns:
The response object.
- Return type:
HttpResponse
- get_absolute_url()
Get the absolute URL of the view.
- Returns:
The absolute URL of the view.
- Return type:
str
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_seshatprivatecommentpart'
- template_name = 'core/seshatcomments/seshatprivatecommentpart_form_prefilled.html'
- class seshat.apps.core.views.SeshatPrivateCommentPartUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.contrib.messages.views.SuccessMessageMixin,django.views.generic.edit.UpdateViewUpdate a private comment part.
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- form_class
- model
- permission_required = 'core.add_seshatprivatecommentpart'
- success_message = 'You successfully updated the Private comment.'
- template_name = 'core/seshatcomments/seshatprivatecommentpart_update2.html'
- class seshat.apps.core.views.SeshatPrivateCommentUpdate
Bases:
django.contrib.auth.mixins.PermissionRequiredMixin,django.views.generic.edit.UpdateView,django.views.generic.edit.FormMixinView to update a SeshatPrivateComment instance.
- get_another_form(request, *args, **kwargs)
Return the data from another form in the SeshatPrivateCommentPartForm.
- Parameters:
request – The request object.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
The form instance.
- Return type:
- get_context_data(**kwargs)
Get the context data of the view.
- Noindex:
- Parameters:
**kwargs – Arbitrary keyword arguments.
- Returns:
The context data of the view.
- Return type:
dict
- post(request, *args, **kwargs)
Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.
- Parameters:
request – The request object.
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- form_class
- model
- permission_required = 'core.add_seshatprivatecommentpart'
- template_name = 'core/seshatcomments/seshatprivatecomment_update.html'
- seshat.apps.core.views.account_activation_sent(request)
Render the account activation sent page.
- seshat.apps.core.views.activate(request, uidb64, token)
Activate user account.
- Parameters:
request – The request object.
uidb64 – The user ID encoded in base64.
token – The token.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.ajax_test(request)
Test if the request is an AJAX request.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.assign_categorical_variables_to_shapes(shapes, variables)
Assign the categorical variables to the shapes.
Note
Currently only language and religion variables are implemented.
- Parameters:
shapes (list) – The shapes to assign the variables to.
variables (dict) – The variables to assign to the shapes.
- Returns:
A tuple containing the shapes and the variables.
- Return type:
tuple
- seshat.apps.core.views.assign_variables_to_shapes(shapes, app_map)
Assign the absent/present variables to the shapes.
- Parameters:
shapes (list) – The shapes to assign the variables to.
app_map (dict) – A dictionary mapping app names to their long names.
- Returns:
A tuple containing the shapes and the variables.
- Return type:
tuple
- seshat.apps.core.views.capital_download(request)
Download all Capitals as CSV.
Note
This view is only accessible to users with the ‘view_capital’ permission.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.cliopatria(request)
- seshat.apps.core.views.create_a_comment_with_a_subcomment_new(request, app_name, model_name, instance_id)
Create a Comment and assign it to a model instance.
Note
This view has the login_required decorator to ensure that only logged-in users can access it.
- Parameters:
request – The request object.
app_name – The name of the app containing the model.
model_name – The name of the model.
instance_id – The id of the model instance.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.create_a_comment_with_a_subcomment_newer(request, app_name, model_name, instance_id)
Create the first chunk of a new comment and assign it to a model instance and a seshat comment. Get the data on citations and do the appropriate assignments there as well.
- seshat.apps.core.views.create_a_private_comment_with_a_private_subcomment_new(request, app_name, model_name, instance_id)
Create a PrivateComment and assign it to a model instance.
Note
This view is only accessible to users with the ‘add_seshatprivatecommentpart’ permission.
- Parameters:
request – The request object.
app_name – The name of the app containing the model.
model_name – The name of the model.
instance_id – The id of the model instance.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.discussion_room(request)
Render the discussion room page.
- seshat.apps.core.views.do_zotero(results)
Process the results from the Zotero API.
- Parameters:
results – The results from the Zotero API.
- Returns:
A list of dictionaries containing the processed data.
- Return type:
list
- seshat.apps.core.views.do_zotero_manually(results)
Process the results from the Zotero API.
- Parameters:
results – The results from the Zotero API.
- Returns:
A list of dictionaries containing the processed data.
- Return type:
list
- seshat.apps.core.views.download_csv_all_polities(request)
Download a CSV file containing all polities.
Note
This view is restricted to users with the ‘view_capital’ permission.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.download_oldcsv(request, file_name)
Download a CSV file.
- Parameters:
request – The request object.
file_name (str) – The name of the file to download.
- Returns:
The file response.
- Return type:
FileResponse
- seshat.apps.core.views.four_o_four(request)
Return a 404 error page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.get_all_polity_capitals()
Get capital cities for polities that have them.
- Returns:
A dictionary containing the capital cities for polities.
- Return type:
dict
- seshat.apps.core.views.get_or_create_citation(reference, page_from, page_to)
Get or create a Citation instance. If a matching citation already exists, it is returned; otherwise, a new one is created.
- seshat.apps.core.views.get_polity_data_single(polity_id)
Get the data for a single polity. The returned data includes the number of records for each app (general, sc, wf, hs, cc, pt).
- Parameters:
polity_id – The ID of the polity.
- Returns:
The data for the polity.
- Return type:
dict
- seshat.apps.core.views.get_polity_shape_content(displayed_year='all', seshat_id='all', tick_number=80, override_earliest_year=None, override_latest_year=None, geometries=True)
This function returns the polity shapes and other content for the map. Only one of displayed_year or seshat_id should be set; not both.
Note
seshat_id in Cliopatria is new_name in Polity.
- Parameters:
displayed_year (str) – The year to display the polities for. “all” will return all polities. Any given year will return polities that were active in that year.
seshat_id (str) – The seshat_id of the polity to display. If a value is provided, only the shapes for that polity being returned.
- Returns:
The content for the polity shapes.
- Return type:
dict
- seshat.apps.core.views.get_provinces(selected_base_map_gadm='province')
Get all the province or country shapes for the map base layer.
- Parameters:
selected_base_map_gadm (str) – The selected base map GADM level.
- Returns:
A list of dictionaries containing the province or country shapes.
- Return type:
list
- seshat.apps.core.views.index(request)
Returns a simple “Hello World” response.
Note
This is a simple view to test the server. It is not part of the application.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.is_ajax(request)
Return True if the request is an AJAX request, False otherwise.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
True if the request is an AJAX request, False otherwise.
- Return type:
bool
- seshat.apps.core.views.map_view_all(request)
This view is used to display a map with polities plotted on it. The view loads all polities for the range of years.
- Parameters:
request – The request object.
- Returns:
The HTTP response with serialized JSON.
- Return type:
JsonResponse
- seshat.apps.core.views.map_view_all_with_vars(request)
This view is used to display a map with polities plotted on it. The view loads all polities for the range of years with added variables for each polity shape.
- Parameters:
request – The request object.
- Returns:
The HTTP response with serialized JSON.
- Return type:
JsonResponse
- seshat.apps.core.views.map_view_initial(request)
- seshat.apps.core.views.nlp_datapoints(request)
Render the NLP data points page.
- seshat.apps.core.views.nlp_datapoints_2(request)
Render the NLP data points page.
- seshat.apps.core.views.no_zotero_refs_list(request)
List all references without a Zotero link.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.polity_filter_options_view(request)
This view returns the options for the polity filter.
Note
The view is decorated with the require_GET decorator to ensure that only GET requests are allowed.
- Parameters:
request – The request object.
- Returns:
The JSON response.
- Return type:
JsonResponse
- seshat.apps.core.views.provinces_and_countries_view(request)
This view is used to get the provinces and countries for the map.
- Parameters:
request – The request object.
- Returns:
The HTTP response with serialized JSON.
- Return type:
JsonResponse
- seshat.apps.core.views.random_polity_shape(from_selection=True)
This function is used to get a pseudo-random polity for the map_view_initial and map_view_initial views to display. It selects a polity with a large area and which has a seshat_id.
If from_selection is true, choose a polity from a pre-approved list. TODO: if the loading time of map_view_initial becomes sufficiently fast, we could set from_selection to False.
- Returns:
A tuple containing the start year and seshat_id.
- Return type:
tuple
- seshat.apps.core.views.reference_update_modal(request, pk)
Update a reference using a modal or a standalone page depending on the request.
- Parameters:
request (HttpRequest) – The request object.
pk (int) – The primary key of the reference.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.references_download(request)
Download all references as a CSV file.
Note
This view is only accessible to users with the ‘view_capital’ permission.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.religion_create(request)
Create a new religion.
Note
This view is only accessible to users with the ‘add_seshatprivatecommentpart’ permission.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.religion_update(request, pk)
Update an existing religion.
Note
This view is only accessible to users with the ‘add_seshatprivatecommentpart’ permission.
- Parameters:
request (HttpRequest) – The request object.
pk (int) – The primary key of the religion.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.search_suggestions(request)
View to get search suggestions for a polity.
Note
This view can handle GET requests.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.search_view(request)
View to search for a polity.
Note
This view can handle GET requests.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.seshat_comment_part_create_from_null_view(request, com_id, subcom_order)
Create a new comment part.
Note
This view is only accessible to users with the ‘add_capital’ permission.
- Parameters:
request (HttpRequest) – The request object.
com_id (int) – The primary key of the comment.
subcom_order (int) – The order of the comment part.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshat_comment_part_create_from_null_view_OLD(request, com_id, subcom_order)
Create a new comment part.
Note
This function is not used in the current implementation. This view is only accessible to users with the ‘add_capital’ permission.
- Parameters:
request (HttpRequest) – The request object.
com_id (int) – The primary key of the comment.
subcom_order (int) – The order of the comment part.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshat_comment_part_create_from_null_view_inline(request, app_name, model_name, instance_id)
- seshat.apps.core.views.seshat_private_comment_part_create_from_null_view(request, private_com_id)
Create a new private comment part.
Note
This view is only accessible to users with the ‘add_seshatprivatecommentpart’ permission.
- Parameters:
request (HttpRequest) – The request object.
private_com_id (int) – The primary key of the private comment.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatacknowledgements(request)
Return the Seshat “Acknowledgements” page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatcodebooknew1(request)
- seshat.apps.core.views.seshatcodebookold(request)
Return the Seshat “Codebook” page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatcomment_create_view(request)
View to create a SeshatComment instance.
Note
This view can handle POST and GET requests.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatcommentpart_create_view(request)
Create a new SeshatCommentPart instance.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatcommentpart_create_view_old(request)
Create a new SeshatCommentPart instance.
Note
The old view of the SeshatCommentPart creation is not currently used in the application.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatindex(request)
Render the Seshat landing page.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatindex2(request)
Return the Seshat landing page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatmethods(request)
Return the Seshat “Methods” page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatolddownloads(request)
Return the Seshat “Downloads” page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.seshatwhoweare(request)
Return the Seshat “Who We are” page.
- Parameters:
request (HttpRequest) – The request object.
- Returns:
The response object.
- Return type:
HttpResponse
- seshat.apps.core.views.signup_traditional(request)
Handle user signup.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.signupfollowup(request)
Handle user signup follow-up.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.synczotero(request)
This function is used to sync the Zotero data with the database.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.synczotero100(request)
This function is used to sync the Zotero data with the database.
Note
This function syncs only 100 references.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.synczoteromanually(request)
This function is used to manually input the references from the Zotero data available in the manual_input_refs.py file into the database.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.update_citations(request)
This function takes all the references and build a citation for them.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.update_citations_from_inside_zotero_update()
This function takes all the references and build a citation for them.
- Parameters:
None
- Returns:
None
- seshat.apps.core.views.update_seshat_comment_part_view(request, pk)
View to update a SeshatCommentPart instance.
Note
This view can handle POST and GET requests.
- Parameters:
request – The request object.
pk – The primary key of the SeshatCommentPart instance.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.variablehierarchysetting(request)
Handle variable hierarchy setting. This is a view for the admin to set the variable hierarchy.
- Parameters:
request – The request object.
- Returns:
The HTTP response.
- Return type:
HttpResponse
- seshat.apps.core.views.xxyyzz(request, com_id)
- seshat.apps.core.views.POLITY_RELIGIOUS_TRADITION_CHOICES
- seshat.apps.core.views.app_map
- seshat.apps.core.views.categorical_variables
- seshat.apps.core.views.world_map_initial_displayed_year = 117
- seshat.apps.core.views.world_map_initial_polity = 'it_roman_principate'