udata 10.7.1.dev36357__py2.py3-none-any.whl → 10.7.1.dev36387__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- udata/commands/fixtures.py +1 -1
- udata/core/discussions/api.py +3 -0
- udata/core/linkable.py +5 -1
- udata/core/topic/models.py +4 -0
- udata/static/chunks/{10.471164b2a9fe15614797.js → 10.8ca60413647062717b1e.js} +3 -3
- udata/static/chunks/{10.471164b2a9fe15614797.js.map → 10.8ca60413647062717b1e.js.map} +1 -1
- udata/static/chunks/{11.83535504cd650ea08f65.js → 11.b6f741fcc366abfad9c4.js} +3 -3
- udata/static/chunks/{11.83535504cd650ea08f65.js.map → 11.b6f741fcc366abfad9c4.js.map} +1 -1
- udata/static/chunks/{13.d9c1735d14038b94c17e.js → 13.2d06442dd9a05d9777b5.js} +2 -2
- udata/static/chunks/{13.d9c1735d14038b94c17e.js.map → 13.2d06442dd9a05d9777b5.js.map} +1 -1
- udata/static/chunks/{17.81c57c0dedf812e43013.js → 17.e8e4caaad5cb0cc0bacc.js} +2 -2
- udata/static/chunks/{17.81c57c0dedf812e43013.js.map → 17.e8e4caaad5cb0cc0bacc.js.map} +1 -1
- udata/static/chunks/{19.df16abde17a42033a7f8.js → 19.f03a102365af4315f9db.js} +3 -3
- udata/static/chunks/{19.df16abde17a42033a7f8.js.map → 19.f03a102365af4315f9db.js.map} +1 -1
- udata/static/chunks/{8.462bb3029de008497675.js → 8.778091d55cd8ea39af6b.js} +2 -2
- udata/static/chunks/{8.462bb3029de008497675.js.map → 8.778091d55cd8ea39af6b.js.map} +1 -1
- udata/static/chunks/{9.07515e5187f475bce828.js → 9.033d7e190ca9e226a5d0.js} +3 -3
- udata/static/chunks/{9.07515e5187f475bce828.js.map → 9.033d7e190ca9e226a5d0.js.map} +1 -1
- udata/static/common.js +1 -1
- udata/static/common.js.map +1 -1
- udata/tests/test_discussions.py +8 -2
- {udata-10.7.1.dev36357.dist-info → udata-10.7.1.dev36387.dist-info}/METADATA +3 -1
- {udata-10.7.1.dev36357.dist-info → udata-10.7.1.dev36387.dist-info}/RECORD +27 -27
- {udata-10.7.1.dev36357.dist-info → udata-10.7.1.dev36387.dist-info}/LICENSE +0 -0
- {udata-10.7.1.dev36357.dist-info → udata-10.7.1.dev36387.dist-info}/WHEEL +0 -0
- {udata-10.7.1.dev36357.dist-info → udata-10.7.1.dev36387.dist-info}/entry_points.txt +0 -0
- {udata-10.7.1.dev36357.dist-info → udata-10.7.1.dev36387.dist-info}/top_level.txt +0 -0
udata/commands/fixtures.py
CHANGED
|
@@ -74,7 +74,7 @@ UNWANTED_KEYS: dict[str, list[str]] = {
|
|
|
74
74
|
"preview_url",
|
|
75
75
|
"permissions",
|
|
76
76
|
],
|
|
77
|
-
"discussion": ["subject", "url", "class", "permissions"],
|
|
77
|
+
"discussion": ["subject", "url", "self_web_url", "class", "permissions"],
|
|
78
78
|
"discussion_message": ["permissions"],
|
|
79
79
|
"user": ["uri", "page", "class", "avatar_thumbnail", "email"],
|
|
80
80
|
"posted_by": ["uri", "page", "class", "avatar_thumbnail", "email"],
|
udata/core/discussions/api.py
CHANGED
|
@@ -77,6 +77,9 @@ discussion_fields = api.model(
|
|
|
77
77
|
"url": fields.String(
|
|
78
78
|
attribute=lambda d: d.self_api_url(), description="The discussion API URI"
|
|
79
79
|
),
|
|
80
|
+
"self_web_url": fields.String(
|
|
81
|
+
attribute=lambda d: d.self_web_url(), description="The discussion web URL"
|
|
82
|
+
),
|
|
80
83
|
"extras": fields.Raw(description="Extra attributes as key-value pairs"),
|
|
81
84
|
"spam": fields.Nested(spam_fields),
|
|
82
85
|
"permissions": fields.Nested(discussion_permissions_fields),
|
udata/core/linkable.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
class Linkable:
|
|
2
2
|
def _link_id(self, **kwargs):
|
|
3
|
-
|
|
3
|
+
if kwargs.get("_useId", False):
|
|
4
|
+
return self.id
|
|
5
|
+
|
|
6
|
+
# Some old/special datasets don't have slug?
|
|
7
|
+
return self.slug or self.id
|
|
4
8
|
|
|
5
9
|
def _self_api_url_kwargs(self, **kwargs):
|
|
6
10
|
# Default to external
|
udata/core/topic/models.py
CHANGED
|
@@ -60,6 +60,10 @@ class Topic(db.Datetimed, Auditable, db.Document, Owned):
|
|
|
60
60
|
# There are no metrics on Topic to store discussions count
|
|
61
61
|
pass
|
|
62
62
|
|
|
63
|
+
def self_web_url(self, **kwargs):
|
|
64
|
+
# Useful for Discussions to call self_web_url on their `subject`
|
|
65
|
+
return None
|
|
66
|
+
|
|
63
67
|
|
|
64
68
|
pre_save.connect(Topic.pre_save, sender=Topic)
|
|
65
69
|
post_save.connect(Topic.post_save, sender=Topic)
|