Skip to content

Commit

Permalink
New schema (multiple apps).
Browse files Browse the repository at this point in the history
  • Loading branch information
illagrenan committed Apr 27, 2016
1 parent a2a3f40 commit a4d5cb2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ $RECYCLE.BIN/
/activate3.ps1
/.install
/activate_install.ps1
/app_schema.yaml
26 changes: 16 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,24 @@ Python ``3.3`` is not supported due to incompatibility of yapf (see: https://git
Usage
-----

If you want to generate app called ``library``, create a file ``library.yaml`` in project's root and define models:
If you want to generate app called ``library``, create a file ``app_schema.yaml`` in project's root and define models:

.. code:: yaml
app_name: library # all files will be generated into library/ directory (will be created)
models:
- User: # model name
- name:char # model field "name" of type "char"
- email:char # model field "email" of type "char"
- Book: # another model
- library:fk # model field "library" of type "foreign key" to "library"
- Library # empty model without fields
apps:
-
name: library # all files will be generated into library/ directory (will be created)
models:
- User: # model name
- name:char # model field "name" of type "char"
- email:char # model field "email" of type "char"
- Book: # another model
- library:fk # model field "library" of type "foreign key" to "library"
- Library # empty model without fields
-
name: my_another_awesome_app
models:
- Foo
- Bar
You can also print example configuration by:

Expand Down
10 changes: 0 additions & 10 deletions app_schema.yaml

This file was deleted.

19 changes: 12 additions & 7 deletions django_make_app/templates/example.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
apps:
-
name: web
name: library # all files will be generated into library/ directory (will be created)
models:
- User:
- name:char
- email:char
- Book:
- library:fk
- Library
- User: # model name
- name:char # model field "name" of type "char"
- email:char # model field "email" of type "char"
- Book: # another model
- library:fk # model field "library" of type "foreign key" to "library"
- Library # empty model without fields
-
name: my_another_awesome_app
models:
- Foo
- Bar

0 comments on commit a4d5cb2

Please sign in to comment.