wagtail-packages / wagtail-qrcode Goto Github PK
View Code? Open in Web Editor NEWThis package can be used to create a page in Wagtail CMS that has a corresponding QR Code.
License: MIT License
This package can be used to create a page in Wagtail CMS that has a corresponding QR Code.
License: MIT License
Be nice to be able to customise the email message when sending the qr-code
In lines 29 and 30 of wagtail_hooks.py
,
rev = page.save_revision()
rev.publish()
will throw seg fault if page has not been published (e.g. draft status)
My workaround is
rev = page.save_revision()
if page.live:
rev.publish()
When deleting a page, this code is called
@hooks.register("after_delete_page")
def delete_document(request, page):
doc = get_document_model().objects.filter(id=page.qr_code_eps.id)
if doc:
doc.delete()
However, when a proxy page model is called, this throws a seg fault, complaining that
"'NoneType' object has no attribute 'id'".
My money patch is to change page.qr_code_eps.id
to page.specific.qr_code_eps.id
.
@hooks.register("after_delete_page")
def delete_document(request, page):
if hasattr(page, 'qr_code_eps') and page.specific.qr_code_eps:
doc = get_document_model().objects.filter(id=page.specific.qr_code_eps.id)
if doc:
doc.delete()
If you choose to save a page as a draft it gets published.
The workaround is to un-publish the page.
A fix will be made available soon.
This triggers for all pages. Make sure it only triggers for pages inheriting from https://github.com/nickmoreton/wagtail-qrcode/blob/c71a308bd683f76fd01920bf4f9586ae2df17c86/wagtail_qrcode/models.py#L20
I think here it could be implemented with a Wagtail VERSION conditional and use either a DocumentChooserPanel or FieldPanel
Maybe the extra documentation about this is no longer required: #17
This is a typo but it's not affecting the package in any way.
I suggest it's fixed in the next update. It's also shown in the docs so update that too.
When using the package on a Wagtail <3 the mixin panels don't work correctly.
e.g. if this was in use on a Wagtail v2.15/2.16 site then it should be a DocumentChooserPanel
It's possible to add your own panels but it's not documented yet.
This could be fixed in #21
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.