Apologies if this this an existing issue or I'm missing something but I am
having a little trouble with my cartridge installation and my custom
product types, I am running on the current versions of Mezzanine and
Cartridge from the GitHub repos.
Previously I have declared my custom product type in the settings.py file
as follows:
ADMIN_MENU_ORDER = (
...
("My Shop", (
"my_shop.BaseProduct",
)),
...
.. in my models as:
from cartridge.shop.models import Product, Category, ProductVariation,
ProductImage
...
class BaseProduct(Product):
cadfile = fields.FileField(upload_to="product/cadfile",
extensions=(".dwg",), blank=True, null=True, help_text="Format: Files should be
named in all lower case with leading zeros and ONLY product codes e.g rg09.dwg")
pdffile = fields.FileField(upload_to="product/pdffile", blank=True,
null=True, help_text="Format: Files should be named in all lower case with
leading zeros and ONLY product codes e.g pm01.pdf")
product_code = models.CharField(max_length=8, help_text="Format: All caps,
no spaces, include leading zero's, e.g DC01B")
...
... and in the admin as:
from cartridge.shop.admin import CategoryAdmin, ProductAdmin, ProductVariation,
ProductOption, Order
...
class BaseProductAdmin(ProductAdmin):
fieldsets = product_fieldsets
additional_fieldsets = ("product_height", "product_width",
"product_projection", "product_diameter", "product_length",
"cornice_picture", "cornice_profile_picture",
"cornice_wall_height", "cornice_ceiling_projection",
"cornice_pattern_repeat", "internal_height",
"internal_width", "priority",)
fieldsets.append(
(_("Additional"), {
"fields": tuple(additional_fieldsets),
}))
list_display = product_list_display
list_filter = ("status", "available", "categories", "product_type",
"updated")
def has_module_permission(self, request):
for (name, items) in settings.ADMIN_MENU_ORDER:
if "stevensons_shop.BaseProduct" in items:
return True
return False
admin.site.register(BaseProduct, BaseProductAdmin)
This used to work fine in previous versions of the system (those installed
directly from pip), however I wanted to take advantage of some of the fixes
in newer versions.
However this has had the adverse affect of breaking my admin area. Whereas
before I could simply click on the "Base product" sidebar link and get
taken to my admin view I now am immediately redirected to the generic
/admin/shop/product view that only contains the basic information for my
product and none of my extended fields, I'm aware that there have been some
pretty major changes that happened in commit #8d3ac6b
<https://github.com/stephenmcd/cartridge/commit/8d3ac6bef9ca4f557edcd4d714a02f69644570dc#diff-79b579f857f436c0b1f13b7397ed6c00>
however
I am currently at a loss trying to figure out what I need to do to get this
working again.
Any suggestions are greatly appreciated.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.