Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Scot Hacker
On Friday, February 6, 2015 at 9:39:00 AM UTC-8, Henry Versemann wrote: > > Scot, Thanks for the reply. OK I've gotten down to the point to where I > have my version of your json_data in your code below, but I'm not sure I > understand exactly what your code is doing, after you have the

Re: Django default auth user but unique email

2015-02-06 Thread Bruce Li
Thanks for your advice, I was too busy to reply. I will learn to use a custom model. Thanks. On Tuesday, January 27, 2015 at 2:36:53 PM UTC+8, James Schneider wrote: > > If you want any sort of enforcement of a unique email address at the > database level, you'll need a custom user model. If

Re: mark_safe and ValidationError params

2015-02-06 Thread Mike Dewhirst
On 7/02/2015 10:29 AM, Mike Dewhirst wrote: How do I properly apply mark_safe to text passed to params of exceptions? mark_safe returns a string-like object so if you embed it inside another string it might get missed. I think it is best to apply mark_safe when the return value won't be

Re: App for storing ChangeLogs in database

2015-02-06 Thread Russell Keith-Magee
On Fri, Feb 6, 2015 at 8:24 PM, Thomas Güttler wrote: > Hi, > > we want to make the changes in our applications better visible for our > customers. > > We use several git repos: > > - foo_customer: Here settings.py lives. It is quite small. > > - foo_core: Central part of

Re: mark_safe and ValidationError params

2015-02-06 Thread Mike Dewhirst
On 7/02/2015 8:32 AM, Andrew Pinkham wrote: I'm currently running Django 1.7.4. Provided the following clean function on a form: def clean_slug(self): new_slug = self.cleaned_data['slug'].lower() if new_slug == 'invalid_value': raise ValidationError(

Re: App for storing ChangeLogs in database

2015-02-06 Thread Mike Dewhirst
I don't have a solution for you but maybe you are just looking for strategies? Like you, I don't like showing users the commit messages. We use Trac for our ticketing and insist no work gets done without a ticket. We added a custom field to Trac called "Release note". So when someone raises a

FormWizard, FileField and going back

2015-02-06 Thread Roodie
Hey all, I've run into a strange problem. I have a rather large model for a school application process. I am using the FormWizard feature with a SessionWizardView and 3 ModelForms to present the entry fields in manageable chunks. Everything is working properly, except the 3 FileFields. The

mark_safe and ValidationError params

2015-02-06 Thread Andrew Pinkham
I'm currently running Django 1.7.4. Provided the following clean function on a form: def clean_slug(self): new_slug = self.cleaned_data['slug'].lower() if new_slug == 'invalid_value': raise ValidationError( # _ is ugettext

Re: admin shows `model name` object instead of values for foreign key fields

2015-02-06 Thread Larry Martell
On Fri, Feb 6, 2015 at 4:06 PM, Daniel Roseman wrote: > On Friday, 6 February 2015 20:30:02 UTC, larry@gmail.com wrote: >> >> I have a 1.7 app, and in admin when I reference a foreign key field, >> instead of showing the values in the drop down, it shows "`model name`

Re: admin shows `model name` object instead of values for foreign key fields

2015-02-06 Thread Daniel Roseman
On Friday, 6 February 2015 20:30:02 UTC, larry@gmail.com wrote: > > I have a 1.7 app, and in admin when I reference a foreign key field, > instead of showing the values in the drop down, it shows "`model name` > object": > > > How can I get it show the values from the IPGroups table? I'm

admin shows `model name` object instead of values for foreign key fields

2015-02-06 Thread Larry Martell
I have a 1.7 app, and in admin when I reference a foreign key field, instead of showing the values in the drop down, it shows "`model name` object": [image: Inline image 2] This does not happen in 1.5 (in a different app). Here are my models: class IPGroups(models.Model): groupName =

Re: Strange error with reverse() when running tests

2015-02-06 Thread João Sampaio
Oh, I totally overlooked that! Thank you. On Friday, February 6, 2015 at 12:10:15 PM UTC-3, Daniel Roseman wrote: > > > > On Thursday, 5 February 2015 12:34:51 UTC, João Sampaio wrote: >> >> There are 3 Python files attached. >> >> I have my URL file attached. I'm using django-rest-framework (in

static files with query strings

2015-02-06 Thread Mark Mikofski
Do I need to make a custom storage or custom template to handle query strings in static file URLs or endpoints? Using the new static template in Django>=1.4 works fine for simple endpoints and URLs For example, the following works fine: {% load staticfiles %} However if the ULR or

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Henry Versemann
Thanks Larry. On Thursday, February 5, 2015 at 1:17:37 PM UTC-6, larry@gmail.com wrote: > > On Thu, Feb 5, 2015 at 2:10 PM, Henry Versemann > wrote: > > I have a django view (django v. 1.7 ; python v. 2.7.8) which currently > and > > successfully sends a request to

Re: amazon s3 and django - Allow only the users from my website and not the anonymous users

2015-02-06 Thread Nikolas Stevenson-Molnar
It sounds like you want to use signed URLs. Since you're using storages, this should be the default if you use the "url" property. E.g., signed_url = status_obj.image.url Then keep the file itself private. No one will be able to access it without a signed URL, and you can control who gets a

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Henry Versemann
Scot, Thanks for the reply. OK I've gotten down to the point to where I have my version of your json_data in your code below, but I'm not sure I understand exactly what your code is doing, after you have the json_data variable contents. In my case the first object of response data that I'm

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Scot Hacker
On Thursday, February 5, 2015 at 11:10:32 AM UTC-8, Henry Versemann wrote: > > I have a django view (django v. 1.7 ; python v. 2.7.8) which currently and > successfully sends a request to an api, and receives a good response back. > I'm sending and receiving using the 'requests' library (v.

amazon s3 and django - Allow only the users from my website and not the anonymous users

2015-02-06 Thread Kakar Nyori
I am using amazon s3 to store uploaded user images. My problems are: - If I permit or grantee for me, I cannot upload or download the contents. - If I permit or grantee for everyone, all the users and (especially) anonymous users will be able to see the contents, which I don't want. So, my

Re: Strange error with reverse() when running tests

2015-02-06 Thread Daniel Roseman
On Thursday, 5 February 2015 12:34:51 UTC, João Sampaio wrote: > > There are 3 Python files attached. > > I have my URL file attached. I'm using django-rest-framework (in case you > are wondering what the routers are). When I use ./manage.py test with the > first file (file1.py), the tests

Login in all pages

2015-02-06 Thread Nelson Varela
Take a look at middleware. You can create a middleware which runs for every request. In 'process_request' you can check if the user is authenticated. If not... show or redirect to the login view. The advantage is that you don't have to worry about placing decorators above your views. -- You

App for storing ChangeLogs in database

2015-02-06 Thread Thomas Güttler
Hi, we want to make the changes in our applications better visible for our customers. We use several git repos: - foo_customer: Here settings.py lives. It is quite small. - foo_core: Central part of our application. The same code gets used for several customers. - foo_plugin_bar: Just