Skip to content

Commit

Permalink
Merge branch 'master' into form-field-localisation
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmoo committed Sep 18, 2018
2 parents b1719fa + a3988ad commit 67b7ede
Show file tree
Hide file tree
Showing 26 changed files with 480 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,7 @@ before_script:
- psql -c 'create database network;' -U postgres
script:
- npm test
- pipenv run flake8 network-api/
- pipenv run flake8 tasks.py network-api/
- pipenv run coverage run --source './network-api/networkapi' network-api/manage.py test networkapi
after_success:
- coveralls
Expand Down
26 changes: 14 additions & 12 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -52,7 +52,7 @@ test_script:
- node --version
- npm --version
- npm test
- "python -m pipenv run flake8 network-api/"
- "python -m pipenv run flake8 tasks.py network-api/"
- "python -m pipenv run python network-api/manage.py test"

cache:
Expand Down
13 changes: 10 additions & 3 deletions network-api/networkapi/buyersguide/factory.py
Expand Up @@ -31,12 +31,19 @@ class Meta:
camera = Faker('boolean')
microphone = Faker('boolean')
location = Faker('boolean')
uses_encryption = Faker('boolean')
privacy_policy = Faker('url')
share_data = Faker('boolean')
must_change_default_password = Faker('boolean')
security_updates = Faker('boolean')
need_account = Faker('boolean')
privacy_controls = Faker('boolean')
delete_data = Faker('boolean')
share_data = Faker('boolean')
child_rules = Faker('boolean')
privacy_policy = Faker('url')
manage_security = Faker('boolean')
customer_support_easy = Faker('boolean')
phone_number = Faker('phone_number')
live_chat = Faker('url')
email = Faker('email')
worst_case = Faker('sentence')

@post_generation
Expand Down
@@ -0,0 +1,64 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-10 20:37
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('buyersguide', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='product',
name='privacy_controls',
),
migrations.AddField(
model_name='product',
name='customer_support_easy',
field=models.NullBooleanField(help_text='Makes it easy to contact customer support?'),
),
migrations.AddField(
model_name='product',
name='email',
field=models.CharField(blank='True', help_text='Email', max_length=100),
),
migrations.AddField(
model_name='product',
name='live_chat',
field=models.CharField(blank='True', help_text='Live Chat', max_length=100),
),
migrations.AddField(
model_name='product',
name='manage_security',
field=models.NullBooleanField(help_text='Manages security vulnerabilities?'),
),
migrations.AddField(
model_name='product',
name='must_change_default_password',
field=models.NullBooleanField(help_text='Must change a default password?'),
),
migrations.AddField(
model_name='product',
name='phone_number',
field=models.CharField(blank='True', help_text='Phone Number', max_length=100),
),
migrations.AddField(
model_name='product',
name='security_updates',
field=models.NullBooleanField(help_text='Security updates?'),
),
migrations.AddField(
model_name='product',
name='uses_encryption',
field=models.NullBooleanField(help_text='Does the product use encryption?'),
),
migrations.AlterField(
model_name='product',
name='price',
field=models.CharField(blank='True', help_text='Price', max_length=100),
),
]
80 changes: 70 additions & 10 deletions network-api/networkapi/buyersguide/models.py
Expand Up @@ -12,6 +12,8 @@ def get_product_image_upload_path(instance, filename):
)


# https://docs.google.com/document/d/1jtWOVqH20qMYRSwvb2rHzPNTrWIoPs8EbWR25r9iyi4/edit

class Product(models.Model):
"""
A thing you can buy in stores and our review of it
Expand All @@ -22,6 +24,7 @@ class Product(models.Model):
help_text='Name of Product',
blank="True",
)

company = models.CharField(
max_length=100,
help_text='Name of Company',
Expand All @@ -33,51 +36,108 @@ class Product(models.Model):
help_text='Description of the product',
blank="True"
)

url = models.URLField(
max_length=2048,
help_text='Link to this product page',
blank="True",
)

price = models.CharField(
max_length=100,
help_text='Price range',
help_text='Price',
blank="True",
)

image = models.FileField(
max_length=2048,
help_text='Image representing this prodct',
upload_to=get_product_image_upload_path,
blank=True,
)

# Can it spy on me?

camera = models.NullBooleanField(
help_text='Does this product have or access a camera?',
)

microphone = models.NullBooleanField(
help_text='Does this product have or access a microphone?',
)

location = models.NullBooleanField(
help_text='Does this product access your location?',
)

# What does it know about me?

uses_encryption = models.NullBooleanField(
help_text='Does the product use encryption?',
)

privacy_policy = models.URLField(
help_text='Link to privacy policy for this product',
max_length=2048,
blank="True",
)

share_data = models.NullBooleanField(
help_text='Does the maker share data with other companies?',
)

# Can I control it?

must_change_default_password = models.NullBooleanField(
help_text='Must change a default password?',
)

security_updates = models.NullBooleanField(
help_text='Security updates?',
)

need_account = models.NullBooleanField(
help_text='Do you need an account to use this product?',
)
privacy_controls = models.NullBooleanField(
help_text='Do users have access to privacy controls?',
)

delete_data = models.NullBooleanField(
help_text='Can you request data be deleted?',
)
share_data = models.NullBooleanField(
help_text='Does the maker share data with other companies?',
)

child_rules = models.NullBooleanField(
help_text='Are there rules for children?',
)
privacy_policy = models.URLField(
help_text='Link to privacy policy for this product',
max_length=2048,

# Company shows it cares about its customers?

manage_security = models.NullBooleanField(
help_text='Manages security vulnerabilities?',
)

customer_support_easy = models.NullBooleanField(
help_text='Makes it easy to contact customer support?',
)

phone_number = models.CharField(
max_length=100,
help_text='Phone Number',
blank="True",
)

live_chat = models.CharField(
max_length=100,
help_text='Live Chat',
blank="True",
)

email = models.CharField(
max_length=100,
help_text='Email',
blank="True",
)

# What could happen if something went wrong?

worst_case = models.CharField(
max_length=5000,
help_text="What's the worst thing that could happen by using this product?",
Expand Down
11 changes: 11 additions & 0 deletions network-api/networkapi/buyersguide/templates/about.html
@@ -0,0 +1,11 @@
{% extends "./bg_base.html" %}

{% block body-id %}about{% endblock %}

{% block guts %}

<div class="container">
<h1>About page goes here!</h1>
</div>

{% endblock %}

0 comments on commit 67b7ede

Please sign in to comment.