Use for generate angular curd codes.
Project description
Install
Usage
- generate angular codes
# declare model by pydantic
class Users(BaseModel):
id: int
username: str
password: Optional[str] = None
firstname: str
lastname: str
nickname: str = ''
gender: str
birthday: str
role: str
email: str
mobile: str
address: str
active: int
created: datetime
# declare model admin
class UsersAdmin(ModelAdmin):
model_fields = ('id', 'username', 'lastname', 'firstname', 'gender', 'birthday', 'role', 'active', 'created')
list_display_restraint = model_fields
list_editable_restraint = ('username', 'gender')
model_edit_fields = ('username', 'lastname', 'firstname', 'gender', 'birthday', 'role', 'active')
model_create_fields = model_edit_fields
model_translate_fields = ('ID', '用户名', '姓氏', '名字', '性别', '生日', '角色', '是否激活', '创建时间')
# generate angular codes
mr = ModelRegister(model_admin=UsersAdmin, model=Users, app_name='first')
mr.register()
# copy all files to angular src/app
- add module to imports in app.module.ts or add module router to imports in app-routing.module.ts
frontend
once
- install
ng new project-name --no-standalone
ng add ng-zorro-antd
npm install dayjs
code
- env
ng g environments # angular17
# set backend: 'http://localhost:8000'
- config icon
- angular.json
"styles": [
"node_modules/ng-zorro-antd/ng-zorro-antd.min.css",
"src/styles.css"
],
- app.component.html
<router-outlet></router-outlet>
module
- add module to imports in app.module.ts
- or add module router to imports in app-routing.module.ts
- 0.1.0 Generate angular and rust axum codes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
angularcurdgen-0.1.0.tar.gz
(15.6 kB
view details)
Built Distribution
File details
Details for the file angularcurdgen-0.1.0.tar.gz
.
File metadata
- Download URL: angularcurdgen-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2bf38628b144c3e3157fe2e41e92b4fa4d530ff4b28f085056908e6a1c67fd |
|
MD5 | 6717be93dab454ddbcf81cb9ca25c42f |
|
BLAKE2b-256 | 569d848434a25b1fa01d0f470e7d6491399c2a2eca31c441eafba3ae4a213371 |
File details
Details for the file AngularCurdGen-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: AngularCurdGen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7518bd7b21302745516412fb8612484b42e04a002a1f738bcbd9ff7e370f14f |
|
MD5 | 0b17ac065492f4a48efb4a52df7d5bf1 |
|
BLAKE2b-256 | d4ced5e34f240d44c069da9677dec2ce1bcec6b206256f93e437d5a4303b89d1 |