diff --git a/djangoldp_profile/models.py b/djangoldp_profile/models.py index cc5cf06033dbb836dc4f4ec90f6bfad8984c5ec4..0703065ab9c55e36a7a54cfe75f83dce12c4754d 100644 --- a/djangoldp_profile/models.py +++ b/djangoldp_profile/models.py @@ -33,6 +33,29 @@ class Profile(Model): def __str__(self): return '{} ({})'.format(self.user.get_full_name(), self.user.username) +class Contact(Model): + fullName = models.CharField(max_length=255) + givenName = models.CharField(max_length=255, blank=True) + familyName = models.CharField(max_length=255, blank=True) + email = models.EmailField(max_length=254, blank=True) + phone = models.CharField(max_length=255, blank=True) + role = models.CharField(max_length=255, blank=True) + + class Meta(Model.Meta): + anonymous_perms = [] + authenticated_perms = [] + owner_perms = [] + rdf_type = 'vcard:Individual' + rdf_context = { + 'fullName': 'vcard:fn', + 'givenName': 'vcard:given-name', + 'familyName': 'vcard:family-name', + 'email': 'vcard:hasEmail', + 'phone': 'vcard:hasTelephone', + 'role': 'vcard:role' + } + def __str__(self): + return self.fullName @receiver(post_save, sender=settings.AUTH_USER_MODEL) def create_user_profile(sender, instance, created, **kwargs):