Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DjWebdApp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pyratzlabs
DjWebdApp
Merge requests
!10
Remove custom signals until we figure an actual use case
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove custom signals until we figure an actual use case
signals
into
master
Overview
0
Commits
2
Pipelines
3
Changes
7
Merged
jpic ∞
requested to merge
signals
into
master
3 years ago
Overview
0
Commits
2
Pipelines
3
Changes
2
Expand
0
0
Merge request reports
Compare
version 1
version 2
42c70052
3 years ago
version 1
241aee63
3 years ago
master (base)
and
latest version
latest version
6949c4ad
2 commits,
3 years ago
version 2
42c70052
1 commit,
3 years ago
version 1
241aee63
1 commit,
3 years ago
Show latest version
2 files
+
38
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
docs/examples.rst
0 → 100644
+
37
−
0
Options
djWebdApp Examples
~~~~~~~~~~~~~~~~~~
Chaining blockchain calls
-------------------------
This example demonstrates how to generate an initial mint call to deploy
whenever a new contract is deployed:
.. code-block:: python
from djwebdapp_tezos.models import TezosTransaction
from django.db.models import signals
from django.dispatch import receiver
@receiver(signals.post_save, sender=TezosTransaction)
def auto_mint(sender, instance, **kwargs):
if not instance.address:
# we're not a contract or not ready
return
if instance.call_set.count() > 1:
# we have a mint already
return
mint = TezosTransaction.objects.create(
sender=instance.sender,
state='deploy',
max_fails=2,
contract=instance,
function='mint',
args=(
instance.sender.address,
1000,
),
)
Loading