-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intégration de taxhub v2 à GeoNature (#3150)
* TaxHub integration: - load of blueprint - add Babel for traductions - Infer TAXHUB API URL from GN API - remove taxhub from installation : systemd + apache * Taxhub integration (medias + suppression de l'installation standalone de TaxHub * doc on taxhub * compat 2.14 * fix multiple heads of migration ebbe0f7ed866 * add endpoint for taxhub media * Centralisation des parametères relatif à taxhub sous section TAXHUB + API_PREFIX for taxhub api url - retrocompatibily occtax-mobile GeoNature-atlas * Ajout paramètre taxref_region * update requirements * Correction test_synthese::test_get_observations_for_web * doc changelog --------- Co-authored-by: TheoLechemia <lechemia.theo@gmail.com> Co-authored-by: jacquesfize <jacques.fize@ecrins-parcnational.fr> Co-authored-by: amandine-sahl <amandine.sahl@cevennes-parcnational.fr>
- Loading branch information
1 parent
dbb8797
commit 3adc7b4
Showing
30 changed files
with
487 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule UsersHub
updated
5 files
+11 −8 | app/app.py | |
+1 −1 | dependencies/UsersHub-authentification-module | |
+1 −1 | requirements-dependencies.in | |
+3 −3 | requirements-dev.txt | |
+4 −4 | requirements.txt |
Submodule UsersHub-authentification-module
updated
6 files
+4 −2 | README.md | |
+1 −1 | VERSION | |
+25 −0 | docs/changelog.rst | |
+20 −18 | requirements-dev.txt | |
+16 −14 | requirements.txt | |
+2 −2 | src/pypnusershub/routes_register.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import os | ||
from apptax.admin.admin_view import ( | ||
BibListesView, | ||
TaxrefView, | ||
TMediasView, | ||
BibAttributsView, | ||
BibThemesView, | ||
) | ||
from geonature.utils.env import db | ||
|
||
from apptax.admin.admin import adresses | ||
from apptax.taxonomie.models import Taxref, BibListes, TMedias, BibAttributs, BibThemes | ||
from geonature.core.admin.utils import CruvedProtectedMixin | ||
|
||
|
||
class CruvedProtectedBibListesView(CruvedProtectedMixin, BibListesView): | ||
module_code = "TAXHUB" | ||
object_code = "LISTE" | ||
extra_actions_perm = {".import_cd_nom_view": "C"} | ||
|
||
|
||
class CruvedProtectedTaxrefView(CruvedProtectedMixin, TaxrefView): | ||
module_code = "TAXHUB" | ||
object_code = "TAXON" | ||
|
||
|
||
class CruvedProtectedTMediasView(CruvedProtectedMixin, TMediasView): | ||
module_code = "TAXHUB" | ||
object_code = "TAXON" | ||
|
||
|
||
class CruvedProtectedBibAttributsView(CruvedProtectedMixin, BibAttributsView): | ||
module_code = "TAXHUB" | ||
object_code = "ATTRIBUT" | ||
|
||
|
||
class CruvedProtectedBibThemes(CruvedProtectedMixin, BibThemesView): | ||
module_code = "TAXHUB" | ||
object_code = "THEME" | ||
|
||
|
||
def load_admin_views(app, admin): | ||
static_folder = os.path.join(adresses.root_path, "static") | ||
|
||
admin.add_view( | ||
CruvedProtectedTaxrefView( | ||
Taxref, | ||
db.session, | ||
name="Taxref", | ||
endpoint="taxons", | ||
category="TaxHub", | ||
static_folder=static_folder, | ||
) | ||
) | ||
admin.add_view( | ||
CruvedProtectedBibListesView( | ||
BibListes, | ||
db.session, | ||
name="Listes", | ||
category="TaxHub", | ||
static_folder=static_folder, | ||
) | ||
) | ||
|
||
admin.add_view( | ||
CruvedProtectedBibAttributsView( | ||
BibAttributs, | ||
db.session, | ||
name="Attributs", | ||
category="TaxHub", | ||
static_folder=static_folder, | ||
) | ||
) | ||
admin.add_view( | ||
CruvedProtectedBibThemes( | ||
BibThemes, | ||
db.session, | ||
name="Thèmes", | ||
category="TaxHub", | ||
static_folder=static_folder, | ||
) | ||
) | ||
|
||
admin.add_view( | ||
CruvedProtectedTMediasView( | ||
TMedias, | ||
db.session, | ||
name="Médias", | ||
category="TaxHub", | ||
static_folder=static_folder, | ||
) | ||
) |
Oops, something went wrong.