|
1 |
| -__author__ = "Individual contributors (see AUTHORS file)" |
2 |
| -__date__ = "$DATE$" |
3 |
| -__rev__ = "$REV$" |
4 |
| -__license__ = "AGPL v.3" |
5 |
| -__copyright__ = """ |
6 |
| -This file is part of the ESP Web Site |
7 |
| -Copyright (c) 2008 by the individual contributors |
8 |
| - (see AUTHORS file) |
9 |
| -
|
10 |
| -The ESP Web Site is free software; you can redistribute it and/or |
11 |
| -modify it under the terms of the GNU Affero General Public License |
12 |
| -as published by the Free Software Foundation; either version 3 |
13 |
| -of the License, or (at your option) any later version. |
14 |
| -
|
15 |
| -This program is distributed in the hope that it will be useful, |
16 |
| -but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
| -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 |
| -GNU Affero General Public License for more details. |
19 |
| -
|
20 |
| -You should have received a copy of the GNU Affero General Public |
21 |
| -License along with this program; if not, write to the Free Software |
22 |
| -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 |
| -
|
24 |
| -Contact information: |
25 |
| -MIT Educational Studies Program |
26 |
| - 84 Massachusetts Ave W20-467, Cambridge, MA 02139 |
27 |
| - Phone: 617-253-4882 |
28 |
| - |
29 |
| -Learning Unlimited, Inc. |
30 |
| - 527 Franklin St, Cambridge, MA 02139 |
31 |
| - Phone: 617-379-0178 |
32 |
| - |
33 |
| -""" |
34 |
| -from django.db import models |
35 |
| -from esp.db.fields import AjaxForeignKey |
36 |
| - |
37 |
| -__all__ = ('DataTree',) |
38 |
| - |
39 |
| -""" |
40 |
| - DataTree models kept for data storage; functionality removed. |
41 |
| -""" |
42 |
| - |
43 |
| -class DataTree(models.Model): |
44 |
| - |
45 |
| - lock_choices = ( |
46 |
| - (0, "UNLOCKED"), |
47 |
| - (1, "SOFT LOCK"), |
48 |
| - (2, "HARD LOCK"), |
49 |
| - ) |
50 |
| - |
51 |
| - # some fields |
52 |
| - name = models.CharField(max_length=64) |
53 |
| - friendly_name = models.TextField() |
54 |
| - parent = AjaxForeignKey('self',blank=True,null=True, related_name='child_set') |
55 |
| - rangestart = models.IntegerField(editable = False) |
56 |
| - rangeend = models.IntegerField(editable = False) |
57 |
| - uri = models.CharField(editable = False, max_length=1024) |
58 |
| - #^ a charfield for indexing purposes |
59 |
| - uri_correct = models.BooleanField(editable = False, default = False) |
60 |
| - lock_table = models.IntegerField(editable = False, default = 0, |
61 |
| - choices = lock_choices) |
62 |
| - range_correct = models.BooleanField(editable = False, default = True ) |
63 |
| - |
64 |
| - class Meta: |
65 |
| - # parent and name should be unique |
66 |
| - unique_together = (("name", "parent"),) |
67 |
| - # ordering should be by rangestart |
68 |
| - #ordering = ['rangestart','-rangeend'] |
69 |
| - |
70 |
| - class Admin: |
71 |
| - ordering = ('rangestart', '-rangeend') |
72 |
| - |
73 |
| - def delete(self, recurse = False, superdelete = False): |
74 |
| - raise Exception('Attempted to delete a DataTree') |
75 |
| - |
76 |
| - def save(self, create_root=False, uri_fix=False, old_save=False, start_size=None, *args, **kwargs): |
77 |
| - raise Exception('Attempted to save a DataTree') |
78 |
| - |
79 |
| -def GetNode(uri): |
80 |
| - # This no longer creates on demand, so it should not be used in active code. |
81 |
| - return DataTree.objects.get(uri=uri) |
82 |
| - |
83 |
| -def install(): |
84 |
| - pass |
0 commit comments