Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1 from liyanhui1228/master
Browse files Browse the repository at this point in the history
Merge display changes and json values
  • Loading branch information
jaimboree authored Dec 4, 2016
2 parents b0e5d58 + a5aeba2 commit e9cc3c8
Show file tree
Hide file tree
Showing 91 changed files with 559 additions and 57,462 deletions.
32 changes: 11 additions & 21 deletions capstone/SEI/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,28 @@ def clean(self):
cleaned_data = super(UserForm, self).clean()
return cleaned_data

class EmployeeForm(forms.ModelForm):
class Meta:
model = Employee
exclude = ('user', 'activation_key',)

def clean(self):
cleaned_data = super(EmployeeForm, self).clean()
return cleaned_data

class ProjectForm(forms.ModelForm):
error_css_class = 'error'
required_css_class = 'required'
start_date = forms.DateField()
end_date = forms.DateField()

class Meta:
model = Project
# exclude = ('team', 'client', )
fields = '__all__'
widgets = {
#'start_date': forms.SelectDateWidget(),
#'end_date': forms.SelectDateWidget(),
'project_budget': forms.NumberInput(attrs={'min': 0, 'step':1}),
'project_budget': forms.NumberInput(attrs={'min': 0, 'step':1000}),
}

def clean(self):
Expand All @@ -94,15 +102,6 @@ def clean_end_date(self):
raise forms.ValidationError("End date must occur after start date")
return end_date

class ChargeStringForm(forms.ModelForm):
class Meta:
model = ChargeString
fields = ['charge_string']

def clean(self):
cleaned_data = super(ChargeStringForm, self).clean()
return cleaned_data

class ResourceForm(forms.ModelForm):
month = forms.CharField(max_length=30)
class Meta:
Expand All @@ -122,12 +121,3 @@ def clean(self):
cleaned_data = super(AddEmployeeForm, self).clean()
return cleaned_data

class TeamForm(forms.ModelForm):
class Meta:
model = Team
fields = '__all__'
#exclude = ('team_id', )

def clean(self):
cleaned_data = super(TeamForm, self).clean()
return cleaned_data
28 changes: 13 additions & 15 deletions capstone/SEI/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-27 15:39
# Generated by Django 1.10.3 on 2016-11-17 18:07
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields


class Migration(migrations.Migration):

initial = True

