diff options
Diffstat (limited to 'archaeological_context_records')
5 files changed, 9 insertions, 92 deletions
diff --git a/archaeological_context_records/data_importer.py b/archaeological_context_records/data_importer.py deleted file mode 100644 index 5fdc67949..000000000 --- a/archaeological_context_records/data_importer.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. - -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# See the file COPYING for details. - -from ishtar_common.data_importer import * - -from archaeological_context_records import models - - -class ContextRecordsImporterBibracte(Importer): - DESC = u"Exports Bibracte : importeur pour l'onglet UE" - OBJECT_CLS = models.ContextRecord - DEFAULTS = {} - LINE_FORMAT = [ - # ID operation - ImportFormater('operation__operation_code', IntegerFormater(), - duplicate_fields=[('parcel__operation__operation_code', - False)]), - # ID UE - ImportFormater('external_id', UnicodeFormater(120), - duplicate_fields=[('label', False)],), - # Type - ImportFormater('unit', TypeFormater(models.Unit), required=False), - # description - ImportFormater('description', UnicodeFormater(1000), required=False,), - # interprétation - ImportFormater('interpretation', UnicodeFormater(1000), - required=False,), - # date ouverture - ImportFormater('opening_date', DateFormater(['%Y/%m/%d']), - required=False,), - # date fermeture - ImportFormater('closing_date', DateFormater(['%Y/%m/%d']), - required=False,), - # lien vers parcelle - ImportFormater('parcel__external_id', UnicodeFormater(12), - required=False,), - # lien vers ID sig - None, - # commentaire - ImportFormater('comment', UnicodeFormater(1000), required=False,), - # ???? - None, - # chrono #TODO! pas de vrai création de nouvelle et en cas de modif - # c'est la zone - ImportFormater('datings__period', TypeFormater(models.Period), - required=False), - ] - - -class ContextRecordsRelationImporterBibracte(Importer): - DESC = u"Exports Bibracte : importeur pour l'onglet relations entre UE" - OBJECT_CLS = models.RecordRelations - DEFAULTS = {} - LINE_FORMAT = [ - # code OA - ImportFormater( - 'left_record__operation__operation_code', IntegerFormater(), - duplicate_fields=[('right_record__operation__operation_code', - False)],), - # identifiant UE 1 - ImportFormater('left_record__external_id', UnicodeFormater(120),), - # type relation - ImportFormater('relation_type', TypeFormater(models.RelationType),), - # identifiant UE 2 - ImportFormater('right_record__external_id', UnicodeFormater(120),), - ] diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index a8517ed26..925a48597 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -578,6 +578,10 @@ class RecordRelations(GeneralRecordRelations, models.Model): class Meta: verbose_name = _(u"Record relation") verbose_name_plural = _(u"Record relations") + permissions = [ + ("view_recordrelation", u"Can view all Context record relations"), + ] + post_delete.connect(post_delete_record_relation, sender=RecordRelations) @@ -626,6 +630,9 @@ class RecordRelationView(models.Model): managed = False db_table = 'record_relations' unique_together = ('id', 'right_record') + permissions = [ + ("view_recordrelation", u"Can view all record relations - view"), + ] def __unicode__(self): return u"{} \"{}\"".format(self.relation_type, self.right_record) diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html index a0d0affcf..b91500403 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_contextrecord.html" %} {% block header %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -<div id="pdffooter"> -– <pdf:pagenumber/> – -</div> </body> </html> {%endblock%} diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html index 38c5d318e..c03b80a53 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecordsource_pdf.html @@ -1,6 +1,5 @@ {% extends "ishtar/sheet_contextrecordsource.html" %} {% block header %} -<link rel="stylesheet" href="{{STATIC_URL}}/media/style_basic.css?ver={{VERSION}}" /> {% endblock %} {% block main_head %} {{ block.super }} @@ -10,9 +9,6 @@ Ishtar – {{APP_NAME}} – {{item}} {% endblock %} {%block head_sheet%}{%endblock%} {%block main_foot%} -<div id="pdffooter"> -– <pdf:pagenumber/> – -</div> </body> </html> {%endblock%} diff --git a/archaeological_context_records/views.py b/archaeological_context_records/views.py index 3bfe544be..242ccadec 100644 --- a/archaeological_context_records/views.py +++ b/archaeological_context_records/views.py @@ -81,11 +81,11 @@ get_contextrecordsource = get_item( get_contextrecordrelation = get_item( models.RecordRelationView, 'get_contextrecordrelation', - 'contextrecordrelation') + 'contextrecordrelation', specific_perms=['view_recordrelation']) get_contextrecordrelationdetail = get_item( models.RecordRelations, 'get_contextrecordrelationdetail', - 'contextrecordrelationdetail') + 'contextrecordrelationdetail', specific_perms=['view_recordrelation']) record_search_wizard = SearchWizard.as_view([ ('general-record_search', RecordFormSelection)], |