def create_object(self, text):
if self.create_field == '<STR_LIT:name>':<EOL><INDENT>if text.startswith('<STR_LIT>'):<EOL><INDENT>this_id = text[len('<STR_LIT>'):]<EOL>this_loc = Location.objects.get(id=this_id)<EOL>return self.get_queryset().get_or_create(<EOL>name=this_loc.name,location=this_loc<EOL>)[<NUM_LIT:0>]<EOL><DEDENT>elif text.startswith('<STR_LIT>'):<EOL><INDENT>this_id = text[len('<STR_LIT>'):]<EOL>this_member = StaffMember.objects.get(id=this_id)<EOL>return self.get_queryset().get_or_create(<EOL>name=this_member.fullName,staffMember=this_member,<EOL>defaults={'<STR_LIT:user>': getattr(this_member,'<STR_LIT>',None)}<EOL>)[<NUM_LIT:0>]<EOL><DEDENT>elif text.startswith('<STR_LIT>'):<EOL><INDENT>this_id = text[len('<STR_LIT>'):]<EOL>this_user = User.objects.get(id=this_id)<EOL>return self.get_queryset().get_or_create(<EOL>name=this_user.get_full_name(),user=this_user,<EOL>defaults={'<STR_LIT>': getattr(this_user,'<STR_LIT>',None)}<EOL>)[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return self.get_queryset().get_or_create(<EOL>name=text,staffMember=None,user=None,location=None<EOL>)[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return super(TransactionPartyAutoComplete,self).create_object(text)<EOL><DEDENT>
Allow creation of transaction parties using a full name string.