Conversation
.travis.yml
Outdated
| simplegeneric==0.8.1 | ||
| six==1.10.0 | ||
| traitlets==4.3.1 | ||
| wcwidth==0.1.7 |
There was a problem hiding this comment.
You seem to have mis-named your travis.yml file. This is a requirements file.
README.md
Outdated
| ``` | ||
|
|
||
| Django will typically serve on port 8000, unless you specify otherwise. | ||
| You can access the locally-served site at the address `http://localhost:8000`. No newline at end of file |
There was a problem hiding this comment.
....you weren't meant to copy the entire thing wholesale. Make sure it says what you want it to say. What about starting up the postgres database?
| blank=True | ||
| ) | ||
| address = models.CharField(max_length=40, null=True, blank=True), | ||
| bio = models.TextField(default="") |
There was a problem hiding this comment.
or you could have blank/null = True
imagersite/imager_profile/models.py
Outdated
|
|
||
| def __str__(self): | ||
| """Display user data as a string.""" | ||
| return "User: {}, Camera: {}, Address: {}, Phone number: {} For Hire? {}, Photography style: {}".format(self.user, self.camera_type, self.address, self.phone_number, self.for_hire, self.photography_type) |
There was a problem hiding this comment.
You probably want a comma after Phone number: {}
imagersite/imager_profile/tests.py
Outdated
|
|
||
| model = User | ||
|
|
||
| username = factory.Sequence(lambda n: "The Chosen {}".format(n)) |
There was a problem hiding this comment.
Again, you don't have to do exactly what I did in class here.
| """Test user has profile attached.""" | ||
| user = self.users[0] | ||
| self.assertTrue(hasattr(user, "profile")) | ||
| self.assertIsInstance(user.profile, ImagerProfile) |
There was a problem hiding this comment.
You need more tests. Test that the model manager you created works correctly. Test that the attributes that you expect are on the model. Test it inside and out so that there's no mystery as to what the model has on it (in terms of attributes) and what it can do.
imagersite/imagersite/settings.py
Outdated
| 'default': { | ||
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', | ||
| 'NAME': os.environ['IMAGER_DATABASE'], | ||
| # 'USER': os.environ['DATABASE_USER'], |
There was a problem hiding this comment.
If one computer needs the user and password, and the other doesn't, then you can just do:
'NAME': os.environ.get('DATABASE_USER', ''),
'PASSWORD': os.environ.get('DATABASE_PASSWORD', '')
imagersite/requirements.pip
Outdated
| @@ -0,0 +1,18 @@ | |||
| decorator==4.0.11 | |||
There was a problem hiding this comment.
This file shouldn't exist in this directory.
| def get_queryset(self): | ||
| """Return active users.""" | ||
| qs = super(ActiveProfileManager, self).get_queryset() | ||
| return qs.filter(user__is_active__exact=True) |
There was a problem hiding this comment.
Why do you need user__is_active__exact instead of just user__is_active?
| 'USER': os.environ.get('DATABASE_USER', ''), | ||
| 'PASSWORD': os.environ.get('DATABASE_PASSWORD', ''), | ||
| # 'HOST': '127.0.0.1', | ||
| # 'PORT': '5432', |
No description provided.