forked from mozaik-association/mozaik
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PORT] Port event_rest_api from OCA to mozaik
From OCA/event#247
- Loading branch information
1 parent
41b8084
commit 23cdc00
Showing
18 changed files
with
407 additions
and
50 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
29 changes: 29 additions & 0 deletions
29
mozaik_event_rest/pydantic_models/event_registration_info.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,29 @@ | ||
# Copyright 2021 ACSONE SA/NV | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from datetime import datetime | ||
|
||
import pydantic | ||
from extendable_pydantic import ExtendableModelMeta | ||
from pydantic import BaseModel | ||
|
||
from odoo.addons.pydantic import utils | ||
|
||
from .event_info import EventInfo | ||
from .event_ticket_info import EventTicketInfo | ||
|
||
|
||
class EventRegistrationInfo(BaseModel, metaclass=ExtendableModelMeta): | ||
|
||
id: int | ||
partner_id: int = None | ||
firstname: str = None | ||
lastname: str = None | ||
email: str = None | ||
event: EventInfo = pydantic.Field(..., alias="event_id") | ||
event_ticket: EventTicketInfo = pydantic.Field(None, alias="event_ticket_id") | ||
write_date: datetime | ||
|
||
class Config: | ||
orm_mode = True | ||
getter_dict = utils.GenericOdooGetter |
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
# Copyright 2021 ACSONE SA/NV | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from datetime import datetime | ||
from typing import List | ||
|
||
from odoo.addons.event_rest_api.pydantic_models.event_search_filter import ( | ||
EventSearchFilter as BaseEventSearchFilter, | ||
) | ||
from extendable_pydantic import ExtendableModelMeta | ||
from pydantic import BaseModel | ||
|
||
|
||
class EventSearchFilter(BaseEventSearchFilter, extends=BaseEventSearchFilter): | ||
class EventSearchFilter(BaseModel, metaclass=ExtendableModelMeta): | ||
|
||
id: int = None | ||
name: str = None | ||
start_after: datetime = None | ||
end_before: datetime = None | ||
event_type_ids: List[int] = None | ||
stage_ids: List[int] = None | ||
website_domain_ids: List[int] = None | ||
interest_ids: List[int] = None | ||
is_headline: bool = None |
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
12 changes: 6 additions & 6 deletions
12
mozaik_event_rest/pydantic_models/event_stage_search_filter.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Copyright 2021 ACSONE SA/NV | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo.addons.event_rest_api.pydantic_models.event_stage_search_filter import ( | ||
EventStageSearchFilter as BaseEventStageSearchFilter, | ||
) | ||
from extendable_pydantic import ExtendableModelMeta | ||
from pydantic import BaseModel | ||
|
||
|
||
class EventStageSearchFilter( | ||
BaseEventStageSearchFilter, extends=BaseEventStageSearchFilter | ||
): | ||
class EventStageSearchFilter(BaseModel, metaclass=ExtendableModelMeta): | ||
|
||
id: int = None | ||
name: str = None | ||
pipe_end: bool = None | ||
draft_stage: bool = None |
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,19 @@ | ||
# Copyright 2021 ACSONE SA/NV | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from datetime import datetime | ||
|
||
from extendable_pydantic import ExtendableModelMeta | ||
from pydantic import BaseModel | ||
|
||
from odoo.addons.pydantic import utils | ||
|
||
|
||
class EventTypeInfo(BaseModel, metaclass=ExtendableModelMeta): | ||
id: int | ||
name: str | ||
write_date: datetime | ||
|
||
class Config: | ||
orm_mode = True | ||
getter_dict = utils.GenericOdooGetter |
11 changes: 11 additions & 0 deletions
11
mozaik_event_rest/pydantic_models/event_type_search_filter.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,11 @@ | ||
# Copyright 2021 ACSONE SA/NV | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from extendable_pydantic import ExtendableModelMeta | ||
from pydantic import BaseModel | ||
|
||
|
||
class EventTypeSearchFilter(BaseModel, metaclass=ExtendableModelMeta): | ||
|
||
id: int = None | ||
name: str = None |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from . import service | ||
from . import event_stage | ||
from . import event_type | ||
from . import event_website_domain | ||
from . import event |
Oops, something went wrong.