MongoEngine / MongoEngine/marshmallow-mongoengine
Add support for EnumField
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 76
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Currently there is no support for EnumField that is mentioned in MongoEngine docs.
For now attempting to use this field like this raises an exception:
import mongoengine
from enum import Enum
from marshmallow_mongoengine import ModelSchema
class NotificationStyle(Enum):
SUCCESS = "success"
FAILURE = "failure"
class Notification(mongoengine.Document):
style = mongoengine.EnumField(NotificationStyle, default=NotificationStyle.SUCCESS)
class NotificationListSchema(ModelSchema):
class Meta:
model = Notification
model_skip_values = ()
marshmallow_mongoengine.exceptions.ModelConversionError: Could not find field of type <mongoengine.fields.EnumField object at 0x7fc05c3a3e80>.
Please add support for it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ModelSchema and trace the field-conversion path that raises ModelConversionError for the shown mongoengine.EnumField example. Compare how existing MongoEngine fields are converted, then verify that the Notification schema can be created without the reported exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100