Skip to content

Update CSV reader logic to work with Python 3 #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.sqlite3
__pycache__
4 changes: 2 additions & 2 deletions grants/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Migration(migrations.Migration):
name='Question',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('type', models.CharField(max_length=50, choices=[(b'boolean', b'Yes/No'), (b'text', b'Text'), (b'integer', b'Integer value')])),
('type', models.CharField(max_length=50, choices=[('boolean', 'Yes/No'), ('text', 'Text'), ('integer', 'Integer value')])),
('question', models.TextField()),
('order', models.IntegerField(default=0)),
('program', models.ForeignKey(to='grants.Program', to_field='id', on_delete=models.CASCADE)),
Expand All @@ -84,7 +84,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
('type', models.CharField(max_length=50, choices=[(b'money', b'Money'), (b'ticket', b'Ticket'), (b'place', b'Place'), (b'accomodation', b'Accomodation')])),
('type', models.CharField(max_length=50, choices=[('money', 'Money'), ('ticket', 'Ticket'), ('place', 'Place'), ('accomodation', 'Accomodation')])),
('program', models.ForeignKey(to='grants.Program', to_field='id', on_delete=models.CASCADE)),
],
options={
Expand Down
4 changes: 2 additions & 2 deletions grants/migrations/0004_auto_20140624_0435.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='question',
name='type',
field=models.CharField(max_length=50, choices=[(b'boolean', b'Yes/No'), (b'text', b'Short text'), (b'textarea', b'Long text'), (b'integer', b'Integer value')]),
field=models.CharField(max_length=50, choices=[('boolean', 'Yes/No'), ('text', 'Short text'), ('textarea', 'Long text'), ('integer', 'Integer value')]),
),
migrations.AlterUniqueTogether(
name='applicant',
unique_together=set([(b'program', b'email')]),
unique_together=set([('program', 'email')]),
),
]
4 changes: 2 additions & 2 deletions grants/migrations/0005_auto_20140624_1719.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='score',
unique_together=set([(b'applicant', b'user')]),
unique_together=set([('applicant', 'user')]),
),
migrations.AlterUniqueTogether(
name='answer',
unique_together=set([(b'applicant', b'question')]),
unique_together=set([('applicant', 'question')]),
),
]
4 changes: 2 additions & 2 deletions grants/migrations/0006_auto_20140625_0139.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='score',
name='comment',
field=models.TextField(help_text=b'Seen only by other voters, not by the applicant', null=True, blank=True),
field=models.TextField(help_text='Seen only by other voters, not by the applicant', null=True, blank=True),
),
migrations.AlterField(
model_name='score',
name='score',
field=models.FloatField(help_text=b'From 0 (terrible) to 5 (excellent)', null=True, blank=True),
field=models.FloatField(help_text='From 0 (terrible) to 5 (excellent)', null=True, blank=True),
),
]
2 changes: 1 addition & 1 deletion grants/migrations/0007_auto_20140625_0314.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class Migration(migrations.Migration):
),
migrations.AlterUniqueTogether(
name='allocation',
unique_together=set([(b'applicant', b'resource')]),
unique_together=set([('applicant', 'resource')]),
),
]
2 changes: 1 addition & 1 deletion grants/migrations/0010_auto_20150320_1734.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='score',
name='score',
field=models.FloatField(help_text=b'From 1 (terrible) to 5 (excellent)', null=True, blank=True),
field=models.FloatField(help_text='From 1 (terrible) to 5 (excellent)', null=True, blank=True),
preserve_default=True,
),
migrations.AlterField(
Expand Down
8 changes: 4 additions & 4 deletions grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Program(models.Model):

users = models.ManyToManyField("users.User", blank=True)

def __unicode__(self):
def __str__(self):
return self.name

class urls(Urls):
Expand Down Expand Up @@ -64,7 +64,7 @@ class Resource(models.Model):
class urls(Urls):
edit = "{self.program.urls.resources}{self.id}/"

def __unicode__(self):
def __str__(self):
return self.name

def fa_icon(self):
Expand Down Expand Up @@ -103,7 +103,7 @@ class Question(models.Model):
class urls(Urls):
edit = "{self.program.urls.questions}{self.id}/"

def __unicode__(self):
def __str__(self):
return self.question

def can_delete(self):
Expand All @@ -125,7 +125,7 @@ class urls(Urls):
view = "{self.program.urls.applicants}{self.id}/"
allocations = "{view}allocations/"

def __unicode__(self):
def __str__(self):
return self.name

def average_score(self):
Expand Down
2 changes: 1 addition & 1 deletion users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ def email_user(self, subject, message, from_email=None, **kwargs):
"""
send_mail(subject, message, from_email, [self.email], **kwargs)

def __unicode__(self):
def __str__(self):
return self.name or self.email