-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
save function calls to db and show in steps
add pre/post functions to all recipes enable variables in functions lazy load details and steps
- Loading branch information
Showing
30 changed files
with
664 additions
and
192 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
bots/migrations/0076_alter_workflowmetadata_default_image_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 4.2.7 on 2024-07-05 13:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bots', '0075_alter_publishedrun_workflow_alter_savedrun_workflow_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='workflowmetadata', | ||
name='default_image', | ||
field=models.URLField(blank=True, default='', help_text='Image shown on explore page'), | ||
), | ||
migrations.AlterField( | ||
model_name='workflowmetadata', | ||
name='help_url', | ||
field=models.URLField(blank=True, default='', help_text='(Not implemented)'), | ||
), | ||
migrations.AlterField( | ||
model_name='workflowmetadata', | ||
name='meta_keywords', | ||
field=models.JSONField(blank=True, default=list, help_text='(Not implemented)'), | ||
), | ||
migrations.AlterField( | ||
model_name='workflowmetadata', | ||
name='short_title', | ||
field=models.TextField(help_text='Title used in breadcrumbs'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import typing | ||
from enum import Enum | ||
|
||
import typing_extensions | ||
|
||
T = typing.TypeVar("T", bound="GooeyEnum") | ||
|
||
|
||
class GooeyEnum(Enum): | ||
@classmethod | ||
def db_choices(cls): | ||
return [(e.db_value, e.label) for e in cls] | ||
|
||
@classmethod | ||
def from_db(cls, db_value) -> typing_extensions.Self: | ||
for e in cls: | ||
if e.db_value == db_value: | ||
return e | ||
raise ValueError(f"Invalid {cls.__name__} {db_value=}") | ||
|
||
@classmethod | ||
@property | ||
def api_choices(cls): | ||
return typing.Literal[tuple(e.name for e in cls)] | ||
|
||
@classmethod | ||
def from_api(cls, name: str) -> typing_extensions.Self: | ||
for e in cls: | ||
if e.name == name: | ||
return e | ||
raise ValueError(f"Invalid {cls.__name__} {name=}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.