Closed SamEdwardes closed 1 year ago
+1
This feature would be helpful for situations where the parent object is created separately from the process to add/remove items to it. For example, a "group" model that links to a list of "users". It is valid for a group to exist and be empty.
Hi! Thank you for the suggestion. I'll add this soon.
@roman-right When will this feature be added?
I'm using it like this right now, would that be a problem? perm:List[Link[Permission]] = []
@roman-right When will this feature be added?
I'm using it like this right now, would that be a problem?
perm:List[Link[Permission]] = []
I think you will want to use the Field
class like this:
from pydantic import Field
perm:List[Link[Permission]] = Field(default_factory=list)
Feature request
Thank you for all of the great work on Beanie @roman-right! I would like to make a feature request. It would be helpful to extend the supported relationship patterns to include:
Per the docs the currently supported patterns are:
Link[...]
Optional[Link[...]]
List[Link[...]]
Related issues
220