-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#4396] Added basic plugin and necessary views and endpoints
- Loading branch information
Showing
10 changed files
with
196 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ Prefill plugins | |
kvk | ||
stuf_bg | ||
suwinet | ||
objects_api |
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
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,3 @@ | ||
""" | ||
Objects API prefill plugin. | ||
""" |
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,12 @@ | ||
from django.apps import AppConfig | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class ObjectsApiApp(AppConfig): | ||
name = "openforms.prefill.contrib.objects_api" | ||
label = "objects_api" | ||
verbose_name = _("Objects API prefill plugin") | ||
|
||
def ready(self): | ||
# register the plugin | ||
from . import plugin # noqa |
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,44 @@ | ||
import logging | ||
from typing import Any, Iterable | ||
|
||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from openforms.authentication.service import AuthAttribute | ||
|
||
from openforms.submissions.models import Submission | ||
from openforms.typing import JSONEncodable | ||
|
||
from ...base import BasePlugin | ||
from ...constants import IdentifierRoles | ||
from ...registry import register | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
PLUGIN_IDENTIFIER = "objects_api" | ||
|
||
|
||
@register(PLUGIN_IDENTIFIER) | ||
class ObjectsAPIPrefill(BasePlugin): | ||
verbose_name = _("Objects API") | ||
requires_auth = AuthAttribute.bsn | ||
|
||
@staticmethod | ||
def get_available_attributes( | ||
reference: dict[str, Any] | None = None, | ||
) -> Iterable[tuple[str, str]]: | ||
pass | ||
|
||
@classmethod | ||
def get_prefill_values( | ||
cls, | ||
submission: Submission, | ||
attributes: list[str], | ||
identifier_role: IdentifierRoles = IdentifierRoles.main, | ||
) -> dict[str, JSONEncodable]: | ||
pass | ||
|
||
@classmethod | ||
def get_co_sign_values( | ||
cls, submission: Submission, identifier: str | ||
) -> tuple[dict[str, Any], str]: | ||
pass |