i want to put a button into wagtail admin for inspect in view mode, by default edit and delete are shown, but i don't know what need to do for call a view that contain only view of a model
here is my code:
products.models.py
class CamisaOrder(models.Model):
STATUS_CHOICES = (
('PAYMENTVERFICATION','Verificacion Forma Pago'), ('PROCESSINGORDER','Procesando Orden'),
('MAKING','Elaboracion'),
('PROCESSINGSHIPING','Preparando Envio'),
('SHIPPED','Enviado'),
('DELIVERED','Recibido'),
('CANCELED','Cancelado'),
('RETURNED','Retornado'),
)
camisa = models.ForeignKey('CamisetaProduct',related_name='+', on_delete= models.PROTECT)
cantidad = models.IntegerField()
status = models.CharField(max_length=20, null=False, blank=False, choices=STATUS_CHOICES, default="PROCESSINGORDER")
panels = [
FieldPanel('camisa'),
FieldPanel('cantidad'),
FieldPanel('status')
]
class Meta:
verbose_name="Camisa Orden"
verbose_name_plural="Camisas Ordenes"
wagtail_hooks.py
class ProductButtonHelper(ButtonHelper):
view_button_classnames = ['button-small', 'icon', 'icon-site']
def view_button(self, obj):
# Define a label for our button
text = 'View {}'.format(self.verbose_name)
logging.debug(obj)
return {
'url': #url here for inspect model#
'label': text,
'classname': self.finalise_classname(self.view_button_classnames),
'title': text,
}
def get_buttons_for_obj(self, obj, exclude=None, classnames_add=None, classnames_exclude=None):
btns = super().get_buttons_for_obj(obj, exclude, classnames_add, classnames_exclude)
if 'view' not in (exclude or []):
btns.append(
self.view_button(obj)
)
return btns
class CamisetaOrderAdmin(ModelAdmin):
model = CamisaOrder
button_helper_class = ProductButtonHelper
menu_label = 'Pedidos y Ordenes'
menu_icon = 'mail'
menu_order = 200
add_to_settings_menu = False
exclude_from_explorer = False
list_display = ('camisa', 'cantidad', 'status')
list_filter = ('status',)
search_fields = ( 'status',)
modeladmin_register(CamisetaOrderAdmin)
how i can achieve this approach?
i need to do a custom view and insert into wagtail admin model if is this, how can i do that ? can i make a model form like popup showing custom actions for models? something like change his state or some value

