feat(projects): 新增Django综合案例示例代码及素材
This commit is contained in:
28
projects/web-django/orm.py
Normal file
28
projects/web-django/orm.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from dataclasses import dataclass
|
||||
from pprint import pprint
|
||||
|
||||
|
||||
@dataclass
|
||||
class User:
|
||||
name: str
|
||||
age: int
|
||||
email: str
|
||||
telephone: str
|
||||
|
||||
|
||||
table = [
|
||||
User(
|
||||
name="John",
|
||||
age=25,
|
||||
email="example.john@sspai.com",
|
||||
telephone="021-12345678",
|
||||
),
|
||||
User(
|
||||
name="Steve",
|
||||
age=30,
|
||||
email="example.steve@sspai.com",
|
||||
telephone="000-1111-1111",
|
||||
),
|
||||
]
|
||||
|
||||
pprint(table)
|
||||
Reference in New Issue
Block a user