-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create choosing_wagtail_page_models_vs_django_models.md
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Choosing Between Wagtail Page Models and Django Models | ||
|
||
> Generated by ChatGPT and edited by me. While I didn't write this, I did review it closely and it does reflect my experience. | ||
Discussion of the pros and cons to using a combination of Django models and Wagtail Page models in a Wagtail project, or only using Wagtail Page models for most objects. This was created in the context of an e-commerce platform. | ||
|
||
## Using Only Wagtail's Page Model | ||
|
||
### Pros | ||
- **Integrated CMS Features**: Leverages Wagtail's built-in features like hierarchical structuring and rich text editing. | ||
- **Simplicity**: Simplifies the architecture by avoiding additional models. | ||
- **SEO and Navigation**: Benefits from Wagtail's SEO tools and site navigation integration. | ||
|
||
### Cons | ||
- **Performance Issues**: The generic nature of the Page model may not be as efficient for a large catalog of products. | ||
- **Limited Flexibility**: May find it challenging to manage complex relationships and queries with a more extensive product structure. | ||
|
||
## Integrating Custom Django Models | ||
|
||
### Pros | ||
- **Performance and Scalability**: Custom models can be optimized for better performance with large datasets. | ||
- **Flexibility**: Allows for a tailored database schema, making it easier to implement complex relationships and business logic. | ||
- **Separation of Concerns**: Offers a cleaner, more modular architecture by separating e-commerce functionality from content management. | ||
|
||
### Cons | ||
- **Increased Complexity**: Adds complexity to the application, requiring manual integration between Wagtail pages and Django models. | ||
- **Integration Effort**: Some of Wagtail's out-of-the-box benefits need to be manually implemented for Django models. | ||
|
||
## Takeaway | ||
|
||
- **Simple Applications**: If the product catalog is modest and the product structure is straightforward, using Wagtail's Page model might suffice. | ||
- **Complex Applications**: For platforms with a large number of products, complex attributes, or sophisticated business logic, integrating custom Django models with Wagtail pages is advisable for greater flexibility and performance. | ||
|
||
This decision should be based on the specific needs of the project, including the size of the product catalog, complexity of product data, and scalability requirements. |