# Path: src/librement/profile/enums.py

# 
# Path: src/librement/profile/models.py
# class Profile(PerUserData('profile')):
#     account_type = EnumField(AccountEnum, default=AccountEnum.INDIVIDUAL)
# 
#     biography = models.TextField()
#     display_name = models.CharField(max_length=100)
# 
#     organisation = models.CharField(max_length=100, blank=True)
# 
#     address_1 = models.CharField(max_length=150, blank=True)
#     address_2 = models.CharField(max_length=150, blank=True)
#     city = models.CharField(max_length=100, blank=True)
#     region = models.CharField(max_length=100, blank=True)
#     zipcode = models.CharField(max_length=100, blank=True)
# 
#     country = EnumField(CountryEnum, default=CountryEnum.US)
# 
#     picture = YADTImageField(variants={
#         'thumbnail': {
#             'width': 150,
#             'height': 150,
#             'format': 'jpeg',
#             'crop': True,
#         },
#     }, cachebust=True)
# 
#     rss_url = models.CharField(max_length=200, blank=True)
# 
#     def __unicode__(self):
#         return self.display_name


from django import forms
from django.contrib.auth.models import User
from .enums import AccountEnum
from .models import Profile
            'rss_url',
        )

class AccountUserForm(forms.ModelForm):
    first_name = forms.CharField(max_length=30) # implicit required=True
    last_name = forms.CharField(max_length=30)

    class Meta:
        model = User
        fields = (
            'first_name',
            'last_name',
        )

class AccountProfileForm(forms.ModelForm):
    class Meta:
        model = Profile
        fields = (
            'organisation',
            'address_1',
            'address_2',
            'city',
            'region',
            'zipcode',
            'country',
        )

    def clean_organisation(self):
        val = self.cleaned_data['organisation']


# Path: src/librement/profile/enums.py

# 
# Path: src/librement/profile/models.py
# class Profile(PerUserData('profile')):
#     account_type = EnumField(AccountEnum, default=AccountEnum.INDIVIDUAL)
# 
#     biography = models.TextField()
#     display_name = models.CharField(max_length=100)
# 
#     organisation = models.CharField(max_length=100, blank=True)
# 
#     address_1 = models.CharField(max_length=150, blank=True)
#     address_2 = models.CharField(max_length=150, blank=True)
#     city = models.CharField(max_length=100, blank=True)
#     region = models.CharField(max_length=100, blank=True)
#     zipcode = models.CharField(max_length=100, blank=True)
# 
#     country = EnumField(CountryEnum, default=CountryEnum.US)
# 
#     picture = YADTImageField(variants={
#         'thumbnail': {
#             'width': 150,
#             'height': 150,
#             'format': 'jpeg',
#             'crop': True,
#         },
#     }, cachebust=True)
# 
#     rss_url = models.CharField(max_length=200, blank=True)
# 
#     def __unicode__(self):
#         return self.display_name


# Path: src/librement/profile/forms.py
from django import forms
from django.contrib.auth.models import User
from .enums import AccountEnum
from .models import Profile

            'rss_url',
        )

class AccountUserForm(forms.ModelForm):
    first_name = forms.CharField(max_length=30) # implicit required=True
    last_name = forms.CharField(max_length=30)

    class Meta:
        model = User
        fields = (
            'first_name',
            'last_name',
        )

class AccountProfileForm(forms.ModelForm):
    class Meta:
        model = Profile
        fields = (
            'organisation',
            'address_1',
            'address_2',
            'city',
            'region',
            'zipcode',
            'country',
        )

    def clean_organisation(self):
        val = self.cleaned_data['organisation']


        if self.instance.account_type != AccountEnum.INDIVIDUAL and val == '':