-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
344 additions
and
44 deletions.
There are no files selected for viewing
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,28 @@ | ||
import datetime # noqa: F401 | ||
import uuid # noqa: F401 | ||
|
||
from pydantic import BaseModel, Field # noqa: F401 | ||
|
||
|
||
class UserCreationForm(BaseModel): | ||
name: str = Field(title="Username", description="max length: 50", max_length=50) | ||
|
||
|
||
# class UserDeletionForm(BaseModel): | ||
# confirm: bool = False | ||
|
||
|
||
class UserUpdateForm(BaseModel): | ||
new_name: str = Field( | ||
title="New Username", description="max length: 50", max_length=50 | ||
) | ||
|
||
|
||
################################ | ||
# Event | ||
################################ | ||
|
||
|
||
################################ | ||
# Health | ||
################################ |
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,2 @@ | ||
with user:= assert_single((select User{events:= .<host[is Event]} filter .name=<str>$name)), | ||
select not exists user.events; |
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,20 @@ | ||
# AUTOGENERATED FROM 'app/fastui/queries/check_user_deletable.edgeql' WITH: | ||
# $ edgedb-py | ||
|
||
|
||
from __future__ import annotations | ||
import edgedb | ||
|
||
|
||
async def check_user_deletable( | ||
executor: edgedb.AsyncIOExecutor, | ||
*, | ||
name: str, | ||
) -> bool: | ||
return await executor.query_single( | ||
"""\ | ||
with user:= assert_single((select User{events:= .<host[is Event]} filter .name=<str>$name)), | ||
select not exists user.events;\ | ||
""", | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from __future__ import annotations as _annotations | ||
|
||
from fastui import AnyComponent | ||
from fastui import components as c | ||
from fastui.events import GoToEvent | ||
|
||
|
||
def demo_page( | ||
*components: AnyComponent, title: str | None = None | ||
) -> list[AnyComponent]: | ||
return [ | ||
c.PageTitle(text=f"EdgeDB FastUI — {title}" if title else "EdgeDB FastUI"), | ||
c.Navbar( | ||
title="EdgeDB FastUI", | ||
title_event=GoToEvent(url="/"), | ||
start_links=[ | ||
c.Link( | ||
components=[c.Text(text="users")], | ||
on_click=GoToEvent(url="/users/"), | ||
active="startswith:/users", | ||
), | ||
], | ||
), | ||
c.Page( | ||
components=[ | ||
*((c.Heading(text=title),) if title else ()), | ||
*components, | ||
], | ||
), | ||
c.Footer( | ||
extra_text="EdgeDB FastUI", | ||
links=[ | ||
c.Link( | ||
components=[c.Text(text="Github")], | ||
on_click=GoToEvent(url="https://github.com/pydantic/FastUI"), | ||
), | ||
c.Link( | ||
components=[c.Text(text="PyPI")], | ||
on_click=GoToEvent(url="https://pypi.org/project/fastui/"), | ||
), | ||
c.Link( | ||
components=[c.Text(text="NPM")], | ||
on_click=GoToEvent(url="https://www.npmjs.com/org/pydantic/"), | ||
), | ||
], | ||
), | ||
] |
Oops, something went wrong.