from pampy import _ pat = [] # lookup field p0 = { "attributes": { "fieldName": _, "fieldId": _, "isLookUpField": True, "displayName": _ }, "lookUpDisplay": _, "dataTypeDetails": { "type": "lookup" }, "fieldValue": _ } def pp0(a,b,c,d,e): r = ("lookup field", {'fieldname':a,'id':b,'displayname':c,'lookupdisplay':d,'value':e}) #print(r) return r # num field p1 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": False, "displayName": _, }, "dataTypeDetails": {"scale": _, "type": "numeric", "precision": _, }, "fieldValue": _, } def pp1(a,b,c,d,e,f): #r = "Generic Num Field: Name: %s, ID: %s, Displayname: %s, Value: %s" % (a,b,c,f) r = ("num field", {'fieldname':a,'id':b,'displayname':c,'value':f}) #print(r) return r # string field p2 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": False, "displayName": _, }, "dataTypeDetails": {"type": "string", "maxLength": _, }, "fieldValue": _, } def pp2(a,b,c,d,e): #r = "String Label: %s (id %s) Value: %s" % (a,b,e) r = ("string field", {'fieldname':a,'id':b,'displayname':c,'value':e}) #print(r) return r # flag field p3 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": False, "displayName": _, }, "dataTypeDetails": {"type": "flag", }, "fieldValue": _, } def pp3(a,b,c,d): #r = "Generic Flag Field: Name: %s, ID: %s, Displayname: %s, Value: %s" % (a,b,c,d) r = ("flag field", {'fieldname':a,'id':b,'displayname':c,'value':d}) #print(r) return r # attributes p4 = {"attributes": _, "subsections": _, "fields": _ } def pp4(a,b,c): r = ("attributes", {'attributes':a, 'subsections':b, 'fields':c}) #print(r) return r # section p5 = {"sectionOrInstance": "section", "sectionName": _, "sectionSortOrder": _, "oneToManySection": _, } def pp5(a,b,c): r = ("section", {'name':a, 'sortorder':b, 'onetomanysection':c}) #print(r) return r # sectionInstance p6 = {"instanceId": _, "sectionOrInstance": "sectionInstance", "instanceSortOrder": _, "sectionName": _, } def pp6(a,b,c): r = ("sectioninstance", {'id':a, 'sortorder':b, 'name':c }) #print(r) return r pat.append( p0 ) pat.append( pp0 ) pat.append( p1 ) pat.append( pp1 ) pat.append( p2 ) pat.append( pp2 ) pat.append( p3 ) pat.append( pp3 ) pat.append( p4 ) pat.append( pp4 ) pat.append( p5 ) pat.append( pp5 ) pat.append( p6 ) pat.append( pp6 ) """ curic_patterns.append( { "attributes": { "fieldName": "Division", "fieldId": 65000, "isLookUpField": True, "displayName": "Division" }, "lookUpDisplay": _, "dataTypeDetails": { "type": "lookup" }, "fieldValue": _ } ) def div1(a,b): r = "Division: %s, id: %s" % (a,b) print(r) return(r) curic_patterns.append(div1) curic_patterns.append( { "attributes": { "fieldName": "Department", "fieldId": 65001, "isLookUpField": True, "displayName": "Department" }, "lookUpDisplay": _, "dataTypeDetails": { "type": "lookup" }, "fieldValue": _ }) def d2(a,b): r = "Department: %s, id: %s" % (a,b) print(r) return r curic_patterns.append(d2) curic_patterns.append({ "attributes": { "fieldName": "Award Type", "fieldId": 60221, "isLookUpField": True, "displayName": "Award Type" }, "lookUpDisplay": _, "dataTypeDetails": { "type": "lookup" }, "fieldValue": _ }) def d3(a,b): r = "Award: %s, id: %s" % (a,b) print(r) return r curic_patterns.append(d3) p1 = { "attributes": { "fieldName": "Description", "fieldId": _, "isLookUpField": False, "displayName": "Description" }, "dataTypeDetails": { "type": "string" }, "fieldValue": _ } def pp1(a,b): r = "Description (id:%s) %s" % (a,b) #print(r[:40]) return r curic_patterns.append(p1) curic_patterns.append(pp1) p2 = {"attributes": { "fieldName": "Program Title", "fieldId": _, "isLookUpField": False, "displayName": "Program Title" }, "dataTypeDetails": { "type": "string", "maxLength": 250 }, "fieldValue":_ } def pp2(a,b): r = "Program (id:%s) %s" % (a,b) #print(r) return r curic_patterns.append(p2) curic_patterns.append(pp2) p3 = { "attributes": { "fieldName": "Course", "fieldId": _, "isLookUpField": True, "displayName": "Course" }, "lookUpDataset": [ [ { "name": "Max", "value": _ }, { "name": "IsVariable", "value": _ }, { "name": "Min", "value": _ }, { "name": "Text", "value": _ } ] ], "dataTypeDetails": { "type": "lookup" }, "lookUpDisplay": _, "fieldValue": _ } def pp3(a,b,c,d,e,f,g): r = "Course (%s / %s) %s (%s), var? %s %s - %s" % (a,g, f, e, c, b, d) #print(r) return r curic_patterns.append(p3) curic_patterns.append(pp3) p4 = { "attributes": { "sectionOrInstance": "section", "sectionName": "Unit Range", "sectionSortOrder": 2, "oneToManySection": False }, "subsections": [], "fields": [ { "attributes": { "fieldName": "Units Low", "fieldId": 59608, "isLookUpField": False, "displayName": "Units Low" }, "dataTypeDetails": { "scale": 2, "type": "numeric", "precision": 6 }, "fieldValue": _ }, { "attributes": { "fieldName": "Units High", "fieldId": 59609, "isLookUpField": False, "displayName": "Units High" }, "dataTypeDetails": { "scale": 2, "type": "numeric", "precision": 6 }, "fieldValue": _ } ] } def pp4(a,b): r = "Unit Range: %s - %s" % (a,b) return r curic_patterns.append(p4) curic_patterns.append(pp4) p5 = { "attributes": { "fieldName": "Discipline", "fieldId": _, "isLookUpField": True, "displayName": "Discipline" }, "lookUpDisplay": _, "dataTypeDetails": { "type": "lookup" }, "fieldValue": _ } def pp5(a,b,c): r = "Discipline (%s) %s / %s" % (a,b,c) #print(r) return r curic_patterns.append(p5) curic_patterns.append(pp5) p6 = { "attributes": { "fieldName": "Course Block Definition", "fieldId": _, "isLookUpField": False, "displayName": "Course Block Definition" }, "dataTypeDetails": { "type": "string" }, "fieldValue": _ } def pp6(a,b): r = "Block (%s) %s" % (a,b) #print(r) return r p7 = { "attributes": { "fieldName": "Block Header", "fieldId": _, "isLookUpField": False, "displayName": "Block Header" }, "dataTypeDetails": { "type": "string", "maxLength": 4000 }, "fieldValue": _ } def pp7(a,b): r = "Block Header (%s) %s" % (b,a) #print(r) return r p8 = { "attributes": { "fieldName": "Block Footer", "fieldId": _, "isLookUpField": False, "displayName": "Block Footer" }, "dataTypeDetails": { "type": "string", "maxLength": 4000 }, "fieldValue": _ } def pp8(a,b): r = "Block Footer (%s) %s" % (b,a) #print(r) return r curic_patterns.append(p6) curic_patterns.append(pp6) curic_patterns.append(p7) curic_patterns.append(pp7) curic_patterns.append(p8) curic_patterns.append(pp8) ###################### ###################### Trying to remove more junk ###################### curic_patterns.append(j1) curic_patterns.append(jj1) j3 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": True, "displayName": _, }, "lookUpDisplay": _, "dataTypeDetails": {"type": "lookup", }, "fieldValue": _, } def jj3(a,b,c,d,e): r = "Generic lookup Field: Name: %s / %s, ID: %i, Displayname: %s, Value: %s " % (a,c,b,d,e) #print(r) return r curic_patterns.append(j2) curic_patterns.append(jj2) curic_patterns.append(j3) curic_patterns.append(jj3) curic_patterns.append(j4) curic_patterns.append(jj4) j5 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": False, "displayName": _, }, "dataTypeDetails": {"scale": _, "type": "numeric", "precision": _, }, "fieldValue": _, } def jj5(a,b,c,d,e,f): r = "Numeric Field, Name: %s / %s Id: %s, Value: %s" % (a,c,b,f) #print(r) return r curic_patterns.append(j5) curic_patterns.append(jj5) curic_patterns.append(j6) curic_patterns.append(jj6) """ """j2 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": False, "displayName": _, }, "dataTypeDetails": {"scale": 2, "type": "numeric", "precision": 6, }, "fieldValue": _, } def jj2(a,b,c,d): r = "Generic Num Field: Name: %s, ID: %s, Displayname: %s, Value: %s" % (a,b,c,d) print(r) return r j2 = {"attributes": {"fieldName": _, "fieldId": _, "isLookUpField": False, "displayName": _, }, "dataTypeDetails": {"scale": 2, "type": "numeric", "precision": 6, }, "fieldValue": _, } def jj2(a,b,c,d): r = "Generic Num Field: Name: %s, ID: %s, Displayname: %s, Value: %s" % (a,b,c,d) print(r) return r """