Skip to content

Commit

Permalink
Merge pull request #428 from hypsug0/admin_id_observation
Browse files Browse the repository at this point in the history
add id_obs in admin - fix #425
  • Loading branch information
hypsug0 authored Nov 20, 2024
2 parents 448a8bb + c75160e commit 69c242d
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 93 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.2.0-dev
6 changes: 4 additions & 2 deletions backend/gncitizen/core/observations/admin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from flask_admin.actions import action
from wtforms import SelectField

from gncitizen.utils.admin import CustomJSONField, CustomTileView, json_formatter
from server import db
from wtforms import SelectField

from .models import ObservationModel, ValidationStatus

Expand All @@ -15,6 +14,7 @@ def enum_formatter(view, context, model, name):
class ObservationView(CustomTileView):
can_export = True
# column_exclude_list = ["geom"]
column_display_pk = True
form_overrides = {"json_schema": CustomJSONField, "validation_status": SelectField}
form_args = {
"validation_status": {
Expand All @@ -27,6 +27,7 @@ class ObservationView(CustomTileView):
"validation_status": enum_formatter,
}
column_filters = (
"id_observation",
"email",
"cd_nom",
"date",
Expand All @@ -45,6 +46,7 @@ class ObservationView(CustomTileView):
"municipality",
"obs_txt",
"email",
"uuid_sinp",
)
can_create = False

Expand Down
5 changes: 2 additions & 3 deletions backend/gncitizen/core/sites/admin.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Flask-Admin views for site module"""

from flask_admin.contrib.sqla.view import ModelView
from markupsafe import Markup

from gncitizen.utils.admin import CustomJSONField, CustomTileView, json_formatter
from markupsafe import Markup

from .models import VisitModel

Expand All @@ -20,9 +19,9 @@ class SiteView(CustomTileView):
VisitModel,
]
column_formatters = {"visits": _visits_list_formatter}
# column_exclude_list = ["geom"]
column_list = [
"id_site",
"uuid_sinp",
"name",
"visits",
"site_type.type",
Expand Down
Loading

0 comments on commit 69c242d

Please sign in to comment.