def render(self, session, organization, fullname, comments, **arguments): if organization: org = session.query(Location).filter_by(location_type='company', name=organization).first() if org: raise ArgumentError("Organization %s already exists." % organization) if not fullname: fullname = organization dborg = Company(name=organization, fullname=fullname, comments=comments) session.add(dborg) session.flush()