File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11AndroidCodeGenerator
22====================
3+ ** Note, this is a work in progress**
34
45This is a python module which generates Android classes. It is most useful for creating an initial database and contentprovider for a project.
56
@@ -11,6 +12,8 @@ The database structure is basically the same as the one I present in my [tutoria
1112Please see _ sample.py_ for an example of how to generate all the database files and the
1213sample project in _ /sample/_ where they are used. The sample is a modified version of the
1314tutorial project mentioned above so check that out for a preview of the app itself.
15+ _ sample_with_triggers.py_ shows a simple example where a database trigger is defined
16+ as well.
1417
1518An example generation
1619can be seen below where quite a simple table is created and
@@ -26,7 +29,7 @@ t = Table('Album').add_cols(Column('albumname').text.not_null.default("''"), \
2629 .on_delete_cascade,\
2730 Unique(' albumname' ).on_conflict_replace)
2831
29- print (DBItem(t))
32+ print (DBItem(t, pkg = " com.example.appname.database " ))
3033```
3134
3235Result:
You can’t perform that action at this time.
0 commit comments