Commit 0cc0b954 authored by jblemee's avatar jblemee

init: Move picture and jabberId into specific models

parents
dist
*.egg-info
build
name = "djangoldp_account"
from django.contrib import admin
from .models import Account, ChatProfile
admin.site.register(Account)
admin.site.register(ChatProfile)
from django.apps import AppConfig
class DjangoldpAccountConfig(AppConfig):
name = 'djangoldp_account'
from django.db import models
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse_lazy
class Account(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
picture = models.URLField()
class Meta:
permissions = (
('view_account', 'Read'),
('control_account', 'Control'),
)
def __str__(self):
return '{} ({})'.format(self.user.get_full_name(), self.user.username)
class ChatProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
jabberID = models.CharField(max_length=255, blank=True, null=True)
class Meta:
permissions = (
('view_chatprofile', 'Read'),
('control_chatprofile', 'Control'),
)
def __str__(self):
return '{} (jabberID: {})'.format(self.user.get_full_name(), self.jabberID)
"""djangoldp project URL Configuration"""
from django.conf.urls import url
from djangoldp.views import LDPViewSet
from .models import ChatProfile, Account
urlpatterns = [
url(r'^accounts/', LDPViewSet.urls(model=Account)),
url(r'^chat-profile/', LDPViewSet.urls(model=ChatProfile)),
]
import os
from setuptools import setup, find_packages
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(name='djangoldp_account',
version='0.0.1',
description='djangoldp package for account data models',
url='http://git.happy-dev.fr/startinblox/djangoldp_account',
author="Startin'blox",
author_email='jblemee@happy-dev.fr',
license='MIT',
packages=find_packages(),
zip_safe=False)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment