portal: updated models + added requirements
[myslice.git] / portal / models.py
1 # -*- coding: utf-8 -*-
2 #
3 # portal/models.py: models for the portal application
4 # This file is part of the Manifold project.
5 #
6 # Authors:
7 #   Jordan AugĂ© <jordan.auge@lip6.fr>
8 # Copyright 2013, UPMC Sorbonne UniversitĂ©s / LIP6
9 #
10 # This program is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 3, or (at your option) any later version.
13
14 # This program is distributed in the hope that it will be useful, but WITHOUT
15 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17 # details.
18
19 # You should have received a copy of the GNU General Public License along with
20 # this program; see the file COPYING.  If not, write to the Free Software
21 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 from django.db import models
24 from .validators import validate_email
25
26
27 # Create your models here.
28
29 class Institution(models.Model):
30     name = models.TextField()
31     # list of associated email domains 
32
33 class PendingUser(models.Model):
34     # NOTE We might consider migrating the fields to CharField, which would
35     # simplify form creation in forms.py
36     first_name  = models.TextField()
37     last_name   = models.TextField()
38     email       = models.EmailField(validators=[validate_email])
39     password    = models.TextField()
40     keypair     = models.TextField()
41     # institution
42
43 class PendingSlice(models.Model):
44     slice_name  = models.TextField()