dependencies = [
('auth', '0008_alter_user_username_max_length'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0008_alter_user_username_max_length'),
]

operations = [
migrations.CreateModel(
name='ChargeString',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('charge_string', models.CharField(default='', max_length=100)),
('charge', models.CharField(blank=True, default='', max_length=100)),
],
),
migrations.CreateModel(
Expand All @@ -31,7 +30,6 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('organization_name', models.CharField(max_length=100)),
('contact_name', models.CharField(max_length=100)),
('phone', phonenumber_field.modelfields.PhoneNumberField(default='', max_length=128)),
('address', models.CharField(max_length=200)),
('city', models.CharField(max_length=100)),
('state', models.CharField(max_length=2)),
Expand All @@ -55,8 +53,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField()),
('percentage_used', models.DecimalField(decimal_places=2, default=0, max_digits=8)),
('is_available', models.BooleanField(default=1)),
('percentage_used', models.DecimalField(decimal_places=2, max_digits=8)),
('is_available', models.BooleanField()),
('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Employee')),
],
),
Expand All @@ -65,9 +63,9 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('project_date', models.DateField()),
('time_use', models.IntegerField(null=True)),
('isExternal', models.BooleanField(default=0)),
('month_cost', models.DecimalField(decimal_places=2, max_digits=8, null=True)),
('time_use', models.IntegerField()),
('isExternal', models.BooleanField()),
('month_cost', models.DecimalField(decimal_places=2, max_digits=8)),
('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Employee')),
],
),
Expand Down Expand Up @@ -96,10 +94,10 @@ class Migration(migrations.Migration):
('project_description', models.CharField(blank=True, default='', max_length=200)),
('project_budget', models.DecimalField(decimal_places=2, max_digits=8)),
('is_internal', models.BooleanField(default=True)),
('client_name', models.CharField(blank=True, default='', max_length=200)),
('start_date', models.DateField()),
('end_date', models.DateField()),
('business_manager', models.CharField(blank=True, default='', max_length=100)),
('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Client')),
],
),
migrations.CreateModel(
Expand All @@ -117,9 +115,9 @@ class Migration(migrations.Migration):
name='ProjectMonth',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('project_date', models.CharField(max_length=200)),
('budget', models.DecimalField(decimal_places=2, max_digits=18, null=True)),
('employee_list', models.ManyToManyField(null=True, related_name='do_project_this_month', to='SEI.Employee')),
('project_date', models.DateField()),
('budget', models.DecimalField(decimal_places=2, max_digits=18)),
('employee_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Employee')),
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Project')),
],
),
Expand Down Expand Up @@ -147,7 +145,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='project',
name='team',
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='SEI.Team'),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Team'),
),
migrations.AddField(
model_name='log',
Expand Down
139 changes: 139 additions & 0 deletions capstone/SEI/migrations/0002_auto_20161117_1816.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-17 18:16
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields


class Migration(migrations.Migration):

dependencies = [
('SEI', '0001_initial'),
]

operations = [
migrations.RenameField(
model_name='employee',
old_name='permission_description',
new_name='first_name',
),
migrations.RemoveField(
model_name='chargestring',
name='date',
),
migrations.RemoveField(
model_name='employee',
name='user',
),
migrations.RemoveField(
model_name='employee',
name='user_role',
),
migrations.RemoveField(
model_name='profile',
name='id',
),
migrations.RemoveField(
model_name='project',
name='project_id',
),
migrations.AddField(
model_name='client',
name='phone',
field=phonenumber_field.modelfields.PhoneNumberField(default=b'', max_length=128),
),
migrations.AddField(
model_name='employee',
name='id',
field=models.AutoField(auto_created=True, default=1, primary_key=True, serialize=False, verbose_name='ID'),
preserve_default=False,
),
migrations.AddField(
model_name='employee',
name='last_name',
field=models.CharField(blank=True, default=b'', max_length=200),
),
migrations.AddField(
model_name='profile',
name='permission_description',
field=models.CharField(blank=True, default=b'', max_length=200),
),
migrations.AddField(
model_name='profile',
name='user_role',
field=models.CharField(choices=[(b'ADMIN', b'Administrator'), (b'NM', b'NormalUser'), (b'ITADMIN', b'ITAdministrator')], default=b'NM', max_length=20),
),
migrations.AddField(
model_name='project',
name='id',
field=models.AutoField(auto_created=True, default=1, primary_key=True, serialize=False, verbose_name='ID'),
preserve_default=False,
),
migrations.AlterField(
model_name='chargestring',
name='charge',
field=models.CharField(blank=True, default=b'', max_length=100),
),
migrations.AlterField(
model_name='employeeavailability',
name='employee',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Employee'),
),
migrations.AlterField(
model_name='employeemonth',
name='employee',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Employee'),
),
migrations.AlterField(
model_name='profile',
name='user',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='project',
name='business_manager',
field=models.CharField(blank=True, default=b'', max_length=100),
),
migrations.AlterField(
model_name='projectexpense',
name='cost',
field=models.DecimalField(decimal_places=2, max_digits=18),
),
migrations.AlterField(
model_name='projectmonth',
name='budget',
field=models.DecimalField(decimal_places=2, max_digits=18),
),
migrations.RemoveField(
model_name='projectmonth',
name='employee_list',
),
migrations.AddField(
model_name='projectmonth',
name='employee_list',
field=models.ManyToManyField(related_name='do_project_this_month', to='SEI.Employee'),
),
migrations.AlterField(
model_name='projectmonth',
name='project_date',
field=models.CharField(max_length=200),
),
migrations.AlterField(
model_name='salaryhistory',
name='employee',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SEI.Employee'),
),
migrations.AlterField(
model_name='team',
name='directorate',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='directorate', to='SEI.Employee'),
),
migrations.AlterField(
model_name='team',
name='manager',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='manageer', to='SEI.Employee'),
),
]
26 changes: 0 additions & 26 deletions capstone/SEI/migrations/0002_auto_20161128_1610.py

This file was deleted.

30 changes: 30 additions & 0 deletions capstone/SEI/migrations/0003_auto_20161117_2056.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-17 20:56
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('SEI', '0002_auto_20161117_1816'),
]

operations = [
migrations.AlterField(
model_name='employeemonth',
name='isExternal',
field=models.BooleanField(default=0),
),
migrations.AlterField(
model_name='employeemonth',
name='month_cost',
field=models.DecimalField(decimal_places=2, max_digits=8, null=True),
),
migrations.AlterField(
model_name='employeemonth',
name='time_use',
field=models.IntegerField(null=True),
),
]
30 changes: 30 additions & 0 deletions capstone/SEI/migrations/0004_auto_20161118_1931.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-18 19:31
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('SEI', '0003_auto_20161117_2056'),
]

operations = [
migrations.AlterField(
model_name='employeeavailability',
name='percentage_used',
field=models.DecimalField(decimal_places=2, default=0, max_digits=8),
),
migrations.AlterField(
model_name='projectmonth',
name='budget',
field=models.DecimalField(decimal_places=2, max_digits=18, null=True),
),
migrations.AlterField(
model_name='projectmonth',
name='employee_list',
field=models.ManyToManyField(null=True, related_name='do_project_this_month', to='SEI.Employee'),
),
]
Loading

0 comments on commit e9cc3c8

Please sign in to comment.