mirror of
https://github.com/pinry/pinry.git
synced 2026-01-21 14:42:07 +01:00
Doc: Refine loader description
This commit is contained in:
@@ -3,10 +3,10 @@
|
|||||||
New plugin system is under development and a naive version has been released.
|
New plugin system is under development and a naive version has been released.
|
||||||
|
|
||||||
A `PinryPlugin` is a python class or object which is callable.
|
A `PinryPlugin` is a python class or object which is callable.
|
||||||
The plugin loader will call the plugin argument only once and use the plugin
|
The plugin loader will call the `Plugin` target only once and use the plugin
|
||||||
instance after specified events triggered just like the way django-middleware works.
|
instance after specified events triggered just like the way django-middleware works.
|
||||||
|
|
||||||
You could create a plugin as python-package with content:
|
You could create a plugin as python-package with content below:
|
||||||
|
|
||||||
```
|
```
|
||||||
from core.models import Image
|
from core.models import Image
|
||||||
@@ -16,7 +16,7 @@ from django_images.models import Thumbnail
|
|||||||
class Plugin:
|
class Plugin:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# do something you want, just be called only
|
# do something you want, just be called only once
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def process_image_pre_creation(self, django_settings, image_instance: Image):
|
def process_image_pre_creation(self, django_settings, image_instance: Image):
|
||||||
|
|||||||
Reference in New Issue
Block a user