Subversion Repositories SmartDukaan

Rev

Rev 15312 | Rev 15314 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15312 Rev 15313
Line 1027... Line 1027...
1027
            else:
1027
            else:
1028
                m = re.match("(.*?)(\d{6})(.*?)", contact)
1028
                m = re.match("(.*?)(\d{6})(.*?)", contact)
1029
                if m is not None:
1029
                if m is not None:
1030
                    pin = m.group(2)
1030
                    pin = m.group(2)
1031
                    contact = m.group(1) if m.group(1) != '' else m.group(3)
1031
                    contact = m.group(1) if m.group(1) != '' else m.group(3)
1032
                    anotherCondition = and_(Retailers.title.ilike('%%%s%%'%(contact)), Retailers.pin==pin))
1032
                    anotherCondition = and_(Retailers.title.ilike('%%%s%%'%(contact)), Retailers.pin==pin)
1033
                else:
1033
                else:
1034
                    anotherCondition = Retailers.title.ilike('%%%s%%'%(contact))
1034
                    anotherCondition = Retailers.title.ilike('%%%s%%'%(contact))
1035
            
1035
            
1036
            retailers = session.query(Retailers).filter(anotherCondition).all()
1036
            retailers = session.query(Retailers).filter(anotherCondition).all()
1037
            if retailers is None:
1037
            if retailers is None: