Changeset 4da37f6 in rattail


Ignore:
Timestamp:
02/19/19 18:08:53 (5 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
4b884dc
Parents:
874cbc4
Message:

Add Customer.add_mailing_address() convenience method

probably need to add these to other "contact" models also...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rattail/db/model/customers.py

    r874cbc4 r4da37f6  
    9090        email = CustomerEmailAddress(address=address, type=type)
    9191        self.emails.append(email)
     92        return email
    9293
    9394    def add_phone_number(self, number, type='Home'):
    9495        phone = CustomerPhoneNumber(number=number, type=type)
    9596        self.phones.append(phone)
     97        return phone
     98
     99    def add_mailing_address(self, **kwargs):
     100        addr = CustomerMailingAddress(**kwargs)
     101        self.addresses.append(addr)
     102        return addr
    96103
    97104    @property
Note: See TracChangeset for help on using the changeset viewer.