Re: Why i can't get the debug informations (in case of error) when i run LiveServerTestCase tests?

2013-01-30 Thread Alessandro Pelliciari
Thanks for the answer!

Because i'm developing and integrating some flow (social registration etc) 
through tests.

So, instead of creating every time a new user, creating a new social 
association, and then after every try delete them from the database, the 
test does it from me.

So, its like a kind of dirty TDD with functional (selenium because i have 
facebook login for example) testing.


Anyway i think i can resolve with the 500 response logging the error to the 
console, but it's my first project in Django (and python) so i can't 
understand completely the way to logging at this moment.

 
Alessandro


Il giorno mercoledì 30 gennaio 2013 03:18:46 UTC+1, Ramiro Morales ha 
scritto:
>
> Ramiro Morales
> On Jan 29, 2013 12:33 PM, "Alessandro Pelliciari" 
> > 
> wrote:
> >
> > thanks for the link!
> >
> > So Isn't there a way to set DEBUG=True in tests?
>
> No. There isn't (at least with the built-in testing toolbox).
>
> Now, I'm trying to understand why do you rely in the debugging 500 
> response contents on your tests. Do you screen scrap it to extract  
> information about the origin of the failure?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




previous values of custom method in save

2013-01-30 Thread Sammael
Dear friends,

here is the relevant part of my model:

*class Album(models.Model):*
*name = models.CharField(max_length=64, blank=True)
*
*tags = models.ManyToManyField(Tag, blank=True)
*
*def tags_(self):
*
*return ', '.join([t.name for t in self.tags.all()])*
*def save(self, *args, **kwargs):
*
*super(Album, self).save(*args, **kwargs)*
*json.dump( {'name': self.name, 'tags': self.tags_()} , 
open('/tmp/info.txt', 'wb'), sort_keys=True)*
*
*
When I change 'tags' in admin panel and save my model, old tags are being 
written to file 'info.txt' instead of new ones, but it works good with 
regular fields like self.name. 
How do I overcome this issue?
Thank you in advance for any advice.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




get_absolute_url with custom extra parameter

2013-01-30 Thread Sammael
Hello friends,

Is the any way to pass an extra parameter to get_absolute_url method of a 
model instance from template?

Thank you for your answer.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django Framework Biginer guide please

2013-01-30 Thread Vikas Yewale
I am new in Django-Python.so want guide to develope web based application 
using Django framework.

I Have  :
  OS- UBUNTU , Putty  , Open ERP.
  so please guide me Softwre requirement to develope django web 
based Apps.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django Framework Biginer guide please

2013-01-30 Thread Frankline
Just a question:

How is Putty and OpenERP relevant to the question?

In the meantime, you can start here: https://docs.djangoproject.com/en/1.4/

On Wed, Jan 30, 2013 at 12:49 PM, Vikas Yewale  wrote:

> I am new in Django-Python.so want guide to develope web based application
> using Django framework.
>
> I Have  :
>   OS- UBUNTU , Putty  , Open ERP.
>   so please guide me Softwre requirement to develope django web
> based Apps.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How to make a field required in admin site

2013-01-30 Thread Ariel Isaac
Hi everybody,

I have a model inherited from a third application call Video in that
model they have the thumbnail field with blank = True, this make in
the admin site that user could left in blank the thumbnail field,
that's something I don't want to happen, I want to make in the
admin.py in VideoAdmin the field thumbnail required, how is possible
that ??? anybody knows how to achieve that ???

I am working with django 1.3

Regards,
Ariel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django hosting companies

2013-01-30 Thread m1chael
aws micro instance

On Tue, Jan 29, 2013 at 10:54 AM, Mengu  wrote:
> some of my friends are using webfaction. i use linode and in the past
> i have used webbynode.
>
> On Jan 29, 3:17 pm, francislutalo  wrote:
>> Anyone with an idea of which are the best companies to host my django
>> applications?
>>
>> Thank you,
>> Regards
>> francislutalo
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to make a field required in admin site

2013-01-30 Thread Black9design.com
Remove the line blank=True and it will be required.

