Open Matt-Deacalion opened 8 years ago
I went another way with this. I made Django Carton model agnostic, so it doesn't need to know in advance what product model it's dealing with. My real world use is that my cart needs to be able to deal with both Merchandise
and Ticket
models.
The code is here: https://github.com/Matt-Deacalion/django-carton/commit/1e17a0f0daa1f01c7d911505047c4e3ef3095eea
If you're interested in accepting it upstream I'll clean it up and do a pull request. The changes are all backwards compatible.
Hi !
I'd love this too. Wouldn't it be quite easy using the content types framework ?
I would like to have two carts on a single web site, which is easy enough - but I would like each one to work on a different model. I think the best way would be to add an optional
model
kwarg to theCart
__init__
method, then haveget_product_model
use the specified model if it exists, otherwise it falls back to the current behaviour.Is this something done before? if it's useful, could I do a pull request for it?