diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 41 | 
1 files changed, 41 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index be35c4350..2845b7c1c 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -894,6 +894,47 @@ class OrganizationType(GeneralType):          verbose_name_plural = _(u"Organization types")          ordering = ('label',) +IMPORT_STATE = (("C", _(u"Created")), +                ("AP", _(u"Analyse in progress")), +                ("A", _(u"Analysed")), +                ("P", _(u"Import pending")), +                ("IP", _(u"Import in progress")), +                ("F", _(u"Finished"))) + +IMPORT_TYPE = ( +    ('archaeological_files.data_importer.FileImporterSraPdL', +     _("Archaeological files - SRA Pays de la Loire")), +    ('custom', _(u"Custom")) +     ) + +class Import(models.Model): +    name = models.CharField(_(u"Name"), blank=True, null=True, +                            max_length=100) +    user = models.ForeignKey('IshtarUser') +    imported_file = models.FileField(_(u"Imported file"), +                                     upload_to="upload/imports/") +    error_file = models.FileField(_(u"Error file"), +                                     upload_to="upload/imports/", +                                     blank=True, null=True) +    result_file = models.FileField(_(u"Result file"), +                                     upload_to="upload/imports/", +                                     blank=True, null=True) +    importer_type = models.CharField(_(u"Importer type"), max_length=200, +                                     choices=IMPORT_TYPE) +    state = models.CharField(_(u"State"), max_length=2, choices=IMPORT_STATE) +    creation_date = models.DateTimeField(_(u"Creation date"), blank=True, +                                         null=True) +    end_date = models.DateTimeField(_(u"End date"), blank=True, +                                    null=True) +    seconds_remaining = models.IntegerField(_(u"Seconds remaining"), blank=True, +                                            null=True) +    class Meta: +        verbose_name = _(u"Import") +        verbose_name_plural = _(u"Imports") + +    def __unicode__(self): +        return self.name +  class Organization(Address, Merge, OwnPerms, ValueGetter):      TABLE_COLS = ('name', 'organization_type',)      name = models.CharField(_(u"Name"), max_length=300) | 