On Jan 30, 2013, at 7:01 AM, Ariel Isaac  wrote:

> Hi everybody,
> 
> I have a model inherited from a third application call Video in that
> model they have the thumbnail field with blank = True, this make in
> the admin site that user could left in blank the thumbnail field,
> that's something I don't want to happen, I want to make in the
> admin.py in VideoAdmin the field thumbnail required, how is possible
> that ??? anybody knows how to achieve that ???
> 
> I am working with django 1.3
> 
> Regards,
> Ariel
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




raw_id_fields

2013-01-30 Thread Robert Dollinger
Hi everybody,

I have a m2m relation where in my AdminForm I would use raw_id_fields instead 
of the filter_horizontal option. For explanation I prefer the raw_id_fields 
instead of the filter_horizontal option, because there records are already 
categorized. So in the popup-window the user has the ability to search and 
filter via category. 
But there are two points that I can't figure out:

- possibility to selecting more than one record in the popup window
- showing the real names instead of the pk in the input_field

Thanks in advanced for help

bye
Robert

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Long url parameter in GET request locks python

2013-01-30 Thread Shawn H
I posted this question yesterdat at stack 
overflow,
 
but I'm wondering if this is a bug.  I have a url that accepts one text 
parameter, allows spaces, and calls a very simple view that checks if there 
are objects with a project name that matches the text parameter value. The 
view returns a simple json string indicating whether there's a project with 
that name already in the database.  It works great, repeatedly, with short 
parameter values.  It locks up python on certain long string values.  I've 
tested up to 50 characters, and just length doesn't trigger it.  What does 
seem to repeatedly trigger it are long strings with multiple spaces.  I've 
tested my url regex matching and those long strings match just fine; my 
concern is that for some reason inside the view that long string is causing 
problems.  I'm using Django 1.4 with the built in webserver for testing. 
 Any help that can be provided will be greatly appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Long url parameter in GET request locks python

2013-01-30 Thread Fabian Ezequiel Gallina
2013/1/30 Shawn H :
> I posted this question yesterdat at stack overflow, but I'm wondering if
> this is a bug.  I have a url that accepts one text parameter, allows spaces,
> and calls a very simple view that checks if there are objects with a project
> name that matches the text parameter value. The view returns a simple json
> string indicating whether there's a project with that name already in the
> database.  It works great, repeatedly, with short parameter values.  It
> locks up python on certain long string values.  I've tested up to 50
> characters, and just length doesn't trigger it.  What does seem to
> repeatedly trigger it are long strings with multiple spaces.  I've tested my
> url regex matching and those long strings match just fine; my concern is
> that for some reason inside the view that long string is causing problems.
> I'm using Django 1.4 with the built in webserver for testing.  Any help that
> can be provided will be greatly appreciated.
>

I have a strong feeling it is related on how your regexp matches the
passed string, I don't know why in the world you would sanitize the
project's name directly in the url and not the view, in any case if
the user happen to enter garbage then filter will not find anything,
right? Also this seems a job for a GET parameter rather than a view
param, but YMMV.


Regards,
-- 
Fabián E. Gallina
http://www.from-the-cloud.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Long url parameter in GET request locks python

2013-01-30 Thread Alasdair Nicol

On 30/01/13 16:38, Shawn H wrote:
I posted this question yesterdat at stack overflow 
, 
but I'm wondering if this is a bug.  I have a url that accepts one 
text parameter, allows spaces, and calls a very simple view that 
checks if there are objects with a project name that matches the text 
parameter value. The view returns a simple json string indicating 
whether there's a project with that name already in the database.  It 
works great, repeatedly, with short parameter values.  It locks up 
python on certain long string values.  I've tested up to 50 
characters, and just length doesn't trigger it.  What does seem to 
repeatedly trigger it are long strings with multiple spaces.  I've 
tested my url regex matching and those long strings match just fine; 
my concern is that for some reason inside the view that long string is 
causing problems.  I'm using Django 1.4 with the built in webserver 
for testing.  Any help that can be provided will be greatly 
appreciated. --



Hi Shawn,

