Permalink
Browse files

added travis ci file

added uno to avoid uno dependency issues when it's generally not
needed and also near impossible to install when testing.
renamed dependencies to requirements.txt to be more standard
migrations now support sqlite3 on a brand new database
  • Loading branch information...
1 parent 1c0789d commit 2a25b30681575ca31906a000d9c19df08430e1dc David Burke committed Oct 14, 2013
View
@@ -0,0 +1,9 @@
+language: python
+python:
+ - "2.7"
+# command to install dependencies
+install:
+ - pip install --upgrade -r requirements.txt
+ - pip install -q -e . --use-mirrors
+# command to run tests
+script: python manage.py test sis
@@ -15,6 +15,45 @@ def forwards(self, orm):
# [(field.m2m_db_table(), field.m2m_column_name()) for field in User._meta.many_to_many] + \
# [(ob.field.model._meta.db_table, ob.field.column) for ob in User._meta.get_all_related_objects()] + \
# [(ob.field.m2m_db_table(), ob.field.m2m_reverse_name()) for ob in User._meta.get_all_related_many_to_many_objects()]
+
+ if db.execute('select count(*) from sis_student')[0][0] or db.execute('select count(*) from sis_faculty')[0][0]:
+ new_db = False
+ else:
+ new_db = True
+ if new_db:
+ # Deleting model 'MdlUser'
+ db.delete_table(u'sis_mdluser')
+
+ # Deleting model 'ReportField'
+ db.delete_table(u'sis_reportfield')
+
+ # Deleting field 'Faculty.mdluser_ptr'
+ db.delete_column(u'sis_faculty', u'mdluser_ptr_id')
+
+ # Deleting field 'Faculty.alt_email'
+ db.delete_column(u'sis_faculty', 'alt_email')
+
+ # Adding field 'Faculty.user_ptr'
+ db.add_column(u'sis_faculty', u'user_ptr',
+ self.gf('django.db.models.fields.related.OneToOneField')(default='', to=orm['auth.User'], unique=True, primary_key=True),
+ keep_default=False)
+
+ # Removing M2M table for field additional_report_fields on 'UserPreference'
+ db.delete_table(db.shorten_name(u'sis_userpreference_additional_report_fields'))
+
+ # Deleting field 'Student.mdluser_ptr'
+ db.delete_column(u'sis_student', u'mdluser_ptr_id')
+
+ # Adding field 'Student.user_ptr'
+ db.add_column(u'sis_student', u'user_ptr',
+ self.gf('django.db.models.fields.related.OneToOneField')(default='', to=orm['auth.User'], unique=True, primary_key=True),
+ keep_default=False)
+
+ # Adding field 'Student.city'
+ db.add_column(u'sis_student', 'city',
+ self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True),
+ keep_default=False)
+ return
tables_and_columns = [
(u'auth_user_groups', 'user_id'),
(u'auth_user_user_permissions', 'user_id'),
@@ -51,7 +90,7 @@ def forwards(self, orm):
print 2
# Migrate data if there's any to migrate
- if db.execute('select count(*) from sis_student')[0][0] or db.execute('select count(*) from sis_faculty')[0][0]:
+ if not new_db:
db.execute('update sis_student set user_ptr_id = mdluser_ptr_id;')
db.execute('update sis_faculty set user_ptr_id = mdluser_ptr_id;')
db.execute('update sis_student, sis_mdluser set sis_student.city = sis_mdluser.city \
View
@@ -14,7 +14,7 @@ def setup(self):
"""
Prepares simple school data
"""
- self.student = Student(fname="Joe", lname="Student", username="jstudent")
+ self.student = Student(first_name="Joe", last_name="Student", username="jstudent")
self.student.save()
self.year = SchoolYear(name="2010-2011", start_date=date(2010,7,1), end_date=date(2011,5,1), active_year=True)
self.year.save()
@@ -24,7 +24,7 @@ def setup(self):
self.mp2.save()
self.mp3 = MarkingPeriod(name="tri3 2010", start_date=date(2011,3,2), end_date=date(2050,5,1), school_year=self.year, monday=True, friday=True)
self.mp3.save()
- self.teacher = Faculty(username="dburke", fname="david", lname="burke", teacher=True)
+ self.teacher = Faculty(username="dburke", first_name="david", last_name="burke", teacher=True)
self.teacher.save()
try:
self.user = User.objects.create_user('dburke', 'ffdfsf@ffdsfsdf.com', 'aa')
View
@@ -39,7 +39,7 @@ apt-get install apache2 mysql-server python-uno python-reportlab python-mysqldb
# now install python libs that aren't in deb
# stable version of ldap-groups may not work with mysql
-pip install --upgrade -r dependencies.txt
+pip install --upgrade -r ../requirements.txt
# optional auth related
# pip install django-auth-gapps django_cas
@@ -26,8 +26,8 @@ django-apptemplates>=0.0.1
django-filter>=0.5.4
django-positions>=0.4.6
django-bower>=4.8
-file:../install/hatchery/django-ckeditor-3.6.2.tar.gz
-file:../install/hatchery/django-ldap-groups-0.1.3.tar.gz
+django-ckeditor
+file:../django-sis/install/hatchery/django-ldap-groups-0.1.3.tar.gz
django-rosetta>=0.7.1
-e git://github.com/zsiciarz/django-rosetta-grappelli.git#egg=django-rosetta-grappelli
django-celery>=3.0.17
View
@@ -0,0 +1,29 @@
+from setuptools import setup, find_packages
+
+setup(
+ name = "django-sis",
+ version = "1.0",
+ author = "David Burke",
+ author_email = "david@burkesoftware.com",
+ description = ("Django School Information System"),
+ license = "GPLv3",
+ keywords = "django school",
+ url = "https://github.com/burke-software/django-sis",
+ packages=find_packages(),
+ include_package_data=True,
+ test_suite='setuptest.setuptest.SetupTestSuite',
+ tests_require=(
+ 'django-setuptest',
+ 'south',
+ ),
+ install_requires = [
+ 'django',
+ ],
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+ 'Environment :: Web Environment',
+ 'Framework :: Django',
+ 'Programming Language :: Python',
+ "License :: OSI Approved :: GPLv3 License",
+ ],
+)
View
@@ -0,0 +1,13 @@
+import os
+PROJECT_DIR = os.path.dirname(__file__)
+
+STATIC_URL = PROJECT_DIR + '/static/'
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': 'testdb',
+ }
+}
+
+from django_sis.settings import *
View
No changes.

0 comments on commit 2a25b30

Please sign in to comment.