-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
To avoid duplicate records, i used following method:
def save_phone(self, company, _phone):
"""save phone into phones table
"""
_phone = self.format_phone(_phone)
try:
self.db.session.query(Phones).filter_by(company=company, phone=_phone).one()
except orm_exc.NoResultFound:
phone = Phones()
phone.company = company
phone.phone = _phone
self.db.session.add_then_commit(phone)But there are still duplicate data in the table.
Metadata
Metadata
Assignees
Labels
No labels