I've answered your question on Stack Overflow, but I'll post it here as 
well:


Since you are going to check whether `aProjectName` already exists in 
the database, there's no need for you to make the regex so complicated.


I suggest you simplify the regex to

url(r'^chargeback/checkDuplicateProject/(?P[\w+\s-]*)/$', 
'chargeback.views.isProjectDuplicate'),


For a further explanation, see the question "url regex keeps django 
busy/crashing" [1] from the django-users group.


[1]: https://groups.google.com/d/msg/django-users/Bxq9i0mttSc/DEz7S7M8lxAJ

Cheers,
Alasdair

--
Alasdair Nicol
Developer, MEMSET

mail: alasd...@memset.com
 web: http://www.memset.com/

Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford, 
Surrey, GU2 7YD, UK.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Long url parameter in GET request locks python

2013-01-30 Thread Shawn H
Indeed it was.  As Alisdair posted, simplify the regex and validate 
elsewhere.  Thanks.

On Wednesday, January 30, 2013 11:26:51 AM UTC-6, fgallina wrote:
>
> 2013/1/30 Shawn H >: 
> > I posted this question yesterdat at stack overflow, but I'm wondering if 
> > this is a bug.  I have a url that accepts one text parameter, allows 
> spaces, 
> > and calls a very simple view that checks if there are objects with a 
> project 
> > name that matches the text parameter value. The view returns a simple 
> json 
> > string indicating whether there's a project with that name already in 
> the 
> > database.  It works great, repeatedly, with short parameter values.  It 
> > locks up python on certain long string values.  I've tested up to 50 
> > characters, and just length doesn't trigger it.  What does seem to 
> > repeatedly trigger it are long strings with multiple spaces.  I've 
> tested my 
> > url regex matching and those long strings match just fine; my concern is 
> > that for some reason inside the view that long string is causing 
> problems. 
> > I'm using Django 1.4 with the built in webserver for testing.  Any help 
> that 
> > can be provided will be greatly appreciated. 
> > 
>
> I have a strong feeling it is related on how your regexp matches the 
> passed string, I don't know why in the world you would sanitize the 
> project's name directly in the url and not the view, in any case if 
> the user happen to enter garbage then filter will not find anything, 
> right? Also this seems a job for a GET parameter rather than a view 
> param, but YMMV. 
>
>
> Regards, 
> -- 
> Fabián E. Gallina 
> http://www.from-the-cloud.com 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to make a field required in admin site

2013-01-30 Thread Ariel Isaac
It is a third application I can't do that, that's why I want to do it in
the adminModel.

Could you help me please ???



On Wed, Jan 30, 2013 at 10:34 AM, Black9design.com
wrote:

> Remove the line blank=True and it will be required.
>
> On Jan 30, 2013, at 7:01 AM, Ariel Isaac  wrote:
>
> > Hi everybody,
> >
> > I have a model inherited from a third application call Video in that
> > model they have the thumbnail field with blank = True, this make in
> > the admin site that user could left in blank the thumbnail field,
> > that's something I don't want to happen, I want to make in the
> > admin.py in VideoAdmin the field thumbnail required, how is possible
> > that ??? anybody knows how to achieve that ???
> >
> > I am working with django 1.3
> >
> > Regards,
> > Ariel
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Long url parameter in GET request locks python

2013-01-30 Thread Andre Terra
I posted this answer on SO and thought I should share it here for the
benefit of other and future readers:

--

 The accepted answer is spot on about the regex, but since we're discussing
optimization, I thought I should note that the code for checking whether a
project exists could be modified to generate a much quicker query,
especially in other contexts where you could be counting millions of rows
needlessly. Call this 'best practices' advice, if you will.

p = Project.objects.filter(projectName__exact = aProjectName).count()if p > 0:

 could instead be

if Project.objects.filter(project_name__iexact=aProjectName).exists():

 for two reasons.

First, you're not using p for anything so there's no need to store it as a
variable as it increases readability and p is an obscure variable name and the
best code is no code at
all
.

