The original problem is due to my trying to utilise model inheritance, a la http://www.satchmoproject.com/docs/dev/custom-product.html The method I am currently using (which works) is a slight variation on the regular custom module schema.
Inheritance would be preferred. On 14 Juli, 20:45, Chris Moffitt <[email protected]> wrote: > Do you have a valid site and Satchmo config instance configured in the > admin? > > -Chris > > > > > > > > On Thu, Jul 14, 2011 at 3:32 PM, tyr <[email protected]> wrote: > > Hello everyone! > > I am trying to get a custom product module working with satchmo and > > everything is coming along alright but I am now getting a strange > > error when I try to save a new product. I am currently using sqlite3 > > for early development. > > > ########## > >http://127.0.0.1:8000/admin/mycustomproduct/mycustommodel/add/ > > > IntegrityError at /admin/mycustomproduct/mycustommodel/add/ > > product_product.site_id may not be NULL > > > Request Method: POST > > Request URL: > >http://127.0.0.1:8000/admin/mycustomproduct/mycustommodel/add/ > > Django Version: 1.3 > > Exception Type: IntegrityError > > Exception Value: > > product_product.site_id may not be NULL > > Exception Location: /chymika/django/db/backends/sqlite3/base.py in > > execute, line 234 > > Python Executable: /Library/Frameworks/Python.framework/Versions/2.7/ > > Resources/Python.app/Contents/MacOS/Python > > Python Version: 2.7.1 > > > ########## > > admin.py > > > class MyCustomModelAdmin(ProductOptions): > > search_fields = ['full_designation', 'product', 'category', > > 'country', 'subcategory_id', 'specific_id'] > > fieldsets = (('Profile',{'fields': ('product', 'full_designation', > > 'product_slug', 'designation', 'primary_users', > > 'current_configuration')}),) > > pass > > > admin.site.register(MyCustomModel, MyCustomModelAdmin) > > > ######### > > models.py > > > class MyCustomModel(Product): > > #import satchmo product model > > product = models.OneToOneField(Product, > > verbose_name=_('Product'),primary_key=True) > > > # GENERAL > > product_slug = models.SlugField(max_length=150, > > unique=True,help_text=_("Used for hyperlinks, no spaces or special > > characters.")) > > meta_tag = models.TextField(blank=True, null=True) > > > etc.. > > > ######### > > > Even though my model is setup to take a saved standard satchmo product > > (complete with non-zero site) it never ceases to give me this error. > > > I have also tried adding 'site' to the fieldsets of MyCustomModelAdmin > > but python crashes every time I try to save the model. I can't find > > anything in the satchmo docs about this error, although I found a > > similar issue here: > > >http://groups.google.com/group/satchmo-users/browse_thread/thread/380... > > However, as I said: merely adding site to the fieldsets causes my > > instance of python to crash. > > > What am I doing wrong? > > > -- > > 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. -- 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.
