Ulrich
1 year ago
10 changed files with 38 additions and 100 deletions
@ -1,49 +0,0 @@ |
|||
#!/usr/bin/python |
|||
# -*- coding: utf-8 -*- |
|||
# --------------------------------------------------------------------------------------------------------- |
|||
# Author : Ulrich Carmesin |
|||
# Source : gitea.ucarmesin.de |
|||
# --------------------------------------------------------------------------------------------------------- |
|||
import basic.toolHandling |
|||
import utils.data_const as D |
|||
import basic.constants as B |
|||
import model.entity |
|||
|
|||
ddl = { |
|||
"user": { |
|||
"id": { |
|||
D.DDL_TYPE: D.TYPE_PK, |
|||
}, |
|||
"username": { |
|||
D.DDL_TYPE: D.TYPE_STR, |
|||
}, |
|||
"password": { |
|||
D.DDL_TYPE: D.TYPE_STRING, |
|||
} |
|||
} |
|||
} |
|||
|
|||
class User(model.entity.Entity): |
|||
username = "" |
|||
password = "" |
|||
|
|||
def __init__(self, job): |
|||
""" |
|||
to be initialized by readSpec |
|||
:param job: |
|||
""" |
|||
self.job = job |
|||
self.conf = {} |
|||
self.conf[B.TOPIC_CONN] = self.getDbAttr(job) |
|||
self.conf[B.DATA_NODE_DDL] = self.getDdl(job, ddl) |
|||
self.m = job.m |
|||
|
|||
def get_schema(self): |
|||
dbtype = self.job.conf[B.TOPIC_NODE_DB][B.ATTR_TYPE] |
|||
dbi = basic.toolHandling.getDbTool(self.job, None, dbtype) |
|||
sql = dbi.getCreateTable("user") |
|||
sql += dbi.getSchemaAttribut("id", "id")+"," |
|||
sql += dbi.getSchemaAttribut("username", D.TYPE_STR)+"," |
|||
sql += dbi.getSchemaAttribut("password", D.TYPE_STR) |
|||
sql += ");\n" |
|||
return sql |
@ -0,0 +1,5 @@ |
|||
{% extends 'base.html' %} |
|||
|
|||
{% block header %} |
|||
<h1>{% block title %}Overview{% endblock %}</h1> |
|||
{% endblock %} |
Loading…
Reference in new issue