Secondly, by This way we only ask for a single row instead of saving the
results to the queryset cache. Please see the official Queryset API
docs
, a related question on Stack
Overflow
 and the discussion about the latter on the django-developers
group
.

Additionally, it is customary in python (and Django, naturally) to name
your fields lower_cased_separated_by_underscores. Please see more about
this on the Python Style Guide (PEP 8)
.

--

Cheers,
AT



On Wed, Jan 30, 2013 at 4:07 PM, Shawn H  wrote:

> Indeed it was.  As Alisdair posted, simplify the regex and validate
> elsewhere.  Thanks.
>
> On Wednesday, January 30, 2013 11:26:51 AM UTC-6, fgallina wrote:
>>
>> 2013/1/30 Shawn H :
>> > I posted this question yesterdat at stack overflow, but I'm wondering
>> if
>> > this is a bug.  I have a url that accepts one text parameter, allows
>> spaces,
>> > and calls a very simple view that checks if there are objects with a
>> project
>> > name that matches the text parameter value. The view returns a simple
>> json
>> > string indicating whether there's a project with that name already in
>> the
>> > database.  It works great, repeatedly, with short parameter values.  It
>> > locks up python on certain long string values.  I've tested up to 50
>> > characters, and just length doesn't trigger it.  What does seem to
>> > repeatedly trigger it are long strings with multiple spaces.  I've
>> tested my
>> > url regex matching and those long strings match just fine; my concern
>> is
>> > that for some reason inside the view that long string is causing
>> problems.
>> > I'm using Django 1.4 with the built in webserver for testing.  Any help
>> that
>> > can be provided will be greatly appreciated.
>> >
>>
>> I have a strong feeling it is related on how your regexp matches the
>> passed string, I don't know why in the world you would sanitize the
>> project's name directly in the url and not the view, in any case if
>> the user happen to enter garbage then filter will not find anything,
>> right? Also this seems a job for a GET parameter rather than a view
>> param, but YMMV.
>>
>>
>> Regards,
>> --
>> Fabián E. Gallina
>> http://www.from-the-cloud.com
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django hosting companies

2013-01-30 Thread jianhui chen
I use google app engine.


On Tue, Jan 29, 2013 at 8:17 AM, francislutalo wrote:

> Anyone with an idea of which are the best companies to host my django
> applications?
>
>
>
> Thank you,
> Regards
> francislutalo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




an elusive ValueError: 'str' object not callable -- lost.

2013-01-30 Thread Maurice Asimov
Hey guys.

I recently started getting a ValueError complaining that an str is not 
callable -- in a very wierd place.

This happens to some calls to messages.info(request, 'somethingsomething'), 
in one of those cases __inside the django console__

Traceback:

