Skip to content

Commit

Permalink
Merge pull request #6 from RedBeardCode/feature/add_django_2_support
Browse files Browse the repository at this point in the history
drop python 2
  • Loading branch information
RedBeardCode committed Dec 20, 2017
2 parents c83ac85 + f2505f4 commit 635fccb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python
python:
- "2.7"
- "3.5"
- "3.6"

services: postgresql

Expand Down
5 changes: 2 additions & 3 deletions FreeTimeLance/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
urlpatterns = [
url(r'^invitations/accept-invite/(?P<key>\w+)/?$',
CustomerAcceptInvite.as_view(), name='accept-invite'),
url(r'^invitations/', include('invitations.urls',
namespace='invitations')),
url(r'^invitations/', include('invitations.urls', 'invitations')),
url(r'^admin/', admin.site.urls),
url(r'', include('project.urls')),
url('^accept-invite/register/$', show_404, name='account_signup'),
Expand All @@ -40,6 +39,6 @@
import debug_toolbar

urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
url(r'^__debug__/', include(debug_toolbar.urls, namespace='debug')),

]
18 changes: 14 additions & 4 deletions project/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ def user_accepted_invitation(sender, **kwargs):


class CustomerInvitation(Invitation):
customer = models.ForeignKey('Customer', blank=True, null=True)
customer = models.ForeignKey(
'Customer',
blank=True,
null=True,
on_delete=models.CASCADE
)


invite_accepted.connect(user_accepted_invitation)
Expand Down Expand Up @@ -75,13 +80,18 @@ class Project(models.Model):
Project for which you get a order
"""
name = models.CharField('Name of the project', max_length=250)
customer = models.ForeignKey('Customer')
customer = models.ForeignKey('Customer', on_delete=models.CASCADE)
description = models.TextField('Description of the target of the project')
start_date = models.DateField('Start date')
death_line = models.DateField('Death line')
workload = models.DurationField('Submitted number of working hours')
repository = models.URLField('Url of the repository')
group = models.ForeignKey('auth.Group', blank=True, null=True)
group = models.ForeignKey(
'auth.Group',
blank=True,
null=True,
on_delete=models.CASCADE
)

def __str__(self):
return "Project: " + self.name
Expand Down Expand Up @@ -122,7 +132,7 @@ class Activity(models.Model):
blank=True, null=True)
start_time = models.DateTimeField('Start time')
end_time = models.DateTimeField('End time')
project = models.ForeignKey('Project')
project = models.ForeignKey('Project', on_delete=models.CASCADE)
remarks = models.TextField('Remarks for the done work', null=True)

def duration(self):
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
gunicorn
dj-database-url
whitenoise
django>=1.10
django-crispy-forms>=1.5.1
django-invitations
django>=2.0
django-crispy-forms>=1.7.0
git+https://github.com/RedBeardCode/django-invitations.git
django-debug-toolbar
django-cron
psycopg2
Expand Down

0 comments on commit 635fccb

Please sign in to comment.