Skip to content

Commit

Permalink
fix some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyq0826 committed Feb 24, 2016
1 parent 0be1534 commit 0b16625
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/intro.md
Expand Up @@ -53,4 +53,4 @@ python main.py

Open your broswer and visite [http://localhost:8888](http://localhost:8888)

Server default start on port 8888, you can change this `python main.py --port=8890`
Server start on port 8888 default, you can change this `python main.py --port=8890`
4 changes: 2 additions & 2 deletions docs/tutorial/app.md
@@ -1,6 +1,6 @@
#### What is app-server

App-server is web application, be made fo one or more sub app, each sub app easily migrited and resue
App-server is web application, be made of one or more sub app, each sub app easily migrited and resue


`app-server` directory skeleton
Expand All @@ -18,7 +18,7 @@ App-server is web application, be made fo one or more sub app, each sub app easi
│   ├── base.py
│   ├── __init__.py
│   ├── setting.py
├── main.py # entry port
├── main.py # entry
├── setting.py
├── templates
│   └── user
Expand Down
15 changes: 10 additions & 5 deletions docs/tutorial/helper.md
Expand Up @@ -8,25 +8,30 @@ Helper is business lagic layer.
```
helpers/
├── wallpaper # mongodb databse instance mappig, one instance helper
├── wallpaper # each package in helpers represents one mongodb databse instance
│   ├── album.py
│   ├── category.py
│   ├── image.py
│   ├── img2tag.py
│   ├── __init__.py
│   └── tag.py
├── __init__.py
├── settings.py
├── settings.py # here is package needed to be installed automatically
```

#### Create helper

In helpers package, create package that `__init__.py` with `__all__` list attribute explicitly.
Add '__all__' list attribute explicitly into helper package `wallpaper` `__init__.py` file.
It's job is to include all modules needed to be used.

```python
__all__ = ['img2tag']

```

Put `module` in `__all__` list

Install helper in helpers/setting.py
Install helper in `helpers/setting.py`

```
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/index.md
Expand Up @@ -16,6 +16,6 @@ Turbo application directory tree skeleton is below:

[app-server](app-server) is a web app, not python package. Turbo application can have one or many app-server, each with different name.

[helpers](helpers) is model sechema instance, responsible for business logic.
[helpers](helpers) is model instance, responsible for business logic.

`db` is support for mongodb connections
20 changes: 12 additions & 8 deletions docs/tutorial/model.md
@@ -1,6 +1,6 @@
#### What is `model`

Instances of model represent mongodb collection, model defines the collection schema.
Instance of model `Class` represents mongodb collection, model defines the collection schema.


`models` directory skeleton
Expand All @@ -13,21 +13,25 @@ models
├── user
│   ├── __init__.py
│   ├── base.py
│   ├── model.py # all model class, each represents one mongodb collection
│   ├── model.py # all model Class, each represents one mongodb collection
│   └── setting.py # setting for user model
```


#### Create model

In models package create package like bellow
In models package create package `user` like bellow


* __init__.py
* base.py
* setting.py
* model.py
```bash
user
├──__init__.py
├── base.py
├── model.py
└── setting.py

```


Put code in `base.py`
Expand All @@ -46,7 +50,7 @@ class Model(BaseModel):
```


Create Class inherited `turbo.model.BaseModel`
Create `Class` inherited from `turbo.model.BaseModel`

```
from base import *
Expand Down

0 comments on commit 0b16625

Please sign in to comment.