diff --git a/README.md b/README.md index 20737c0..dd25f2b 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ PaaS - creates easily deployable declarative web applications with (moslty) file ## TODO +* [ ] [list] pagination of many items * [ ] [prod_install] Download sensitive prompt * [ ] [vm_gen] Auto generate dependency graph for `view_models/_process_order` * [ ] [auto_dns] Start and test `auto_dns.service` diff --git a/oshipka/persistance/__init__.py b/oshipka/persistance/__init__.py index 0ac1c5b..0e9fbc1 100644 --- a/oshipka/persistance/__init__.py +++ b/oshipka/persistance/__init__.py @@ -325,7 +325,10 @@ def populate_static(app): if row_updates: row.update(row_updates) if model_name == "User": - role_names = row.pop('role_names') + if 'role_names' in row: + role_names = row.pop('role_names') + else: + role_names = "" row['password'] = hash_password(row['password']) user = user_datastore.create_user(**row) for role_name in role_names.split(';'): @@ -334,7 +337,7 @@ def populate_static(app): else: instance = create_model(model, row) db.session.add(instance) - db.session.commit() + db.session.commit() def filter_m_n(serialized_args): diff --git a/vm_gen/templates/html/_create.html b/vm_gen/templates/html/_create.html index 9b97534..c9475ad 100644 --- a/vm_gen/templates/html/_create.html +++ b/vm_gen/templates/html/_create.html @@ -2,7 +2,8 @@ [%- for column in columns %] - + {% endif %} [%- endfor %]
+ {% if "[[ column.name ]]" not in disabled_columns %} +
: [%- if column.type in ['relationship'] %] @@ -14,7 +15,7 @@ [%- if not column.secondary %] [%- endif %] - {% if instance and instance.[[ column.name|pluralize ]] is defined %} + {% if [[ column.name|pluralize ]] is not defined and instance and instance.[[ column.name|pluralize ]] is defined %} {% set [[ column.name|pluralize ]] = instance.[[ column.name|pluralize ]] %} {% else %} {% set [[ column.name|pluralize ]] = model_views.[[ column.name ]].model.query.all() %} @@ -49,6 +50,7 @@ /> [%- endif %]
diff --git a/vm_gen/templates/html/_update.html b/vm_gen/templates/html/_update.html index 45521d1..582ffea 100644 --- a/vm_gen/templates/html/_update.html +++ b/vm_gen/templates/html/_update.html @@ -2,7 +2,8 @@ [%- for column in columns %] - + {% endif %} [%- endfor %]
+ {% if "[[ column.name ]]" not in disabled_columns %} +
: [%- if column.type in ['relationship'] %] @@ -49,6 +50,7 @@ /> [%- endif %]