Skip to content

Commit

Permalink
Merge pull request #227 from FJNR-inc/develop
Browse files Browse the repository at this point in the history
new release
  • Loading branch information
RignonNoel authored Oct 11, 2019
2 parents 40ff8c9 + 96d40ad commit 7567023
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pycodestyle==2.5.0
coveralls==1.8.2
responses==0.10.6
six==1.12.0
awscli==1.16.256
awscli==1.16.257
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python-decouple==3.1
django-storages==1.7.2
dj_database_url==0.5.0
zappa==0.48.2
psycopg2==2.7.5
psycopg2-binary==2.8.3
django-safedelete==0.5.2
-e git+https://github.com/Rhumbix/django-request-logging.git@9342ee6064e678fd162418b142d781550d23101c#egg=django_request_logging
-e git+https://github.com/deschler/django-modeltranslation.git@c8bda494a8cd36b393811552aeee71faf86d7438#egg=django-modeltranslation
Expand Down
Binary file added retirement/migrations/.DS_Store
Binary file not shown.
33 changes: 33 additions & 0 deletions retirement/migrations/0021_auto_20191010_1503.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 2.2.6 on 2019-10-10 19:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('retirement', '0020_auto_20191004_0256'),
]

operations = [
migrations.AddField(
model_name='historicalretreat',
name='room_type',
field=models.CharField(blank=True, choices=[('double_occupation', 'Double occupation'), ('single_occupation', 'Single occupation'), ('double_single_occupation', 'Single and double occupation')], max_length=100, null=True, verbose_name='Room Type'),
),
migrations.AddField(
model_name='historicalretreat',
name='toilet_gendered',
field=models.BooleanField(blank=True, null=True, verbose_name='gendered toilet'),
),
migrations.AddField(
model_name='retreat',
name='room_type',
field=models.CharField(blank=True, choices=[('double_occupation', 'Double occupation'), ('single_occupation', 'Single occupation'), ('double_single_occupation', 'Single and double occupation')], max_length=100, null=True, verbose_name='Room Type'),
),
migrations.AddField(
model_name='retreat',
name='toilet_gendered',
field=models.BooleanField(blank=True, null=True, verbose_name='gendered toilet'),
),
]
23 changes: 23 additions & 0 deletions retirement/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,22 @@

class Retreat(Address, SafeDeleteModel, BaseProduct):
"""Represents a retreat physical place."""
DOUBLE_OCCUPATION = 'double_occupation'
SINGLE_OCCUPATION = 'single_occupation'
DOUBLE_SINGLE_OCCUPATION = 'double_single_occupation'

ACTIVITY_LANGUAGE = (
('EN', _("English")),
('FR', _("French")),
('B', _("Bilingual")),
)

ROOM_CHOICES = (
(DOUBLE_OCCUPATION, _("Double occupation")),
(SINGLE_OCCUPATION, _("Single occupation")),
(DOUBLE_SINGLE_OCCUPATION, _("Single and double occupation")),
)

class Meta:
verbose_name = _("Retreat")
verbose_name_plural = _("Retreats")
Expand All @@ -56,6 +65,12 @@ class Meta:
default=0,
)

toilet_gendered = models.BooleanField(
null=True,
blank=True,
verbose_name=_("gendered toilet"),
)

next_user_notified = models.PositiveIntegerField(
verbose_name=_(
"Index of the user to be notified next for a resserved place."
Expand All @@ -78,6 +93,14 @@ class Meta:
verbose_name=_("Activity language"),
)

room_type = models.CharField(
null=True,
blank=True,
max_length=100,
choices=ROOM_CHOICES,
verbose_name=_("Room Type"),
)

start_time = models.DateTimeField(verbose_name=_("Start time"), )

end_time = models.DateTimeField(verbose_name=_("End time"), )
Expand Down
2 changes: 2 additions & 0 deletions retirement/tests/tests_model_Retreat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def test_create(self):
carpool_url='example2.com',
review_url='example3.com',
has_shared_rooms=True,
room_type=Retreat.DOUBLE_OCCUPATION,
toilet_gendered=True,
)

self.assertEqual(retreat.__str__(), "random_retreat")
8 changes: 8 additions & 0 deletions retirement/tests/tests_viewset_Reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def setUp(self):
carpool_url='example2.com',
review_url='example3.com',
has_shared_rooms=True,
toilet_gendered=False,
room_type=Retreat.SINGLE_OCCUPATION,
)
self.retreat2 = Retreat.objects.create(
name="random_retreat",
Expand All @@ -97,6 +99,8 @@ def setUp(self):
carpool_url='example2.com',
review_url='example3.com',
has_shared_rooms=True,
toilet_gendered=False,
room_type=Retreat.SINGLE_OCCUPATION,
)
self.retreat_overlap = Retreat.objects.create(
name="ultra_retreat",
Expand All @@ -118,6 +122,8 @@ def setUp(self):
carpool_url='example2.com',
review_url='example3.com',
has_shared_rooms=True,
toilet_gendered=False,
room_type=Retreat.SINGLE_OCCUPATION,
)
self.order = Order.objects.create(
user=self.user,
Expand Down Expand Up @@ -295,6 +301,8 @@ def test_create(self):
'available_on_product_types': [],
'available_on_products': [],
'options': [],
'room_type': Retreat.SINGLE_OCCUPATION,
'toilet_gendered': False,
},
'user_details': {
'academic_field': None,
Expand Down
Loading

0 comments on commit 7567023

Please sign in to comment.