Skip to content

Commit

Permalink
[SEBA-217] Certain fields should be marked as readonly
Browse files Browse the repository at this point in the history
Change-Id: Ic8de963a878a8c85f1fb0706e08a93d39c7dc913
  • Loading branch information
himanshu-bhandari01 committed May 14, 2020
1 parent 51d71c1 commit 05c0698
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.2-dev
4.0.2
8 changes: 4 additions & 4 deletions lib/xos-genx/xosgenx/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ def _write_split_target(rendered, dir, quiet):

lines = rendered.splitlines()
current_buffer = []
for l in lines:
if l.startswith("+++"):
for line in lines:
if line.startswith("+++"):

if dir:
path = dir + "/" + l[4:].lower()
path = dir + "/" + line[4:].lower()

fil = open(path, "w")
buf = "\n".join(current_buffer)
Expand All @@ -197,7 +197,7 @@ def _write_split_target(rendered, dir, quiet):

current_buffer = []
else:
current_buffer.append(l)
current_buffer.append(line)

@staticmethod
def _find_message_by_model_name(messages, model):
Expand Down
18 changes: 9 additions & 9 deletions lib/xos-genx/xosgenx/jinja2_extensions/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,22 @@ def xproto_default_to_gui(default):
def xproto_links_to_modeldef_relations(llst):
outlist = []
seen = []
for l in llst:
for ll in llst:
try:
t = l["link_type"]
t = ll["link_type"]
except KeyError as e:
raise e

if l["peer"]["fqn"] not in seen and t != "manytomany":
if ll["peer"]["fqn"] not in seen and t != "manytomany":
on_field = "null"
if l["link_type"] == "manytoone":
on_field = l["src_port"]
elif l["link_type"] == "onetomany":
on_field = l["dst_port"]
if ll["link_type"] == "manytoone":
on_field = ll["src_port"]
elif ll["link_type"] == "onetomany":
on_field = ll["dst_port"]
outlist.append(
"{model: %s, type: %s, on_field: %s}"
% (l["peer"]["name"], l["link_type"], on_field)
% (ll["peer"]["name"], ll["link_type"], on_field)
)
seen.append(l["peer"])
seen.append(ll["peer"])

return outlist
4 changes: 2 additions & 2 deletions xos/core/models/core.xproto
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ message User::user_policy (AbstractBaseUser,PlModelMixIn) {
required bool is_registering = 16 [default = False, db_index = False];
required bool is_appuser = 17 [default = False, db_index = False];
optional string login_page = 18 [max_length = 200, content_type = "stripped", blank = True, help_text = "send this user to a specific page on login", db_index = False];
required string created = 19 [content_type = "date", auto_now_add = True, help_text = "Time this model was created"];
required string created = 19 [content_type = "date", auto_now_add = True, help_text = "Time this model was created", bookkeeping_state = True];
required string updated = 20 [default = "now()", content_type = "date", help_text = "Time this model was changed by a non-synchronizer"];
optional string enacted = 21 [content_type = "date", blank = True, default = None, help_text = "When synced, set to the timestamp of the data that was synced"];
optional string policed = 22 [content_type = "date", blank = True, default = None, help_text = "When policed, set to the timestamp of the data that was policed"];
Expand All @@ -83,7 +83,7 @@ message User::user_policy (AbstractBaseUser,PlModelMixIn) {
required string timezone = 32 [default = "America/New_York", max_length = 100, blank = False, db_index = False];
optional string policy_status = 33 [default = "0 - Policy in process", max_length = 1024];
optional int32 policy_code = 34 [default = 0];
required string leaf_model_name = 35 [max_length = 1024, help_text = "The most specialized model in this chain of inheritance, often defined by a service developer"];
required string leaf_model_name = 35 [max_length = 1024, help_text = "The most specialized model in this chain of inheritance, often defined by a service developer", bookkeeping_state = True];
required bool backend_need_delete_policy = 36 [default = False, help_text = "True if delete model_policy must be run before object can be reaped"];
required bool xos_managed = 37 [default = True, help_text = "True if xos is responsible for creating/deleting this object", gui_hidden = True];
optional string backend_handle = 38 [max_length = 1024, feedback_state = True, blank=True, help_text = "Handle used by the backend to track this object", gui_hidden = True];
Expand Down

0 comments on commit 05c0698

Please sign in to comment.