rookeries/rookeries/core/models.py

55 lines
1.6 KiB
Python

#
# Copyright (c) 2013 Dorian Pula <dorian.pula@amber-penguin-software.ca>
#
# Rookeries is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# Rookeries is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License along with Rookeries. If not, see <http://www.gnu.org/licenses/>.
#
# Please share and enjoy!
#
# TODO Look into adding in user-login-credentials from Flask-Login?
"""
Models for the core of the Rookeries platform.
@author: Dorian Pula <dorian.pula@amber-penguin-software.ca>
@version: 0.0.1
"""
class User(object):
"""
User of the Rookeries application.
"""
def __init__(self, username=None, first_name=None, last_name=None, email=None):
self.username = username
self.first_name = first_name
self.last_name = last_name
self.email = email
# TODO Add in user types and permissions?
class Group(object):
"""
Group of users inside the Rookeries application.
"""
def __init__(self, name=None):
self.group_name = name
def add_user_to_group(self, user):
self.members.put(user)
# TODO Add more methods controlling users in groups, etc.