You are correct that you cannot automatically create CustomCategory objects when creating a Category objects -- but that is the point of subclassing. Yes, the CustomCategory must be registered with the admin site, but that is trivial, and one would not have to disable the existing Category forms. They can happily remain and be used for some other purpose for which CustomCategories are not intended.
On Fri, Mar 20, 2009 at 9:40 AM, dalore <[email protected]> wrote: > > If you subclass category in this way then I don't think you can't > create new CustomCategory from existing Category objects. > > When you create a CustomCategory it will create a Category object but > not vice versa. > > And also won't they have to add the CustomCategory to the admin > interface (and disable the existing Category admin forms)? > > On Mar 19, 2:10 am, Bob Waycott <[email protected]> wrote: > > if you defined your class like this: > > class CustomCategory(Category): > > # special fields > > > > You get all categories the traditional Satchmo way, via Category: > > > > Category.objects.all() > > > > You get all your custom categories like so: > > > > CustomCategory.objects.all() > > > > That will only return those categories that are also defined in the > > CustomCategory table. > > > > Make sense? > > > > > > > > On Wed, Mar 18, 2009 at 9:41 PM, welyou <[email protected]> wrote: > > > > > Thanks, Bob! > > > > > category.child.all() (for my CustomCategory) returns Category objects > > > (not CustomCategory) > > > > > if i want get, in this case, CustomCategory, what i do need? It is > > > possible? > > > > > On Mar 18, 8:49 pm, Bob Waycott <[email protected]> wrote: > > > > I'd recommend subclassing Category and create your own custom > > > CustomCategory > > > > class. > > > > You will have minimal impact on Satchmo operations, will ensure that > a > > > > Satchmo category is saved/updated each time a CustomCategory is > > > > saved/updated, and will have a model that you can define any methods > you > > > > need for without affecting Satchmo and breaking your upgrade path. > > > > > > On Wed, Mar 18, 2009 at 3:07 AM, welyou <[email protected]> > wrote: > > > > > > > We develophttp://code.google.com/p/django-satchmo-tuning/" - > "Tuning > > > > > Satchmo for wholesale store" > > > > > > > We tuning Satchmo for web presentation of data stored in accounting > > > > > system. > > > > > > > And have problem, how to correct extend Category (subclass/inherit > or > > > > > create one-to-one relation with addition entity)? > > > > > > > Every hour data from account system will be uploaded/updated into > site > > > > > shop data base. > > > > > > > In accounting system category have code and name attributes, for > > > > > ability sync operation between site and accounting system i must > have > > > > > "code". > > > > > > > Addition "active" attribute we needed for hide some category from > > > > > category catalog. > > > > > > > How do this more correct? > > > > > > > Help, please :)! > > > > > > > P.S. > > > > > Maybe Satchmo developers add "code,active" into class Category > source > > > > > satchmo? > > > > > > > Needing of "active" attribute for Category already discussed. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
