# Path: django_fordrop/models.py
# class UserProfile(models.Model):
#     user = models.ForeignKey(User, unique=True, null=True, blank=True)
#     uuid = models.CharField(max_length=255, null=True, blank=True)
#     name = models.CharField(max_length=255, null=True, blank=True)
#     email = models.EmailField(null=True, blank=True)
#     avatar = ImageField(upload_to='avatars', null=True, blank=True)
#     location = models.CharField(max_length=255, null=True, blank=True)
#     web = models.URLField(null=True, blank=True)
#     bio = models.TextField(max_length=140, null=True, blank=True)
#     is_first_login = models.BooleanField(default=True)
#     time_created = models.DateTimeField(auto_now_add=True)
#     time_updated = models.DateTimeField(auto_now=True)
#     def activity(self):
#         return {
#             "objectType" : "person",
#             "id": self.uuid,
#             "displayName": self.name,
#             "location": self.location,
#             'web': self.web,
#             "bio": self.bio,
#         }
#     def __unicode__(self):
#         return '%s' % self.user
#     def get_absolute_url(self):
#         return '/profile/%s' % self.id
#     def save(self, *args, **kwargs):
#         super(UserProfile, self).save()
#         if not self.uuid:
#             self.uuid = uuid.uuid4().urn
#         if not self.email:
#             self.email = self.user.email
#         super(UserProfile, self).save()
#     class Admin:
#         pass
# 
# class UserSettings(models.Model):
#     user = models.ForeignKey(User)
#     notify_comment_on_file = models.BooleanField(default=False)
#     notify_comment_on_collection = models.BooleanField(default=False)
#     notify_same_file = models.BooleanField(default=False)
#     publish_avatar = models.BooleanField(default=False)
#     post_as_self = models.BooleanField(default=False)
#     time_created = models.DateTimeField(auto_now_add=True)
#     last_updated = models.DateTimeField(auto_now=True)
#     def __unicode__(self):
#         return '%s' % self.user
#     class Admin:
#         pass


from django import forms
from django_fordrop.models import UserProfile, UserSettings
from models import File, FileComment, CollectionComment, Collection
class FileTagForm(forms.ModelForm):
    class Meta:
        model = File
        fields = ('tags',)

class CollectionTagForm(forms.ModelForm):
    class Meta:
        model = Collection
        fields = ('tags',)

class CollectionCommentForm(forms.ModelForm):
    class Meta:
        model = CollectionComment
        fields = ('content',)

class CollectionForm(forms.ModelForm):
    class Meta:
        model = Collection
        fields = ('title', 'tags', 'description')

class UploadFileForm(forms.ModelForm):
    file = forms.FileField(required=True)
    #url = forms.CharField(required=False)
    #hash = forms.CharField(required=False)
    class Meta:
        model = File
        fields = ('description', 'tags')

class UserProfileForm(forms.ModelForm):
    class Meta:

# Path: django_fordrop/models.py
# class UserProfile(models.Model):
#     user = models.ForeignKey(User, unique=True, null=True, blank=True)
#     uuid = models.CharField(max_length=255, null=True, blank=True)
#     name = models.CharField(max_length=255, null=True, blank=True)
#     email = models.EmailField(null=True, blank=True)
#     avatar = ImageField(upload_to='avatars', null=True, blank=True)
#     location = models.CharField(max_length=255, null=True, blank=True)
#     web = models.URLField(null=True, blank=True)
#     bio = models.TextField(max_length=140, null=True, blank=True)
#     is_first_login = models.BooleanField(default=True)
#     time_created = models.DateTimeField(auto_now_add=True)
#     time_updated = models.DateTimeField(auto_now=True)
#     def activity(self):
#         return {
#             "objectType" : "person",
#             "id": self.uuid,
#             "displayName": self.name,
#             "location": self.location,
#             'web': self.web,
#             "bio": self.bio,
#         }
#     def __unicode__(self):
#         return '%s' % self.user
#     def get_absolute_url(self):
#         return '/profile/%s' % self.id
#     def save(self, *args, **kwargs):
#         super(UserProfile, self).save()
#         if not self.uuid:
#             self.uuid = uuid.uuid4().urn
#         if not self.email:
#             self.email = self.user.email
#         super(UserProfile, self).save()
#     class Admin:
#         pass
# 
# class UserSettings(models.Model):
#     user = models.ForeignKey(User)
#     notify_comment_on_file = models.BooleanField(default=False)
#     notify_comment_on_collection = models.BooleanField(default=False)
#     notify_same_file = models.BooleanField(default=False)
#     publish_avatar = models.BooleanField(default=False)
#     post_as_self = models.BooleanField(default=False)
#     time_created = models.DateTimeField(auto_now_add=True)
#     last_updated = models.DateTimeField(auto_now=True)
#     def __unicode__(self):
#         return '%s' % self.user
#     class Admin:
#         pass


# Path: django_fordrop/forms.py
from django import forms
from django_fordrop.models import UserProfile, UserSettings
from models import File, FileComment, CollectionComment, Collection

class FileTagForm(forms.ModelForm):
    class Meta:
        model = File
        fields = ('tags',)

class CollectionTagForm(forms.ModelForm):
    class Meta:
        model = Collection
        fields = ('tags',)

class CollectionCommentForm(forms.ModelForm):
    class Meta:
        model = CollectionComment
        fields = ('content',)

class CollectionForm(forms.ModelForm):
    class Meta:
        model = Collection
        fields = ('title', 'tags', 'description')

class UploadFileForm(forms.ModelForm):
    file = forms.FileField(required=True)
    #url = forms.CharField(required=False)
    #hash = forms.CharField(required=False)
    class Meta:
        model = File
        fields = ('description', 'tags')

class UserProfileForm(forms.ModelForm):
    class Meta:

        model = UserProfile