Skip to content

Commit 61b1d57

Browse files
Merge pull request #1696 from learning-unlimited/mgersh-dead-code
Completely delete the datatree, userbits, and some less interesting things
2 parents 3e27541 + fabc89e commit 61b1d57

File tree

113 files changed

+1173
-2031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1173
-2031
lines changed

esp/esp/accounting/migrations/0007_add_options_fkey.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77

88
class Migration(SchemaMigration):
9-
9+
depends_on = (
10+
("accounting_core", "0001_initial"),
11+
)
1012
def forwards(self, orm):
1113
# Adding field 'Transfer.options'
1214
db.add_column('accounting_transfer', 'option',

esp/esp/accounting_core/migrations/0002_del_accounting_core.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
class Migration(SchemaMigration):
99

10+
depends_on = (
11+
("accounting_docs", "0001_initial"),
12+
)
13+
1014
def forwards(self, orm):
1115
# Deleting model 'LineItemType'
1216
db.delete_table('accounting_core_lineitemtype')

esp/esp/accounting_docs/migrations/0001_initial.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
class Migration(SchemaMigration):
99

10+
depends_on = (
11+
("accounting_core", "0001_initial"),
12+
)
13+
1014
def forwards(self, orm):
1115
# Adding model 'PurchaseOrder'
1216
db.create_table('accounting_docs_purchaseorder', (

esp/esp/application/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def get_subject(s):
226226
return None
227227
except ValueError:
228228
cls_title = val.strip()
229-
clses = program.classes().filter(anchor__friendly_name=cls_title)
229+
clses = program.classes().filter(title=cls_title)
230230
if clses:
231231
return clses[0]
232232
else:

esp/esp/cal/models.py

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
3434
"""
3535
from django.db import models
36-
from esp.datatree.models import *
3736
from datetime import datetime, timedelta
3837
from esp.cache import cache_function
3938

esp/esp/cal/templatetags/__init__.py

-33
This file was deleted.

esp/esp/datatree/AUTHORS

-8
This file was deleted.

esp/esp/datatree/__init__.py

-35
Original file line numberDiff line numberDiff line change
@@ -1,35 +0,0 @@
1-
2-
__author__ = "Individual contributors (see AUTHORS file)"
3-
__date__ = "$DATE$"
4-
__rev__ = "$REV$"
5-
__license__ = "AGPL v.3"
6-
__copyright__ = """
7-
This file is part of the ESP Web Site
8-
Copyright (c) 2007 by the individual contributors
9-
(see AUTHORS file)
10-
11-
The ESP Web Site is free software; you can redistribute it and/or
12-
modify it under the terms of the GNU Affero General Public License
13-
as published by the Free Software Foundation; either version 3
14-
of the License, or (at your option) any later version.
15-
16-
This program is distributed in the hope that it will be useful,
17-
but WITHOUT ANY WARRANTY; without even the implied warranty of
18-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19-
GNU Affero General Public License for more details.
20-
21-
You should have received a copy of the GNU Affero General Public
22-
License along with this program; if not, write to the Free Software
23-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24-
25-
Contact information:
26-
MIT Educational Studies Program
27-
84 Massachusetts Ave W20-467, Cambridge, MA 02139
28-
Phone: 617-253-4882
29-
30-
Learning Unlimited, Inc.
31-
527 Franklin St, Cambridge, MA 02139
32-
Phone: 617-379-0178
33-
34-
"""
35-

esp/esp/datatree/admin.py

-46
This file was deleted.

esp/esp/datatree/migrations/0002_change_fns.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from south.db import db
55
from south.v2 import SchemaMigration
66
from django.db import models
7-
from esp.datatree.models import install as datatree_install
87
from django.conf import settings
98

109

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
import datetime
3+
from south.db import db
4+
from south.v2 import SchemaMigration
5+
from django.db import models
6+
7+
8+
class Migration(SchemaMigration):
9+
10+
depends_on = (
11+
("accounting_core", "0002_del_accounting_core"),
12+
("miniblog", "0003_remove_anchor"),
13+
("modules", "0029_module_ext_unused_model_removal"),
14+
("program", "0046_delete_anchors"),
15+
("qsdmedia", "0008_auto__del_field_media_anchor"),
16+
("survey", "0004_anchor_replacement_3"),
17+
("web", "0006_auto__del_field_navbarentry_path"),
18+
)
19+
20+
def forwards(self, orm):
21+
# Removing unique constraint on 'DataTree', fields ['name', 'parent']
22+
try:
23+
db.delete_unique('datatree_datatree', ['name', 'parent_id'])
24+
except ValueError:
25+
# Not sure why South thinks the unique constraint existed but my database
26+
# doesn't; ignore the error
27+
pass
28+
29+
# Deleting model 'DataTree'
30+
db.delete_table('datatree_datatree')
31+
32+
33+
def backwards(self, orm):
34+
# Adding model 'DataTree'
35+
db.create_table('datatree_datatree', (
36+
('parent', self.gf('django.db.models.fields.related.ForeignKey')(related_name='child_set', null=True, to=orm['datatree.DataTree'], blank=True)),
37+
('rangestart', self.gf('django.db.models.fields.IntegerField')()),
38+
('range_correct', self.gf('django.db.models.fields.BooleanField')(default=True)),
39+
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
40+
('uri_correct', self.gf('django.db.models.fields.BooleanField')(default=False)),
41+
('name', self.gf('django.db.models.fields.CharField')(max_length=64)),
42+
('rangeend', self.gf('django.db.models.fields.IntegerField')()),
43+
('friendly_name', self.gf('django.db.models.fields.TextField')()),
44+
('uri', self.gf('django.db.models.fields.CharField')(max_length=1024)),
45+
('lock_table', self.gf('django.db.models.fields.IntegerField')(default=0)),
46+
))
47+
db.send_create_signal('datatree', ['DataTree'])
48+
49+
# Adding unique constraint on 'DataTree', fields ['name', 'parent']
50+
db.create_unique('datatree_datatree', ['name', 'parent_id'])
51+
52+
53+
models = {
54+
55+
}
56+
57+
complete_apps = ['datatree']

esp/esp/datatree/models.py

-84
Original file line numberDiff line numberDiff line change
@@ -1,84 +0,0 @@
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

Comments
 (0)