Skip to content

rodolphebarbanneau/demo-plateforme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plateforme demo projet

Setup

Install dependencies

Plateforme dependency targets the main branch of the framework repository!

uv sync -U

Get help

uv run plateforme --help
uv run plateforme [command] --help

Setup the server

uv run plateforme build

Start the server

uv run plateforme start --reload

Run the shell and interact with the server

It launches a shell with the server application loaded and the namespace variables:

  • app: the loaded application
  • plateforme: the plateforme module
uv run plateforme shell

>>> app
Plateforme('plateforme-demo-application')

>>> from packages.users import User
>>> with app.session() as session:
...     user = User(username='john', email='[email protected]', password='123')
...     session.add(user)
...     session.commit(expire=False)

>>> user
User(id=1, username='john', email='[email protected]')

>>> user.password
SecretStr('**********')

>>> from packages.social import Tweet
... with app.session() as session:
...     tweet = Tweet(owner='1', content='My first tweet')
...     tweet = session.merge(tweet)
...     session.add(tweet)
...     session.commit()

>>> with app.session() as session:
...     session.query(Tweet).all()
[Tweet(id=1)]

>>> plateforme
<module 'plateforme' from '...'>

>>> plateforme.runtime.resources
{'packages.users.users.User': <class 'packages.users.users.User'>, ...}

>>> plateforme.framework.VERSION
'0.1.0-a1'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published