These are chat archives for django/django

1st
Feb 2016
Job Matheka
@jobm
Feb 01 2016 08:00
hey guys so we are working on a project, so the idea is that a chef sings up and then the chef needs to invite a team to his kitchen, each chef will have a unique kitchen. so my question is, what is the best way to implement the invitation process, inviting the user directly to the chef's team.
Filip Figiel
@megapctr
Feb 01 2016 11:36
your invitation model should store a unique, random token and ForeignKey to the chef's kitchen
you send e-mail with a link with that token, then you look up the tokens in the view
@jobm
Nicholas Penny
@nickpennyuk
Feb 01 2016 12:29
Hi, I have a list of musical artists where each artist clicks through to a list of their indiviual albums which has an add album button. The add album form has the fields artist, title and year. the artist field is a drop down with all of my artists in it but i want it to only show the artist i click on in the artists page not all of them. Does anybody have any suggestions as to how i would do this?
Job Matheka
@jobm
Feb 01 2016 12:31
@megapctr that's interesting, ill try it out and see how it works, can i contact you directly in case of more questions?
loken
@lokenx
Feb 01 2016 14:43
Any testing experts here? How does one get coverage for the wsgi.py file that's created by default?
Filip Figiel
@megapctr
Feb 01 2016 14:44
@lokenx I think you can configure coverage to ignore that file
If you want to have coverage for that file, you probably can just import it in some test
loken
@lokenx
Feb 01 2016 14:46
@megapctr never thought about ignoring.. I'll try that as it's annoying when doing coverage checks
Filip Figiel
@megapctr
Feb 01 2016 14:47
@lokenx
$ cat .coveragerc 
[run]

omit = */migrations/*
loken
@lokenx
Feb 01 2016 14:51
Cool thanks :thumbsup:
Filip Figiel
@megapctr
Feb 01 2016 14:52
you're welcome ;)
loken
@lokenx
Feb 01 2016 14:52
Now actually, just realised I'm using travis for CI

So my script looks like this

- coverage run --source='.' manage.py test

Filip Figiel
@megapctr
Feb 01 2016 14:52
Yeah, coverage should read config from .coveragerc
loken
@lokenx
Feb 01 2016 14:53
Would adding --omit='wsgi.py or something before --source do it? (not a machine to test locally)
Filip Figiel
@megapctr
Feb 01 2016 14:54
probably yes
I'd stick to keeping config in a file though
loken
@lokenx
Feb 01 2016 15:03
So how would I move that line of code from my .travis.yml file to a config? Or is that what you mean
Nicholas Penny
@nickpennyuk
Feb 01 2016 18:22
I'll shorten my last question to make it easier to uderstand. I have localhost:8000/artist/1/albums/new which leads to a form with the fields artist, title and year. the artist field is a dropdown of all artists instead of automatically displaying the selected artist with the ID of 1. ANy ideas?
MCanv
@mcanv
Feb 01 2016 22:47

Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==7.1.0', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 305, in load_entry_point

what should i do ?