Skip to content

Commit

Permalink
Cambios cambios cambios
Browse files Browse the repository at this point in the history
  • Loading branch information
josjimjim committed Apr 24, 2017
1 parent ffd1b6e commit 1d0e0c0
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 11 deletions.
1 change: 1 addition & 0 deletions Metronus-Project/metronus_app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def get_urls(self):
]
return my_urls + urls

@classmethod
def dashboard(self):
"""
Returns a JSON which contains the number of tasks per company,
Expand Down
1 change: 1 addition & 0 deletions Metronus-Project/metronus_app/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@


class MetronusAppConfig(AppConfig):
""" La documentasió """
name = 'metronus_app'
2 changes: 1 addition & 1 deletion Metronus-Project/metronus_app/model/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def __unicode__(self):
return self.identifier

def role(self):
return self.type_choices(self.user_type)
return self.type_choices(self.user_type)
2 changes: 2 additions & 0 deletions Metronus-Project/metronus_app/model/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


class Company(models.Model):
""" Esto es una clase del modelo. Totalmente inesperado"""

cif = models.CharField(max_length=9, unique=True)
company_name = models.CharField(max_length=100)
short_name = models.CharField(max_length=50, unique=True)
Expand Down
3 changes: 3 additions & 0 deletions Metronus-Project/metronus_app/model/companyLog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.db import models


class CompanyLog(models.Model):
""" Esto es una clase del modelo. Totalmente inesperado"""

cif = models.CharField(max_length=9, unique=True)
company_name = models.CharField(max_length=100)
registryDate = models.DateTimeField()
Expand Down
2 changes: 2 additions & 0 deletions Metronus-Project/metronus_app/model/department.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class Department(models.Model):
""" Esto es una clase del modelo. Totalmente inesperado"""

company_id = models.ForeignKey(Company)
name = models.CharField(max_length=50)
registryDate = models.DateTimeField(auto_now=True)
Expand Down
2 changes: 2 additions & 0 deletions Metronus-Project/metronus_app/model/employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class Employee(Actor):
""" XD """

price_per_hour = models.FloatField(default=1.0)

def __unicode__(self):
Expand Down
2 changes: 2 additions & 0 deletions Metronus-Project/metronus_app/model/employeeLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class EmployeeLog(models.Model):
""" Esto es una clase del modelo. Totalmente inesperado"""

employee_id = models.ForeignKey(Employee)
event = models.CharField(max_length=1, choices=[('A', 'Alta'), ('B', 'Baja'), ('C', 'Change')], default='A')
event_date = models.DateTimeField(auto_now=True)
Expand Down
21 changes: 12 additions & 9 deletions Metronus-Project/metronus_app/model/project.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from django.db import models
from metronus_app.model.company import Company


class Project(models.Model):
company_id = models.ForeignKey(Company)
name = models.CharField(max_length=30)
registryDate = models.DateTimeField(auto_now=True)
deleted = models.BooleanField(default=False)
def __unicode__(self):
return self.name

class Meta:
unique_together = ('name', 'company_id')
""" Esto es una clase del modelo. Totalmente inesperado"""
company_id = models.ForeignKey(Company)
name = models.CharField(max_length=30)
registryDate = models.DateTimeField(auto_now=True)
deleted = models.BooleanField(default=False)

def __unicode__(self):
return self.name

class Meta:
unique_together = ('name', 'company_id')
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ class ProjectDepartmentEmployeeRole(models.Model):
role_id = models.ForeignKey(Role)
roleDate = models.DateTimeField(auto_now=True)

def __unicode__(self):
return self.name

class Meta:
unique_together = ('projectDepartment_id', 'employee_id','role_id')
2 changes: 2 additions & 0 deletions Metronus-Project/metronus_app/model/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@


class Task(models.Model):
""" Esto es una clase del modelo. Totalmente inesperado"""

name = models.CharField(max_length=30)
description = models.CharField(max_length=200)
registryDate = models.DateTimeField(auto_now=True)
Expand Down
1 change: 1 addition & 0 deletions Metronus-Project/metronus_app/templatetags/custom_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def show_ajax_errors():

@register.simple_tag
def converto_to_hours(amount):
""" ¿converto o con berto? XD"""
hours = amount//60
minutes = amount % 60
if minutes < 10:
Expand Down
2 changes: 1 addition & 1 deletion Metronus-Project/metronus_app/test/testProjectMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def create_task_in_projdept(project, department):
n_dep = len(departments)
# Do the random test 5 times

for k in range(5):
for _ in range(5):

# Remove all tasks and time logs
TimeLog.objects.all().delete()
Expand Down

0 comments on commit 1d0e0c0

Please sign in to comment.