Traceback:
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
  111. response = callback(request, *callback_args, 
**callback_kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in wrapper
  366. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view
  91. response = view_func(request, *args, **kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/views/decorators/cache.py"
 
in _wrapped_view_func
  89. response = view_func(request, *args, **kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/sites.py" 
in inner
  196. return view(request, *args, **kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapper
  25. return bound_func(*args, **kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view
  91. response = view_func(request, *args, **kwargs)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" 
in bound_func
  21. return func(self, *args2, **kwargs2)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in changelist_view
  1169. response = self.response_action(request, 
queryset=cl.get_query_set(request))
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in response_action
  908. response = func(self, request, queryset)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/actions.py"
 
in delete_selected
  49. "count": n, "items": model_ngettext(modeladmin.opts, 
n)
File 
"/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py"
 
in message_user
  696. messages.info(request, message)

Exception Type: TypeError at /admin/auth/user/
Exception Value: 'str' object is not callable

More information:

Environment:


Request Method: POST
Request URL: http://idpee.herokuapp.com/admin/auth/user/

Django Version: 1.4.2
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'registration',
 'idpee',
 'oauth2app',
 'social_auth',
 'uni_form',
 'south')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'social_auth.middleware.SocialAuthExceptionMiddleware',
 '')

The custom middleware is rather simple and non-intrusive, so _please_ don't 
just blow this off as "you screwed something up in your middleware". We're 
already looking at that, thanks.

Any other ideas what's wrong? Anyone bumped into this?

The same problem occured in part of the app I control, removing the call to 
messages.info solved it.

Anything at all? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django hosting companies

2013-01-30 Thread frocco
Thanks for the info on webfraction.
I currently use bluehost.com, but webfraction looks like better support for 
django.

On Tuesday, January 29, 2013 8:34:54 AM UTC-5, Frankline wrote:
>
> Have you tried webfaction? Very easy to setup.
>
> On Tue, Jan 29, 2013 at 4:30 PM, Gustavo Andres Angulo 
> 
> > wrote:
>
>> There is a similar solution to Heroku, called nuagehq.com
>>
>>
>>
>> regards
>>
>> On Tue, Jan 29, 2013 at 8:17 AM, francislutalo 
>> > 
>> wrote:
>> > Anyone with an idea of which are the best companies to host my django
>> > applications?
>> >
>> >
>> >
>> > Thank you,
>> > Regards
>> > francislutalo
>> >
>> > --
>> > You received this message because you are subscribed to the Google 
>> Groups
>> > "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an
>> > email to django-users...@googlegroups.com .
>> > To post to this group, send email to 
>> > django...@googlegroups.com
>> .
>> > Visit this group at http://groups.google.com/group/django-users?hl=en.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django hosting companies

2013-01-30 Thread Nikolas Stevenson-Molnar
+1 if you're dealing with small load, micro instances are super cheap
(free for 1st year, even), as flexible as you need, and you can create
images of a configured machine to launch more instances from.

_Nik

On 1/30/2013 7:16 AM, m1chael wrote:
> aws micro instance
>
> On Tue, Jan 29, 2013 at 10:54 AM, Mengu  wrote:
>> some of my friends are using webfaction. i use linode and in the past
>> i have used webbynode.
>>
>> On Jan 29, 3:17 pm, francislutalo  wrote:
>>> Anyone with an idea of which are the best companies to host my django
>>> applications?
>>>
>>> Thank you,
>>> Regards
>>> francislutalo
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PHP vs Django

2013-01-30 Thread frocco
I coded a site in PHP using yii before I stumbled onto django a few weeks 
back.
Now I am rewriting my site in django while I learn.
I just love the framework.

On Sunday, January 27, 2013 10:50:26 PM UTC-5, Nikhil Verma wrote:
>
> Well i would say  its all about money and passion for programming.In Web 
> development you are uncertain which you have to learn next.
>
> My personnel opinion:-
>
> php is a crap. Its a horrible language.
>
> Python well i would say the king of all and the framework Django is 
> amazing.
>
> Thanks
>
>
> On Mon, Jan 28, 2013 at 9:10 AM, Londerson Araújo 
> 
> > wrote:
>
>> Man, i work with PHP for 5 years more or less, and Python is the 
>> the answer for my life. 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Regards
> Nikhil Verma
> +91-958-273-3156
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: get_absolute_url with custom extra parameter

2013-01-30 Thread Mario Gudelj
You can't pass parameters to model functions from within a template. What
exactly are you trying to achieve?


On 30 January 2013 21:34, Sammael  wrote:

> Hello friends,
>
> Is the any way to pass an extra parameter to get_absolute_url method of a
> model instance from template?
>
> Thank you for your answer.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Special SELECT and UPDATE for a field

2013-01-30 Thread Yarden Sachs
Hello,
i want to create a field class for geometry (not using geodjango).
here's the field code: http://pastebin.com/yADpZykJ

i want 2 things i can't seem to do:
1. I want the select to wrap the column with MySql AsText() Function
e.x. SELECT AsText(location) FROM addresses 

2. I want to be able to save the value wrapped with a function e.x. 
GeomFromText('POINT(0.0 0.0)') 
but is seems that django will wrap that function with quotes, and so mysql 
thinks its a string.

I found that in order to fix these, i will have to write an SQLCompiler, 
Query, QuerySet, QuerySetManager. (or modify the get_columns and 
get_default_columns methods of the SQLCompiler)
I am sure there is a simpler way.

What can I do?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CharField cannot have a "max_length" greater than 255 when using "unique=True"

2013-01-30 Thread mimino666
This snippet is what you need 
https://github.com/Mimino666/django-hash-field. Go ahead and give it a try, 
any feedback appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




getting same order in SQL as ManytoMany selection in Admin

2013-01-30 Thread Ken Ricci
I have a Django/Grappelli admin form for job postings which has a 
manytomany relationship for job requirements (using filter_horizontal).  In 
the admin form, the order chosen stays constant when I save the job posting 
and display it again later.  I'm trying to repeat the order in another app 
that selects the job requirements using the join table, but no matter which 
column I ORDER BY (or even if I don't use an ORDER BY) in the SQL, I cannot 
get the same order of job requirements as displayed in the admin form.

Any idea how the chosen items retain their selected order?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




using existing database with django

2013-01-30 Thread arc4gold
I have an existing database but I would like to design around that database 
using django...can I do this without altering the database in anyways 
significantly?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: using existing database with django

2013-01-30 Thread Carlos Daniel Ruvalcaba Valenzuela
Yes, django can actually look at the DB schema and generate reasonable
models from it, check the inspectdb command docs:

https://docs.djangoproject.com/en/1.4/ref/django-admin/#inspectdb

You can also slowly modernize and existing DB, for example, the field
names or model names does not have to match 1:1 to the DB Tables, you
can map them, so instead of having a model for a table named
non_descriptive_name_0001 you can just call the model "Products" and
have it map the table "non_descriptive_name_0001", you can evolve
slowly the schema with south if the DB supports it.

Regards,
Carlos Ruvalcaba

On Wed, Jan 30, 2013 at 7:01 PM,   wrote:
> I have an existing database but I would like to design around that database
> using django...can I do this without altering the database in anyways
> significantly?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: getting same order in SQL as ManytoMany selection in Admin

2013-01-30 Thread Bill Freeman
I suppose that it is possible that Grappelli's JavaScript is ordering
them.  If you look at the raw HTML of the admin pages using curl or wget,
or with JavaScript disabled in the browser, is the order maintained (this
is harder than it sounds, since in curl you would have to fake a logged in
session with admin privileges, and even in a no JS browser, grappelli might
make it hard to log in)?

Bill

On Wed, Jan 30, 2013 at 7:53 PM, Ken Ricci  wrote:

> I have a Django/Grappelli admin form for job postings which has a
> manytomany relationship for job requirements (using filter_horizontal).  In
> the admin form, the order chosen stays constant when I save the job posting
> and display it again later.  I'm trying to repeat the order in another app
> that selects the job requirements using the join table, but no matter which
> column I ORDER BY (or even if I don't use an ORDER BY) in the SQL, I cannot
> get the same order of job requirements as displayed in the admin form.
>
> Any idea how the chosen items retain their selected order?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: get_absolute_url with custom extra parameter

2013-01-30 Thread Sammael
Thank you for your answer!

I have a photo album which can be displayed in two modes: full (with url 
like 'album/id/full') and thumbnails ( like 'album/id/thumbnails' ). I 
would like 'get_absolute_url' to return a corresponding url depending on 
the given mode, something like {{ album.get_absolute_url full }} and {{ 
album.get_absolute_url thumbnails }}

The only solution I could find is to use two different functions: 
get_absolute_url_full and get_absolute_url_thumbnails. It works but it's 
ugly, I don't like it at all.

Any advice is greatly appreciated.

среда, 30 января 2013 г., 23:34:38 UTC+4 пользователь somecallitblues 
написал:
>
> You can't pass parameters to model functions from within a template. What 
> exactly are you trying to achieve?
>
>
> On 30 January 2013 21:34, Sammael > wrote:
>
>> Hello friends,
>>
>> Is the any way to pass an extra parameter to get_absolute_url method of a 
>> model instance from template?
>>
>> Thank you for your answer.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: previous values of custom method in save

2013-01-30 Thread Sammael
Any advice please? Still didn't find any solution nor workaround.
Maybe it's some kind of query caching?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.