JourneyJoker/payment/models/billingaddress.py
Klaus-Uwe Mitterer d2792b8aa3 Refactor payment app
Generate invoice from HTML
Remove now unused dependency on PyInvoice
2021-06-10 13:18:52 +02:00

22 lines
No EOL
714 B
Python

from django.db import models
from django.contrib.auth import get_user_model
from localauth.models import PersonMixin, AddressMixin
class BillingAddress(PersonMixin, AddressMixin):
user = models.ForeignKey(get_user_model(), models.CASCADE)
@classmethod
def from_profile(cls, profile):
return cls.objects.create(
company = profile.company,
vat_id = profile.vat_id,
first_name = profile.first_name,
last_name = profile.last_name,
street = profile.street,
city = profile.city,
zip = profile.zip,
state = profile.state,
country = profile.country,
user = profile.user
)