Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-13 Thread Felipe Coelho
I'm using Django 1.5 and I'm trying to make an application work with any custom user model. The issue is that I want to be able to test the app as well, but I can't find a way to make `ForeignKey` model fields to test correctly using custom user models. When I run the test case attached below, I g

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-16 Thread Felipe Coelho
2013/3/14 Felipe Coelho > I'm using Django 1.5 and I'm trying to make an application work with > any custom user model. > > The issue is that I want to be able to test the app as well, but I > can't find a way to make `ForeignKey` model fields to test correctly >

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-18 Thread Felipe Coelho
> > 1) Using tests that need the models, but don't actually touch the > database. This means you can put the model definition inline in the test > code, so AUTH_USER_MODEL has the right value when the code is run. This > lets us test validation conditions, etc, but not hit the database. You > *mig

Re: Django 1.5 where are the static files of admin site

2013-03-19 Thread Felipe Coelho
2013/3/19 RedJuan > I'm setting up nginx to serve static files. > Route (django / contrib / admin / media / admin) is not on the > installation path (/ usr/local/lib/python2.7/dist-packages/django) > Where is it located now? > Why don't you run "python manage.py collectstatic" and set the nginx

Re: save as

2013-03-20 Thread Felipe Coelho
> > 2013/3/20 Larry Martell > I'm not outputting any PDF. I have a zip file I want to download to > the user's computer, and I also want my template rendered. That means you have should have two requests, possibly processed by two different views, which is what Felipe (the other one) is trying

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-27 Thread Felipe Coelho
2013/3/18 Felipe Coelho > 1) Using tests that need the models, but don't actually touch the >> database. This means you can put the model definition inline in the test >> code, so AUTH_USER_MODEL has the right value when the code is run. This >> lets us test validatio

Re: check genre and insert

2013-04-27 Thread Felipe Coelho
2013/4/27 Hélio Miranda > Made the proposed change, but what happens is that when will insert the > movie with a genre that already exists to get the id of that genre, gives > the following error: ObjectId ('517b15658774a7177cb1280d ') as the id that > comes from this comes mongodb form. > > When

Re: Unable to access URL's query string using request.GET['next']

2013-05-24 Thread Felipe Coelho
2013/5/25 Amber Jain > Hello, > > I can't seem to access request.GET['next'] (from a URL with a query > string). Here's what I'm doing: > localhost:8000/dashboard/ points to dashboard() view but the dashboard() > view uses @login_required decorator. And so, if the user isn't logged in, > localhos

Re: Add a file download link that work only after login

2013-06-05 Thread Felipe Coelho
2013/6/5 A T.Khan > I have already a Django setup running (you guessed it devstack), and it > works fine. I have done plenty of editing already. But now I want to add a > download button on a page, and by clicking to it, a file should be > downloaded. Seems simple enough, but right now what I hav

Re: captcha field django form designer, success html mail.

2013-06-19 Thread Felipe Coelho
2013/6/19 pradnya > ... > > ('django.forms.RegexField', _('Regex')), > > ('django.forms.FileField', _('File')), > > # ('captcha.fields.CaptchaField', _('Captcha')), > > The django-recaptcha field is called "ReCaptchaField", not just "CaptchaField" -- You received this message becau

Re: How to store site-wide application settings

2013-06-27 Thread Felipe Coelho
2013/6/27 rush > Hi, > > Could please somebody advice how to store application settings and allow > to edit them via admin panel? > Settings are used site-wide, not on per user basis. > > This settings have different types ( text, ineteger, images aka banners ) > therefore it looks impossible to

Re: Tango with Django Tutorials

2013-11-22 Thread Felipe Coelho
On Nov 22, 2013 7:01 AM, "Amimo Benja" wrote: > > Does anyone know how I can convert the entire Tango with Django Tutorials from online to an offline website that I can store and use on my hard disk? Please help I desperately need to use this site while am offline The book is open source, jus

Re: django tests

2013-11-23 Thread Felipe Coelho
2013/11/23 Harjot Mann > On Sat, Nov 23, 2013 at 2:49 PM, Simone Dalla wrote: > > the correct code should be > > > > ... > > self.userprofile = UserProfile.objects.filter(user_id =1) > > self.userprofile.update(first_name = "Harjot") > > ... > > self.assertEqual(self.userprofile.user_id, 1) > >

Re: Email Templates and the full website URL

2013-11-29 Thread Felipe Coelho
2013/11/29 Joseph Mutumi > That could work but isn't it a bit insecure? I think it will be > susceptible to a header injection( > http://en.wikipedia.org/wiki/HTTP_header_injection). I would rather > create a setting with the domain name in settings.py and then call it from > the template or writ

Re: Problems with default settings.py file

2013-12-02 Thread Felipe Coelho
2013/12/2 Blake Adams > Hello I am a python noob going through the getttingstarted with django > tutorial. > > For some reason When I start a new project, the default settings.py file > is missing a lot of default settings (Admin, Media, Some of the Databse > info, Statis_file, Logging, etc.). I

Re: Where exactly in the django source code, the default permissions are created?

2013-12-20 Thread Felipe Coelho
2013/12/19 Fabio C. Barrionuevo da Luz > Hello guys, I'm trying to understand the inner workings of the permissions > django system. > > My question is where exactly in the django source code, the default > permissions are created? > Default permissions are created by django.contrib.auth.managem