ioxiocom / firedantic

Database models for Firestore using Pydantic base models.
BSD 3-Clause "New" or "Revised" License
43 stars 13 forks source link

Generate default collection names automatically based on class name #18

Open joakimnordling opened 3 years ago

joakimnordling commented 3 years ago

Would be nice if it'd be possible to specify a function that's used to generate collection names automatically based on class names, so one would not always have to specify the __collection__.

Arangodantic does this by specifying a collection_generator as part of the configuration.

Could be worth considering if we'd want to move the firedantic related configurations (such as any overriding collection name) into a FiredanticConfig or such, a bit similar to the ArangodanticConfig which was inspired by the Model Config in pydantic.