-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
default b_size for bookyngtypesvocab to 100
- Loading branch information
Showing
4 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
|
||
<include package=".ovverrides" /> | ||
|
||
<adapter factory=".vocabularies.SerializeVocabularyToJson" /> | ||
|
||
</configure> |
17 changes: 17 additions & 0 deletions
17
src/design/plone/ioprenoto/restapi/serializers/vocabularies.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
from design.plone.ioprenoto.vocabularies.tipologies import IPrenotazioneTypesVocabulary | ||
from plone.restapi.interfaces import ISerializeToJson | ||
from plone.restapi.serializer.vocabularies import SerializeVocabularyToJson as Base | ||
from zope.component import adapter | ||
from zope.interface import implementer | ||
from zope.interface import Interface | ||
|
||
|
||
@implementer(ISerializeToJson) | ||
@adapter(IPrenotazioneTypesVocabulary, Interface) | ||
class SerializeVocabularyToJson(Base): | ||
def __call__(self, vocabulary_id): | ||
b_size = self.request.form.get("b_size", "") | ||
if not b_size: | ||
self.request.form["b_size"] = "200" | ||
return super().__call__(vocabulary_id) |
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