def task_type_restore(items): for item in items: mtype = MemberType(key_name=item['typeId']) mtype.order = item['order'] mtype.name = item['name'] mtype.fee = item['fee'] mtype.put()
def import_types(self, type_csv): types = [] lines = type_csv.split('\n') for line in lines: if len(line.strip()) > 0: fields = line.split(';') membertype = MemberType() membertype.order = int(fields[0]) membertype.name = fields[1].strip() membertype.fee = int(fields[2]) membertype.put() types.append(membertype) return membertype
def import_types(self, type_csv): types = [] lines = type_csv.split('\n') for line in lines: if len(line.strip()) > 0: fields = line.split(';') membertype = MemberType() membertype.order = int(fields[0]) membertype.name = fields[1].strip() membertype.fee = int(fields[2]) membertype.put() types.append(membertype) return membertype;