Projet

Général

Profil

Development #2761

ajouter des NotImplementedError dans BaseDataSource

Ajouté par Thomas Noël il y a environ 11 ans. Mis à jour il y a presque 6 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
16 avril 2013
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Planning:

Description

Pour faire propre, je propose :

diff --git a/passerelle/datasources/models.py b/passerelle/datasources/models.py
index 034b6e0..faa2326 100644
--- a/passerelle/datasources/models.py
+++ b/passerelle/datasources/models.py
@@ -16,12 +16,21 @@ class BaseDataSource(models.Model):
     def __unicode__(self):
         return self.title

-    def get_data_by_id(self, id):
+    def get_data(self, **kwargs):
+        raise NotImplementedError
+
+    def get_data_by_id(self, id,  **kwargs):
         for row in self.get_data():
             if row.get('id') == id:
                 return row.get('text')
         return None

+    def post_data(self, **kwargs):
+        raise NotImplementedError
+
+    def post_data_by_id(self, id, **kwargs):
+        raise NotImplementedError
+

 class CsvDataSource(BaseDataSource):
     csv_file = models.FileField(upload_to='csv')

Révisions associées

Révision 8ec7b014 (diff)
Ajouté par Thomas Noël il y a environ 11 ans

csv: select output columns with ?columns=a,b,c (fix #2781)

Historique

#1

Mis à jour par Thomas Noël il y a environ 11 ans

poussé par erreur dans 8ec7b014 ... ça marche, ceci dit, je ne revert pas sauf si on me le demande (gentilment).

#2

Mis à jour par Thomas Noël il y a environ 11 ans

  • Statut changé de Nouveau à Résolu (à déployer)
#3

Mis à jour par Benjamin Dauvergne il y a presque 6 ans

  • Statut changé de Résolu (à déployer) à Fermé

Formats disponibles : Atom PDF