This repository has been archived by the owner on Oct 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
503 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,6 @@ redis>=2.10.0 | |
|
||
|
||
# Your custom requirements go here | ||
django-bleach==0.3.0 | ||
django-versatileimagefield==1.3 | ||
|
21 changes: 21 additions & 0 deletions
21
taravel/contrib/sites/migrations/0003_auto_20160408_2342.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.5 on 2016-04-08 23:42 | ||
from __future__ import unicode_literals | ||
|
||
import django.contrib.sites.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sites', '0002_set_site_domain_and_name'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='site', | ||
name='domain', | ||
field=models.CharField(max_length=100, unique=True, validators=[django.contrib.sites.models._simple_domain_name_validator], verbose_name='domain name'), | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class GuestsConfig(AppConfig): | ||
name = 'guests' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.5 on 2016-04-08 23:49 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import model_utils.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('orders', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Quest', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), | ||
('first_name', models.CharField(max_length=50, verbose_name='First name')), | ||
('second_name', models.CharField(max_length=50, verbose_name='Second name')), | ||
('government_id', models.IntegerField(verbose_name='Government ID')), | ||
('child', models.BooleanField(help_text='Is a child?', verbose_name='Child')), | ||
('value', models.IntegerField(verbose_name='Value')), | ||
('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.Order', verbose_name='Order')), | ||
], | ||
options={ | ||
'verbose_name': 'Quest', | ||
'verbose_name_plural': 'Quests', | ||
}, | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.core.urlresolvers import reverse | ||
from django.db import models | ||
from django.utils.encoding import python_2_unicode_compatible | ||
from django.utils.translation import ugettext_lazy as _ | ||
from model_utils.models import TimeStampedModel | ||
|
||
from taravel.orders.models import Order | ||
|
||
|
||
class QuestQuerySet(models.QuerySet): | ||
pass | ||
|
||
|
||
@python_2_unicode_compatible | ||
class Quest(TimeStampedModel): | ||
order = models.ForeignKey(to=Order, verbose_name=_("Order")) | ||
first_name = models.CharField(verbose_name=_("First name"), max_length=50) | ||
second_name = models.CharField(verbose_name=_("Second name"), max_length=50) | ||
government_id = models.IntegerField(verbose_name=_("Government ID")) | ||
child = models.BooleanField(verbose_name=_("Child"), help_text=_("Is a child?")) | ||
value = models.IntegerField(verbose_name=_("Value")) # TODO: Custom model field | ||
objects = QuestQuerySet.as_manager() | ||
|
||
class Meta: | ||
verbose_name = _("Quest") | ||
verbose_name_plural = _("Quests") | ||
|
||
def __str__(self): | ||
return "{first_name} {second_name}".format(first_name=self.first_name, | ||
second_name=self.second_name) | ||
|
||
def get_absolute_url(self): | ||
return reverse('guests:details', kwargs={'pk': self.pk}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class LocationsConfig(AppConfig): | ||
name = 'locations' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.5 on 2016-04-08 23:49 | ||
from __future__ import unicode_literals | ||
|
||
import autoslug.fields | ||
import django.contrib.gis.db.models.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Country', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('continent', models.IntegerField(choices=[(0, 'Asia'), (1, 'Africa'), (2, 'North America'), (3, 'South America'), (4, 'Antarctica'), (5, 'Europe'), (6, 'Australia')], default=5)), | ||
('name', models.CharField(blank=True, max_length=255, verbose_name='Name of User')), | ||
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True, verbose_name='Slug')), | ||
], | ||
options={ | ||
'verbose_name': 'Country', | ||
'verbose_name_plural': 'Countries', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Location', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=50, verbose_name='Name')), | ||
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True, verbose_name='Slug')), | ||
('position', django.contrib.gis.db.models.fields.PointField(srid=4326, verbose_name='Position')), | ||
], | ||
options={ | ||
'verbose_name': 'Location', | ||
'verbose_name_plural': 'Locations', | ||
}, | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from __future__ import unicode_literals | ||
|
||
from autoslug.fields import AutoSlugField | ||
from django.core.urlresolvers import reverse | ||
from django.contrib.gis.db import models | ||
from django.utils.encoding import python_2_unicode_compatible | ||
from django.utils.translation import ugettext_lazy as _ | ||
from model_utils import Choices | ||
|
||
|
||
@python_2_unicode_compatible | ||
class Country(models.Model): | ||
CONTINENT = Choices((0, 'asia', 'Asia'), | ||
(1, 'africa', 'Africa'), | ||
(2, 'north_america', 'North America'), | ||
(3, 'south_america', 'South America'), | ||
(4, 'antarctica', 'Antarctica'), | ||
(5, 'europe', 'Europe'), | ||
(6, 'australia', 'Australia')) | ||
continent = models.IntegerField(choices=CONTINENT, default=CONTINENT.europe) | ||
name = models.CharField(_("Name of User"), blank=True, max_length=255) | ||
slug = AutoSlugField(populate_from='name', verbose_name=_("Slug"), unique=True) | ||
|
||
class Meta: | ||
verbose_name = _("Country") | ||
verbose_name_plural = _("Countries") | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
|
||
class LocationQuerySet(models.query.GeoQuerySet): | ||
pass | ||
|
||
|
||
@python_2_unicode_compatible | ||
class Location(models.Model): | ||
name = models.CharField(verbose_name=_("Name"), max_length=50) | ||
slug = AutoSlugField(populate_from='name', verbose_name=_("Slug"), unique=True) | ||
position = models.PointField(verbose_name=_("Position")) | ||
objects = LocationQuerySet.as_manager() | ||
|
||
class Meta: | ||
verbose_name = _("Location") | ||
verbose_name_plural = _("Locations") | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
def get_absolute_url(self): | ||
return reverse('locations:details', kwargs={'slug': self.slug}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class OrdersConfig(AppConfig): | ||
name = 'orders' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.5 on 2016-04-08 23:49 | ||
from __future__ import unicode_literals | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('trips', '0001_initial'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Order', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')), | ||
('paid', models.DateField(blank=True, null=True, verbose_name='Date of payment')), | ||
('trip', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='trips.Trip', verbose_name='Trip')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User')), | ||
], | ||
options={ | ||
'verbose_name': 'Order', | ||
'verbose_name_plural': 'Orders', | ||
}, | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
from django.core.urlresolvers import reverse | ||
from django.conf import settings | ||
from django.utils.encoding import python_2_unicode_compatible | ||
|
||
from taravel.trips.models import Trip | ||
|
||
|
||
class OrderQuerySet(models.QuerySet): | ||
pass | ||
|
||
|
||
@python_2_unicode_compatible | ||
class Order(models.Model): | ||
user = models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name=_("User")) | ||
trip = models.ForeignKey(to=Trip, verbose_name=_("Trip")) | ||
created = models.DateTimeField(verbose_name=_("Creation date"), auto_now_add=True) | ||
paid = models.DateField(verbose_name=_("Date of payment"), blank=True, null=True) | ||
objects = OrderQuerySet.as_manager() | ||
|
||
class Meta: | ||
verbose_name = _("Order") | ||
verbose_name_plural = _("Orders") | ||
|
||
def __str__(self): | ||
return self.pk | ||
|
||
def get_absolute_url(self): | ||
return reverse('orders:details', kwargs={'slug': self.slug}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class TripsConfig(AppConfig): | ||
name = 'trips' |
Oops, something went wrong.