Here's another way of framing what you're asking:

should you

- create the correct data in order to work with the existing code

or

- fork cartridge and modify it's source code to work with the incorrect
data you're currently creating

When put like that, I think the answer is obviously the former - that's
what I was referring to when I said study the admin classes to understand
how they set up the correct data

On Tue, Dec 22, 2015 at 1:25 PM, Benj Arnopp <b...@projectelectronic.co.nz>
wrote:

> Thanks for that Stephen.
> Would it be less messy to create a single variation for each product, or
> to modify the data model to point at the product class?
>
> On Tuesday, December 22, 2015 at 3:09:40 PM UTC+13, Stephen McDonald wrote:
>>
>> If you grep the Cartridge source for SHOP_USE_VARIATIONS you'll see it
>> only really controls the admin interface used - the underlying data model
>> doesn't change in any way (grepping will reveal a bunch of notes describing
>> this too).
>>
>> To build a correct rest API you'll need to study how the variations data
>> gets managed in the admin classes and replicate what happens there.
>>
>> On Tue, Dec 22, 2015 at 1:03 PM, Benj Arnopp <
>> be...@projectelectronic.co.nz> wrote:
>>
>>>
>>> I am writing an app to sync our local inventory db with our online store
>>> which is going to run on mezzanine/cartridge.
>>> It appears that i can POST products directly with number in stock and
>>> price (with SHOP_USE_VARIATIONS disabled) but while this information shows
>>> up in the product list, it doesn't show elsewhere. The rest of the
>>> functionality still seems to rely on there being variations. Is there
>>> anything i've missed or do i have to manually patch the "single variation"
>>> code in? Culprits appear to be views.py, models.py and the cartridge
>>> templates they provide to e.g. category, product.
>>> Versions:
>>> Cartridge==0.10.0
>>> Django==1.8.7
>>> Mezzanine==4.0.1
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mezzanine-use...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Stephen McDonald
>> http://jupo.org
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to