oauth2 issue with Django + Google Analytics API integration

2012-08-03 Thread Sithembewena Lloyd Dube
Hi all,

I am converting a site from PHP to Python and pulling stuff from the Google
Analytics API using their new Python client library and oauth2. I'm having
an issue with oauth2 authentication where the redirect URI specified in my
client_secrets.json file is not recognised. The API seems to be redirecting
to localhost:8080/ when I specified a different URI.

After digging around for a bit, I got an error stating that I should run my
python script with the parameter --noauth_local_webserver as I am
developing on a remote machine using PuTTY.

This is mostly not a Django issue, but I thought to ask if anyone here has
ever had to do the same and encountered this?

Thanks.

-- 
Regards,
Sithembewena Lloyd Dube

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



Re: TinyMCE config

2012-08-03 Thread Aljoša Mohorović
documentation is not completely updated so steps in previous emails are correct.
i won't be available until next week but check second snippet under:
http://django-tinymce.readthedocs.org/en/latest/usage.html#the-flatpages-link-list-view

and be sure that you have something like:
"""
admin.site.unregister(FlatPage)
admin.site.register(FlatPage, TinyMCEFlatPageAdmin)
"""

Aljosa

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



Re: QuerySet API - istartswith - use UPPER instead of ILIKE with PostgreSQL backend

2012-08-03 Thread Karen Tracey
On Wed, Aug 1, 2012 at 1:03 PM, Naoko  wrote:

> QuerySet API - istartswith - use UPPER instead of ILIKE with PostgreSQL
> backend
> which conflict with Documentation (
> https://docs.djangoproject.com/en/dev/ref/models/querysets/)
> as documentation's example shows SQL equivalent as " ILIKE "
>
> Is this due to my backend being PostgreSQL? or is there setting that I can
> change?
> I would like to know this so that we can strategize indexing of DB.
> Any advice would be appreciated.
>
> The doc wasn't changed when the optimization for using UPPER instead of
ILIKE was put in (see https://code.djangoproject.com/ticket/3575). Feel
free to open a ticket against the doc, from a quick check it seems that
none of the DB backends use the documented "SQL equivalent". (I wonder if
these documented "equivalents" are more trouble than they are helpful...)

Karen
-- 
http://tracey.org/kmt/

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



Re: Issue Deploying Django

2012-08-03 Thread Dan Gentry
Agreed that virtualenv will allow you to install python packages - however 
not any linux/unix packages.  I have no problems using Django on Dreamhost. 
 http://dashdrum.com/blog/2011/08/django-on-dreamhost/

On Thursday, August 2, 2012 10:34:35 PM UTC-4, trevorj wrote:
>
> You are trying to install packages system-wide when you don't have 
> credentials to do so.
>
> You can install everything you need without cluttering the system itself.
>
> For instance, use a virtualenv and set your PREFIX.
>
> Either way, happy hacking!
> On Aug 1, 2012 8:32 PM, "JJ Zolper"  wrote:
>
>> I'm trying to install GEOS and on my bluehost account under my django_src 
>> folder and what happened in the image happened.
>>
>> it said cannot create directory permission denied so i tired sudo make 
>> install after what I had just done ( "make" ).
>>
>> and then it said whats in the second image.
>>
>> When I tried to run:
>>
>> ./manage.py runfcgi [options]
>>
>> I got an error about GEOS so that's why I was doing that.
>>
>> Thanks for the help.
>>
>> JJ
>>
>> On Wednesday, August 1, 2012 1:03:21 PM UTC-4, JJ Zolper wrote:
>>>
>>> Thanks so much for the reply!
>>>
>>> I had a feeling I would need it but I just like to be sure before I act.
>>>
>>> Another thing. On Ubuntu there were additional packages I had to 
>>> install. I believe one was called "psycopg2-python-dev" or something like 
>>> that.
>>>
>>> If I install psycopg2-python at:
>>>
>>> http://www.initd.org/psycopg/ 
>>>
>>> Are there any additional packges that I might need?
>>>
>>> I apologize for not being able to remember the additional ones I added 
>>> before on Ubuntu but I'm at work and couldn't find in my installation 
>>> history what they might have been or in my django google group discussions.
>>>
>>> I feel like one was called "libpq-dev" actually.
>>>
>>> Thanks for the help.
>>>
>>> JJ
>>>
>>> On Wednesday, August 1, 2012 2:07:54 AM UTC-4, lawgon wrote:

 On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote: 
 > Do I need to go through and install the python like adapters is that 
 > what it's complaining about? I don't think this has to do with my 
 > Django code on the server it's just a file missing right? 

 you need to install pycopg - and it is nothing to do with your code 
 -- 
 regards 
 Kenneth Gonsalves 

  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/0Jx03fySUVUJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/9V4D-bMpS28J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: presenting a manytomany relationship in a tabular way

2012-08-03 Thread goabbear
Hi,
thanks for the links, I have look at these docs but I can't figure out how 
to mix actions with a spreadsheet like presentation :-/
Is it possible to create admin forms like we can standards forms?
Another way I could try is to use filter_horizontal (I like this 
presentation), but for a m2m relation, just 1 entity can be presented with 
this widget, not the other side, or I do something wrong?

Le mardi 31 juillet 2012 15:44:51 UTC+2, Melvyn Sopacua a écrit :
>
> On 31-7-2012 11:33, goabbear wrote: 
>
> > There's 3 tables, user(name, mail), mailinglist(name) and an 
> intermediate 
> > table subscription where are stored all the users joining some 
> > mailinglists. 
> > How can I present the "subscription" table to the admins like a 
> > spreadsheet, where the first column represents the users emails and one 
> > other column is a mailinglist name. On each row, the admin can activate 
> the 
> > subscription for each user by checking a checkbox? 
>
> You need a combination of list_display and modeladmin actions: 
> <
> https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display>
>  
>
>  
>
> Alternatively, you can use list_editable: 
> <
> https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_editable>
>  
>
>
> -- 
> Melvyn Sopacua 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FH-4odtqbSMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Issue Deploying Django

2012-08-03 Thread JJ Zolper
Yeah I've been looking into webfaction. Any information would be great
thanks William!

Only issues I would forsee is the root control. That is unless they have
all that I need but at the same time I think I would lean to having root
over not. Also I'm on a shared hosting right now and it's pretty good but I
might be ready to get more serious with my own box and what not.

On Thu, Aug 2, 2012 at 6:14 PM, william ratcliff  wrote:

> I will say that I've had pretty good luck hosting with webfaction and
> installing packages locally.  They also have really good support--I'd tell
> them your use case and ask them if it would work with them.   Even though
> it's shared hosting, I do have ssh--though not root
>
> William
>
>
> On Thu, Aug 2, 2012 at 6:03 PM, JJ Zolper  wrote:
>
>> Yes it seems that way. Thats because its shared hosting and i dont have
>> root privleges. bluehost has hindered what I can do with Django.
>>
>> But does a cloud server at rackspace have root privleges like a vps?
>> because i think i need to install these geospatial libraries to be able to
>> really make forward progress with my site.
>>
>> I bought this hosting at bluehost a while ago but i didnt know as much as
>> i do know about django and what i need etc so im thinking a new host.
>> Either slicehost, maybe a cloud server, something like that with full
>> control like root.
>>
>> JJ
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/jLF6C23y1pEJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Issue Deploying Django

2012-08-03 Thread JJ Zolper
Yes when I saw no root privleges I realized very soon that I either have to
get a new host that has what I need installed or get my own box and full
control.

With virtualenv I can install the packages on bluehost?

On Thu, Aug 2, 2012 at 10:34 PM, Trevor Joynson wrote:

> You are trying to install packages system-wide when you don't have
> credentials to do so.
>
> You can install everything you need without cluttering the system itself.
>
> For instance, use a virtualenv and set your PREFIX.
>
> Either way, happy hacking!
> On Aug 1, 2012 8:32 PM, "JJ Zolper"  wrote:
>
>> I'm trying to install GEOS and on my bluehost account under my django_src
>> folder and what happened in the image happened.
>>
>> it said cannot create directory permission denied so i tired sudo make
>> install after what I had just done ( "make" ).
>>
>> and then it said whats in the second image.
>>
>> When I tried to run:
>>
>> ./manage.py runfcgi [options]
>>
>> I got an error about GEOS so that's why I was doing that.
>>
>> Thanks for the help.
>>
>> JJ
>>
>> On Wednesday, August 1, 2012 1:03:21 PM UTC-4, JJ Zolper wrote:
>>>
>>> Thanks so much for the reply!
>>>
>>> I had a feeling I would need it but I just like to be sure before I act.
>>>
>>> Another thing. On Ubuntu there were additional packages I had to
>>> install. I believe one was called "psycopg2-python-dev" or something like
>>> that.
>>>
>>> If I install psycopg2-python at:
>>>
>>> http://www.initd.org/psycopg/
>>>
>>> Are there any additional packges that I might need?
>>>
>>> I apologize for not being able to remember the additional ones I added
>>> before on Ubuntu but I'm at work and couldn't find in my installation
>>> history what they might have been or in my django google group discussions.
>>>
>>> I feel like one was called "libpq-dev" actually.
>>>
>>> Thanks for the help.
>>>
>>> JJ
>>>
>>> On Wednesday, August 1, 2012 2:07:54 AM UTC-4, lawgon wrote:

 On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote:
 > Do I need to go through and install the python like adapters is that
 > what it's complaining about? I don't think this has to do with my
 > Django code on the server it's just a file missing right?

 you need to install pycopg - and it is nothing to do with your code
 --
 regards
 Kenneth Gonsalves

  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/0Jx03fySUVUJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Issue Deploying Django

2012-08-03 Thread JJ Zolper
>Agreed that virtualenv will allow you to install python packages - however
not any linux/unix packages.  I have no problems using >Django on
Dreamhost.  http://dashdrum.com/blog/2011/08/django-on-dreamhost/

Thanks for the advice I will look into dreamhost too!

On Fri, Aug 3, 2012 at 8:24 AM, Dan Gentry  wrote:

> Agreed that virtualenv will allow you to install python packages - however
> not any linux/unix packages.  I have no problems using Django on Dreamhost.
>  http://dashdrum.com/blog/2011/08/django-on-dreamhost/
>
>
> On Thursday, August 2, 2012 10:34:35 PM UTC-4, trevorj wrote:
>>
>> You are trying to install packages system-wide when you don't have
>> credentials to do so.
>>
>> You can install everything you need without cluttering the system itself.
>>
>> For instance, use a virtualenv and set your PREFIX.
>>
>> Either way, happy hacking!
>> On Aug 1, 2012 8:32 PM, "JJ Zolper"  wrote:
>>
>>> I'm trying to install GEOS and on my bluehost account under my
>>> django_src folder and what happened in the image happened.
>>>
>>> it said cannot create directory permission denied so i tired sudo make
>>> install after what I had just done ( "make" ).
>>>
>>> and then it said whats in the second image.
>>>
>>> When I tried to run:
>>>
>>> ./manage.py runfcgi [options]
>>>
>>> I got an error about GEOS so that's why I was doing that.
>>>
>>> Thanks for the help.
>>>
>>> JJ
>>>
>>> On Wednesday, August 1, 2012 1:03:21 PM UTC-4, JJ Zolper wrote:

 Thanks so much for the reply!

 I had a feeling I would need it but I just like to be sure before I act.

 Another thing. On Ubuntu there were additional packages I had to
 install. I believe one was called "psycopg2-python-dev" or something like
 that.

 If I install psycopg2-python at:

 http://www.initd.org/psycopg/

 Are there any additional packges that I might need?

 I apologize for not being able to remember the additional ones I added
 before on Ubuntu but I'm at work and couldn't find in my installation
 history what they might have been or in my django google group discussions.

 I feel like one was called "libpq-dev" actually.

 Thanks for the help.

 JJ

 On Wednesday, August 1, 2012 2:07:54 AM UTC-4, lawgon wrote:
>
> On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote:
> > Do I need to go through and install the python like adapters is that
> > what it's complaining about? I don't think this has to do with my
> > Django code on the server it's just a file missing right?
>
> you need to install pycopg - and it is nothing to do with your code
> --
> regards
> Kenneth Gonsalves
>
>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**0Jx03fySUVUJ
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/9V4D-bMpS28J.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: How to print a graph

2012-08-03 Thread Frank Stüss
what exactly is your "error"?
Is your matplotlibrc correct?

If you will be using matplotlib maybe this example from an data
application i wrote may help you:

def calculate_myPic(my_args):
fig = figure(figsize=parameter.figsize)
plotarea = fig.add_subplot(111) # for my thing
# calculate your data
plotarea.bar(...) # eg. plot bars
plotarea.plot_date(...) # or a date based graph
title("my title" ) 
xlabel("ordinate") # eg. x-axis
# write it out on a png, *depending on matplotlibrc*
out = django.http.HttpResponse(content_type='image/png')
fig.savefig(out)
close()
return out


Am Donnerstag, den 02.08.2012, 00:46 -0400 schrieb Peregil:
> Well, I have been trying, but I cannot get the graph or error from the
> function...
> 
> 
> I will keep trying,..
> 
> 
> 
> 
> 
> 
> On Wed, Aug 1, 2012 at 5:42 PM, william ratcliff
>  wrote:
> Can you attach an example png?   If it's not too complex, you
> might be able to do this all clientside as well...
> 
> 
> 
> 
> William
> 
> 
> On Wed, Aug 1, 2012 at 5:41 PM, william ratcliff
>  wrote:
> If you're planning on adding this to your views.py,
> then you want to move the import statements to the top
> of the file (outside of simple), so they aren't called
> every time.  Don't import django.
> 
> 
> 
> 
> William
> 
> 
> On Wed, Aug 1, 2012 at 4:06 PM, Peregil
>  wrote:
> Great thanks...
> 
> 
>I found this function... it seems
> complicated, but it is kind of working... I
> hope that I can include it in a my web page...
> 
> 
> # file charts.py
> def simple(request):
> import random
> import django
> import datetime
> 
> from matplotlib.backends.backend_agg import 
> FigureCanvasAgg as FigureCanvas
> from matplotlib.figure import Figure
> from matplotlib.dates import DateFormatter
> 
> fig=Figure()
> ax=fig.add_subplot(111)
> x=[]
> y=[]
> now=datetime.datetime.now()
> delta=datetime.timedelta(days=1)
> for i in range(10):
> x.append(now)
> now+=delta
> y.append(random.randint(0, 1000))
> ax.plot_date(x, y, '-')
> 
> ax.xaxis.set_major_formatter(DateFormatter('%Y-%m-%d'))
> fig.autofmt_xdate()
> canvas=FigureCanvas(fig)
> 
> response=django.http.HttpResponse(content_type='image/png')
> canvas.print_png(response)
> return response
> 
> On Wed, Aug 1, 2012 at 3:31 PM, Daniel Molina
> Wegener  wrote:
> On 01/08/12 15:19, Peregil wrote:
> I need to have the graphic on
> a web page... as soon as a
> user hit summit...
> 
> 
>   If you need to draw a graph, you can
> try the pygraphviz.
> 
>   If you need to plot a chart, you can
> matplotlib, if that is not
> so easy to implement, you can try
> using django google charts packages:
> 
> 
> 
> http://pypi.python.org/pypi/django-googlecharts/1.0-alpha-1
> 
> 
> 
> http://pypi.python.org/pypi/django-google-charts/0.1.1
> 
> 
> 
> 
> On Wed, Aug 1, 2012 at 3:16
>  

Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Anoop Thomas Mathew
With my heartfelt condolence, I'd like to inform you all the unfortunate
demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
strong advocate of Python, Django and Free Software in India.
He had served as the President of IPSS(Indian Python Software Society),
which initiated the PyCon India, done a lot of workshops on Python and was
an active member in the Django user group.

Anoop Thomas Mathew

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



Re: Issue Deploying Django

2012-08-03 Thread Kurtis Mullins
With Cloud Servers, yes -- you do get Root access. It's basically the
equivelant of a VPS that you can easily spawn, scale, and replicate as
needed.

Without root access on servers, virtual environments only get you so far.
What happens when you need to install Python imaging library but they don't
have a specific library? What happens when you decide you want to plugin to
some other library and the version of GCC they have is too ancient to
support its make system? etc These are just some examples of headaches
that may crop up without a good "open" system (such as a VPS, Cloud Server)
or a web host who explicitly supports Django.

On Fri, Aug 3, 2012 at 10:18 AM, JJ Zolper  wrote:

> >Agreed that virtualenv will allow you to install python packages -
> however not any linux/unix packages.  I have no problems using >Django on
> Dreamhost.  http://dashdrum.com/blog/2011/08/django-on-dreamhost/
>
> Thanks for the advice I will look into dreamhost too!
>
> On Fri, Aug 3, 2012 at 8:24 AM, Dan Gentry  wrote:
>
>> Agreed that virtualenv will allow you to install python packages -
>> however not any linux/unix packages.  I have no problems using Django on
>> Dreamhost.  http://dashdrum.com/blog/2011/08/django-on-dreamhost/
>>
>>
>> On Thursday, August 2, 2012 10:34:35 PM UTC-4, trevorj wrote:
>>>
>>> You are trying to install packages system-wide when you don't have
>>> credentials to do so.
>>>
>>> You can install everything you need without cluttering the system itself.
>>>
>>> For instance, use a virtualenv and set your PREFIX.
>>>
>>> Either way, happy hacking!
>>> On Aug 1, 2012 8:32 PM, "JJ Zolper"  wrote:
>>>
 I'm trying to install GEOS and on my bluehost account under my
 django_src folder and what happened in the image happened.

 it said cannot create directory permission denied so i tired sudo make
 install after what I had just done ( "make" ).

 and then it said whats in the second image.

 When I tried to run:

 ./manage.py runfcgi [options]

 I got an error about GEOS so that's why I was doing that.

 Thanks for the help.

 JJ

 On Wednesday, August 1, 2012 1:03:21 PM UTC-4, JJ Zolper wrote:
>
> Thanks so much for the reply!
>
> I had a feeling I would need it but I just like to be sure before I
> act.
>
> Another thing. On Ubuntu there were additional packages I had to
> install. I believe one was called "psycopg2-python-dev" or something like
> that.
>
> If I install psycopg2-python at:
>
> http://www.initd.org/psycopg/
>
> Are there any additional packges that I might need?
>
> I apologize for not being able to remember the additional ones I added
> before on Ubuntu but I'm at work and couldn't find in my installation
> history what they might have been or in my django google group 
> discussions.
>
> I feel like one was called "libpq-dev" actually.
>
> Thanks for the help.
>
> JJ
>
> On Wednesday, August 1, 2012 2:07:54 AM UTC-4, lawgon wrote:
>>
>> On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote:
>> > Do I need to go through and install the python like adapters is
>> that
>> > what it's complaining about? I don't think this has to do with my
>> > Django code on the server it's just a file missing right?
>>
>> you need to install pycopg - and it is nothing to do with your code
>> --
>> regards
>> Kenneth Gonsalves
>>
>>  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit https://groups.google.com/d/**
 msg/django-users/-/**0Jx03fySUVUJ
 .
 To post to this group, send email to django-users@googlegroups.com.
 To unsubscribe from this group, send email to django-users+unsubscribe@
 **googlegroups.com .
 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/9V4D-bMpS28J.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/gro

Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Marcin Tustin
What happened to him? He was posting on this list in the last week?

On Fri, Aug 3, 2012 at 11:12 AM, Anoop Thomas Mathew wrote:

> With my heartfelt condolence, I'd like to inform you all the unfortunate
> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
> strong advocate of Python, Django and Free Software in India.
> He had served as the President of IPSS(Indian Python Software Society),
> which initiated the PyCon India, done a lot of workshops on Python and was
> an active member in the Django user group.
>
> Anoop Thomas Mathew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Marcin Tustin
Tel: 07773 787 105

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



Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Anoop Thomas Mathew
Chronic Asthma. He was hospitalized yesterday, and passed away today.




On 3 August 2012 20:45, Marcin Tustin  wrote:

> What happened to him? He was posting on this list in the last week?
>
> On Fri, Aug 3, 2012 at 11:12 AM, Anoop Thomas Mathew wrote:
>
>> With my heartfelt condolence, I'd like to inform you all the unfortunate
>> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
>> strong advocate of Python, Django and Free Software in India.
>> He had served as the President of IPSS(Indian Python Software Society),
>> which initiated the PyCon India, done a lot of workshops on Python and was
>> an active member in the Django user group.
>>
>>
>> Anoop Thomas Mathew
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Marcin Tustin
> Tel: 07773 787 105
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Chris Czub
RIP, Kenneth.

He was one of the primary contributors to this list and his
contributions will be missed.

Condolences go out to all of his friends and family.

On Fri, Aug 3, 2012 at 11:20 AM, Anoop Thomas Mathew  wrote:
> Chronic Asthma. He was hospitalized yesterday, and passed away today.
>
>
>
>
>
> On 3 August 2012 20:45, Marcin Tustin  wrote:
>>
>> What happened to him? He was posting on this list in the last week?
>>
>> On Fri, Aug 3, 2012 at 11:12 AM, Anoop Thomas Mathew 
>> wrote:
>>>
>>> With my heartfelt condolence, I'd like to inform you all the unfortunate
>>> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
>>> strong advocate of Python, Django and Free Software in India.
>>> He had served as the President of IPSS(Indian Python Software Society),
>>> which initiated the PyCon India, done a lot of workshops on Python and was
>>> an active member in the Django user group.
>>>
>>>
>>> Anoop Thomas Mathew
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



DRYing up my forms.py

2012-08-03 Thread Lee Hinde
I have a lot of this throughout my forms.py files:


self.fields['verification_date'].widget.attrs["class"] = 'date-field
input-small'
self.fields['verification_date'].widget.format = '%m-%d-%Y'

self.fields['mail_response'].widget.attrs["class"] = 'date-field input-small'
self.fields['mail_response'].widget.format = '%m-%d-%Y'

self.fields['photo_response'].widget.attrs["class"] = 'date-field input-small'
self.fields['photo_response'].widget.format = '%m-%d-%Y'


is there a way to consolidate this sort of thing, such that if a field
is a date field, it always gets these settings without me having to
explicitly set them?

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



Re: DRYing up my forms.py

2012-08-03 Thread Melvyn Sopacua
On 3-8-2012 17:37, Lee Hinde wrote:

> self.fields['photo_response'].widget.attrs["class"] = 'date-field input-small'
> self.fields['photo_response'].widget.format = '%m-%d-%Y'
> 
> 
> is there a way to consolidate this sort of thing, such that if a field
> is a date field, it always gets these settings without me having to
> explicitly set them?

Well, you almost answered your own question. Subclass the DateField.

-- 
Melvyn Sopacua

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



object.create speed, creating 3 objects takes 1 sec in sqlite

2012-08-03 Thread Anton
Hi I am new to Django.

I worked through the tutorial.

I created a small test app on:
 - Win7 64bit
 - python 2.7.3 (32bit)
 - Django 1.4.1
 - using the development server
 

Now I wanted to populate the (sqlite backend) database
with a python script.

My Problem:

I Insert 3 Object (like MyModel.objects.create(name="..", comment="..") ).

They consts only of 2 strings.

Inserting these 3 items take roughly 1 sec.

In settings.py I set DEBUG = False, but this doesnt help much
(I readed something about this on the net).

I retried with the mysql backend:
 -  mysql 5.5.27 (64bit)
 - using sockets (named pipe on windows)

Now the time varies between 0.2 sec and 0.8 sec every time
I insert suche a 3 object tripplet.


My Problem: I will populate it with 5 items.

Has Django really such a bad performance for data insertion?

I can't believe it, so ... can somebody give me a hint?
Is there a doc page dedicated to speed/performance issues??

Otherwise I have to look for an other system.

Thanks 

Anton





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



Re: TinyMCE config

2012-08-03 Thread Jonathan Baker
Success! Thanks for all the help. After integrating your app with the
FlatPage app I was able to integrate it with FlatBlock as well.

If you're up for it, I'd love to help update the documentation to save
future users (and yourself) some time with the issues I ran in to.

JDB

On Fri, Aug 3, 2012 at 3:37 AM, Aljoša Mohorović  wrote:

> documentation is not completely updated so steps in previous emails are
> correct.
> i won't be available until next week but check second snippet under:
>
> http://django-tinymce.readthedocs.org/en/latest/usage.html#the-flatpages-link-list-view
>
> and be sure that you have something like:
> """
> admin.site.unregister(FlatPage)
> admin.site.register(FlatPage, TinyMCEFlatPageAdmin)
> """
>
> Aljosa
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

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



Re: DRYing up my forms.py

2012-08-03 Thread Lee Hinde

On Aug 3, 2012, at 9:01 AM, Melvyn Sopacua  wrote:

> On 3-8-2012 17:37, Lee Hinde wrote:
> 
>> self.fields['photo_response'].widget.attrs["class"] = 'date-field 
>> input-small'
>> self.fields['photo_response'].widget.format = '%m-%d-%Y'
>> 
>> 
>> is there a way to consolidate this sort of thing, such that if a field
>> is a date field, it always gets these settings without me having to
>> explicitly set them?
> 
> Well, you almost answered your own question. Subclass the DateField.
> 
> -- 
> Melvyn Sopacua
> 

Thanks, that got me looking in the right place. I think I need to sublcass the 
widget, since I'm concerned with the display of the data, not how it's 
saved/stored?

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



Django+Ajax+jquery

2012-08-03 Thread Rishabh Dixit
Someone please give some solution to this stack overflow question-

http://stackoverflow.com/questions/11706721/updating-a-button-value-database-and-call-a-view-function-without-refreshing-th

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TsUurybMHq8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Cal Leeming [Simplicity Media Ltd]
Ah jeez... he was a good guy too, always keen to help others - really sorry
to hear this news.

Another harsh reminder on just how short and precious our time in this life
really is :/

Cal

On Fri, Aug 3, 2012 at 4:12 PM, Anoop Thomas Mathew wrote:

> With my heartfelt condolence, I'd like to inform you all the unfortunate
> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
> strong advocate of Python, Django and Free Software in India.
> He had served as the President of IPSS(Indian Python Software Society),
> which initiated the PyCon India, done a lot of workshops on Python and was
> an active member in the Django user group.
>
> Anoop Thomas Mathew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 

*Cal Leeming
Technical Support | Simplicity Media Ltd
**US *310-362-7070 | *UK *02476 100401 | *Direct *02476 100402

*Available 24 hours a day, 7 days a week.*

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



Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Javier Guerra Giraldez
On Fri, Aug 3, 2012 at 10:12 AM, Anoop Thomas Mathew  wrote:
> With my heartfelt condolence, I'd like to inform you all the unfortunate
> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
> strong advocate of Python, Django and Free Software in India.

certainly sad news. i'm bad at remembering who did what; but i
don't have to check the list to remember him as a very positive
presence.

thanks for sharing.

-- 
Javier

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



Fwd: [BangPypers] Kenneth Gonsalvas a short bio

2012-08-03 Thread Venkatraman S
More on KG :

-- Forwarded message --
From: JAGANADH G 
Date: Fri, Aug 3, 2012 at 10:45 PM
Subject: [BangPypers] Kenneth Gonsalvas a short bio
To: ILUG-C , chenna...@googlegroups.com,
ilug...@googlegroups.com, Indian Python Software Society ,
Bangalore Python Users Group - India , Mailing list
for the PyCon India conference 
Cc: talk...@openstreetmap.org


Kenneth Gonsalvas (KG / lawgon) passed away on 3rd Aug 2012. He was leading
light, mentor, evangelist and practitioner of Free and Open Source
Software. He was a geek up to his last moments. His demise is a great loss
to FOSS Community in India. May his soul rest in peace.

A short bio of Kenneth Gonsalvas (Prepared by KG only)

"Although he has no formal training in the IT field, Kenneth Gonsalves has
been programming since 1986, starting with Turbo Pascal, then moving to
Perl and finally to Python in 2003. Since then he has focused on Python in
general and the Django web frame work in particular. He is an open source
enthusiast and has spoken and written on open source right from 1995 when
he was first introduced to it. He has conducted over 50 seminars and
workshops in python and Django. He was the founder president of the Indian
Python Software Society and a member of the team that has organised the
highly successful Indian python conferences from 2009 to 2011. He is now
based in Ooty where he writes and consults on open source. He also conducts
a job oriented course in python and django. His other main interest is golf
and he holds an international certification as a golf referee and has
refereed several national level golf tournaments. He writes a regular
column called 'Foss is fun' for the LFY monthly. Most of his code
contributions are here: http://bitbucket.org/lawgon/";

He was a good mentor and friend to many of us.

Some of his contributions, writing and rambling can be found

[1]http://lawgon.livejournal.com/
[2] http://bitbucket.org/lawgon/
[3]http://search.cpan.org/~lawgon/
[4]http://www.linuxforu.com/author/kenneth-gonsalves/
[5]https://people.djangoproject.com/lawgon/
[6]http://in.linkedin.com/pub/kenneth-gonsalves/4/565/10b


--
**
JAGANADH G
http://jaganadhg.in
*ILUGCBE*
http://ilugcbe.org.in
___
BangPypers mailing list
bangpyp...@python.org
http://mail.python.org/mailman/listinfo/bangpypers

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



Re: Detecting browser type after login

2012-08-03 Thread Larry Martell
On Thu, Aug 2, 2012 at 8:15 PM, Melvyn Sopacua  wrote:
> On 1-8-2012 21:52, Larry Martell wrote:
>> On Wed, Aug 1, 2012 at 1:38 PM, Kurtis Mullins  
>> wrote:
>>> Sorry for the double-message. Anyways, if you do want to do what that other
>>> person recommended, simply find the View that the user is redirected to
>>> after logging in. Then, modify the "context data" of that view to dump
>>> whatever data to the template. And then do some magic in the template based
>>> upon that context data. In short, put this logic in the view the user is
>>> sent to after they've logged in.
>>
>> What view they are redirected to is not consistent. It depends on what
>> the user is permissioned for and what features the customer has paid
>> for. But I may be able to do this in some common part of the code.
>
> Add a UserProfile field "just_logged_in", type Boolean.
> The only place that field gets set to True is in the login view. Don't
> forget to save the profile in that view.
> Create a small that sets the field back to False and saves the profile
> that can be invoked by an AJAX call.
> In your base_site.html template use:
>  {% if user.get_user_profile.just_logged_in %}
> to include a javascript bit, that generates the popup /and/ calls the
> view that resets the just_logged_in field.

Thanks for the reply Melvyn. But after all this work and research
they've decided now that they want the popup displayed before the user
logs in. This greatly simplifies things, as I can do it all from the
login template. Thanks all for the help.

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



Sample Django template scrolling table

2012-08-03 Thread Charles Norton
I would like to create a simple table in a Django template that can scroll. 
I am interested in finding a sample from which I can learn. If someone 
would point me to a sample, I would appreciate it. 

The application would be having a 10 line table, 55 water meter information 
rows, and being able to scroll though the table back and forth.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/fx_k-K3-ApIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Sample Django template scrolling table

2012-08-03 Thread Kurtis Mullins
Can you clarify by what you mean when you say "scroll through the table
back and forth"?

This is pretty easy to implement using CSS/HTML and isn't relevant to
Django in particular -- but maybe I'm simply misunderstanding your question
:)

On Fri, Aug 3, 2012 at 3:08 PM, Charles Norton wrote:

> I would like to create a simple table in a Django template that can
> scroll. I am interested in finding a sample from which I can learn. If
> someone would point me to a sample, I would appreciate it.
>
> The application would be having a 10 line table, 55 water meter
> information rows, and being able to scroll though the table back and forth.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/fx_k-K3-ApIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



.filter(Q(childobj__attr1="something", childobj__attr2__gte=100)) and .filter(~Q(childobj__attr1="something", childobj__attr2__gte=100)) Don't Produce Opposite Results

2012-08-03 Thread Matthew Kremer
Having trouble figuring this one out.

class ParentObj:
id = UUIDField(primary_key=True)

class ChildObj:
id = UUIDField(primary_key=True)
parent = models.ForeignKey(ParentObj)
attr1 = models.CharField(max_length=128)
attr2 = models.IntegerField()

If you filter one table based on it's children tables parameters like so:

models.ParentObj.objects.filter(Q(childobj__attr1="something", 
childobj__attr2__gte=100)).count()

Let's say you get 1 and there are 10 total tables. Assuming that,

models.ParentTable.objects.filter(~Q(childtable__attr1="something", 
childtable__attr2__gte=100)).count()

Should return 9, however, it instead returns all ParentObjects that have AT 
LEAST ONE child where attr1 is not "something" and ALL children have attr2 
less than 100. It seems that the ~Q() does two seperate lookups on 
childtable for attr1 and attr2 instead of comparing both with one lookup.

Am I missing something?

Thanks,
Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/GrxGO9d8KVQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Registering only folks with .org email

2012-08-03 Thread Steve
I am very new to Django but I like it a lot. I learned about the registration 
plugin and I am trying to modify it such that only the individuals who have and 
can validate an email with .org address can register. I was wondering if 
someone could point me in the right direction in terms of how exactly I should 
modify the plugin. I am reading the docs and I see some forms for the default 
strategy. For example, there is one form disallowing the hotmail, gmail, etc. 
addresses. My strategy would be similar to that. However, since I am new to 
Django and Python, I don't know how I should modify the app. For ex., should I 
download a copy and put it in the main project folder? Any best practices and 
tips would be greatly appreciated.

Steve

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/iaxHEo8NmWoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Resubmit on error middleware

2012-08-03 Thread Paul Pietkiewicz
Hello All,

Is it possible to have a process_exception on handling an exception resubmit 
the request, instead of either returning a HttpResponse or None back to the 
user? Is there a clean way to redirect the response back to the view?

Thanks,
Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-dUoFkGtLyIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: object.create speed, creating 3 objects takes 1 sec in sqlite

2012-08-03 Thread Kurtis Mullins
If you plan to create a batch of objects, I wouldn't recommend going that
route. Instead, check this out:

https://docs.djangoproject.com/en/dev/howto/initial-data/

Has Django really such a bad performance for data insertion?


The Object Relational Mapper does quite a bit more than simply write SQL
insertion queries. I won't go into the details simply because I don't want
to run you in the wrong direction but if you're interested in that topic,
I'm sure someone else can fill you in on the details.

However, the main bottleneck that I see is in the structure. If you expect
5,000 queries at once on a regular basis then you may want to structure
your application around that. Or, at least the part that performs this
batch insertion. Even a relational database management system will most
likely have issues with performing that type of duty directly (without the
Django layer) unless it's optimized and tuned correctly, sitting on
extremely fast IO hardware, etc...

Judging from your times with SQLite, I would guess that part of your
problem is the IO performance (Hard Drive), since SQLite stores its data
directly into a file.

Not sure if this answers your question but hopefully it might lead you in
the right direction :) Good luck!

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



RE: [] Resubmit on error middleware

2012-08-03 Thread Henrik Genssen
you could return a HttpResponseRedirect and handle your error on a different 
url or write your own error middleware...
for some ideas on error middleware see see:
https://bitbucket.org/ashcrow/django-error-capture-middleware/wiki/Home

regards

Henrik

>reply to message:
>date: 03.08.2012 14:59:19
>from: "Paul Pietkiewicz" 
>to: django-users@googlegroups.com
>subject: [] Resubmit on error middleware
>
>Hello All,
>
>Is it possible to have a process_exception on handling an exception resubmit 
>the request, instead of either returning a HttpResponse or None back to the 
>user? Is there a clean way to redirect the response back to the view?
>
>Thanks,
>Paul
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"Django users" group.
>To view this discussion on the web visit 
>https://groups.google.com/d/msg/django-users/-/-dUoFkGtLyIJ.
>To post to this group, send email to django-users@googlegroups.com.
>To unsubscribe from this group, send email to 
>django-users+unsubscr...@googlegroups.com.
>For more options, visit this group at 
>http://groups.google.com/group/django-users?hl=en.
>

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



Re: Registering only folks with .org email

2012-08-03 Thread Kurtis Mullins
Hey Steve,

There's a number of ways you could go about tackling this task. I,
typically, would read the original's application code and first determine
how it worked. In some cases, I would write my code to subclass (or re-use)
theirs and just make the modifications required. Other times, depending on
the complexity of the particular function/feature, I would simply roll my
own out based on what I've learned.

Another great way to go about this, since your effort could potentially be
something useful to others, is to see if the "registration plugin" is
available on github with the proper licensing and then "fork" it. You could
make all of your changes there on github and use "pip" to install your copy
(the fork you made) instead of the original author's. This would be great
because you get to share with others, have a manageable way of monitoring
your changes, and may even get some help from others.

Anyways, those are just some ideas... I'm sure others will have more!

Good luck!
- Kurtis

On Fri, Aug 3, 2012 at 3:58 PM, Steve  wrote:

> I am very new to Django but I like it a lot. I learned about the
> registration plugin and I am trying to modify it such that only the
> individuals who have and can validate an email with .org address can
> register. I was wondering if someone could point me in the right direction
> in terms of how exactly I should modify the plugin. I am reading the docs
> and I see some forms for the default strategy. For example, there is one
> form disallowing the hotmail, gmail, etc. addresses. My strategy would be
> similar to that. However, since I am new to Django and Python, I don't know
> how I should modify the app. For ex., should I download a copy and put it
> in the main project folder? Any best practices and tips would be greatly
> appreciated.
>
> Steve
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iaxHEo8NmWoJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: .filter(Q(childobj__attr1="something", childobj__attr2__gte=100)) and .filter(~Q(childobj__attr1="something", childobj__attr2__gte=100)) Don't Produce Opposite Results

2012-08-03 Thread Kurtis Mullins
Let's write this in logical notation

models.ParentObj.objects.filter(Q(childobj__attr1="something",
> childobj__attr2__gte=100)).count()


A AND B

This query should give you all objects where both attr1="something" is true
AND attr2_gte=100 is true. Does this sound right from the data you have at
hand?


> models.ParentTable.objects.filter(~Q(childtable__attr1="something",
> childtable__attr2__gte=100)).count()
>

~ ( A AND B ) = ~A OR ~B

This query should (at least according to logic, I'm not sure according to
Django's ORM) give you all objects where EITHER attr1="something" is false
OR attr2 >= 100 is false.

Again, does your data set show this is true?


>
> Should return 9, however, it instead returns all ParentObjects that have
> AT LEAST ONE child where attr1 is not "something" and ALL children have
> attr2 less than 100. It seems that the ~Q() does two seperate lookups on
> childtable for attr1 and attr2 instead of comparing both with one lookup.
>
> Am I missing something?
>

I believe ... just from reading what you've posted, that you actually want
the Complement of the set of objects. Maybe something along these lines
would help you?

http://stackoverflow.com/questions/8820113/django-getting-complement-of-queryset

Anyways, Good luck!

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



Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Daniel Roseman
On Friday, 3 August 2012 16:12:35 UTC+1, atm wrote:
>
> With my heartfelt condolence, I'd like to inform you all the unfortunate 
> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a 
> strong advocate of Python, Django and Free Software in India.
> He had served as the President of IPSS(Indian Python Software Society), 
> which initiated the PyCon India, done a lot of workshops on Python and was 
> an active member in the Django user group.
>
> Anoop Thomas Mathew
>


That's a shock. He was a valued contributor to this list and to the Django 
community in general. Please pass on condolences to his family and friends.
--
Daniel.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/rw1v7g4R8nsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



showing a second level of indirection in an admin change_form page

2012-08-03 Thread Tomas Neme
Anyone knows of any trick that will let me show a second-level
indirection inline

via a one2one, so ModelA <-FK- ModelB <-one2one- ModelC, and show A,
B-C-B-C-B-C kind of thing?

Maybe I can override the get_formsets in the admin?

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

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



Re: PostGIS 2.0.0 problems

2012-08-03 Thread Oleg Korsak
looks like GeoDjango is dead, it is not solved for almost half of the year

четверг, 19 июля 2012 г., 21:23:03 UTC+3 пользователь Dominique Guardiola 
Falco написал:
>
>
> Is there a tutorial describing how to do this somewhere please ?
> Because right now, geodjango is unusable with PostGreSQL 9 + PostGIS 2
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mmBsv7nuDvoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PostGIS 2.0.0 problems

2012-08-03 Thread Thomas Lockhart

On 8/3/12 3:39 PM, Oleg Korsak wrote:

looks like GeoDjango is dead, it is not solved for almost half of the year
Really? What is the use case requiring a version 2.0.0? Seems that the 
previous 1.x version works as advertised.


And typically folks don't jump on a x.0.0 of anything, expecting to see 
it settle down after release with some minor fixes and additional 
releases. That may be the case with the GeoDjango folks though I don't 
know for sure.


hth

  - Tom

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



Re: PostGIS 2.0.0 problems

2012-08-03 Thread Christophe Pettus

On Aug 3, 2012, at 3:55 PM, Thomas Lockhart wrote:
> Really? What is the use case requiring a version 2.0.0?

PostGIS 2.0 has a lot of stuff in it, including things like KNN indexes; those 
alone are worth upgrading for.

> And typically folks don't jump on a x.0.0 of anything, expecting to see it 
> settle down after release with some minor fixes and additional releases.

Well, 2.0 has been out for four months so far, so it's not exactly a brand-new 
release.

--
-- Christophe Pettus
   x...@thebuild.com

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



Re: [] Resubmit on error middleware

2012-08-03 Thread Paul Pietkiewicz
I've written my own middleware class with a process_exception method to 
capture the exception, and remedy the underlining condition which caused 
the exception. The point is to transparently resubmit the request without 
actually returning anything to the client. Basically to retry the entire 
request and return the result to the user without notifying the user of the 
retry. Is that possible?

Regards,
Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/zskMJnW7RPgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



favourite reusable apps

2012-08-03 Thread jondykeman
Hi Everyone, 

I have found when getting into Django that at least once a month I find 
a reusable app that replaces the need for what I had spent the last ~2 
weeks figuring out how to write myself. 

As such, I thought it might be nice to start a thread of everyone's 
favourite / most useful apps that they find themselves re-using over and 
over again.

If I were to start it off I would go with django-extensions 
(https://github.com/django-extensions/django-extensions/) for some very 
useful additional commands via ./manage.py that come in handy with almost 
every project.

JD

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/bPDnMm6WAekJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: favourite reusable apps

2012-08-03 Thread Russell Keith-Magee
A suggestion: Rather than a mailing list thread, drop into djangopackages.com

It's a community site specifically aimed at cataloging Django apps
according to what they do, and how popular they are.

Yours,
Russ Magee %-)

On Sat, Aug 4, 2012 at 8:28 AM, jondykeman  wrote:
> Hi Everyone,
>
> I have found when getting into Django that at least once a month I find a
> reusable app that replaces the need for what I had spent the last ~2 weeks
> figuring out how to write myself.
>
> As such, I thought it might be nice to start a thread of everyone's
> favourite / most useful apps that they find themselves re-using over and
> over again.
>
> If I were to start it off I would go with django-extensions
> (https://github.com/django-extensions/django-extensions/) for some very
> useful additional commands via ./manage.py that come in handy with almost
> every project.
>
> JD
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/bPDnMm6WAekJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Karen Tracey
On Fri, Aug 3, 2012 at 11:12 AM, Anoop Thomas Mathew wrote:

> With my heartfelt condolence, I'd like to inform you all the unfortunate
> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
> strong advocate of Python, Django and Free Software in India.
> He had served as the President of IPSS(Indian Python Software Society),
> which initiated the PyCon India, done a lot of workshops on Python and was
> an active member in the Django user group.
>
>
I'm so sorry to hear that, he was indeed a longtime contributor to this
group and will be missed. Thank you for letting us know.

Karen

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



Form Wizard usable with branching?

2012-08-03 Thread mtnhiker
I think I must be missing something. To me a wizard should provide 
questions and branch according to the answers (otherwise why not just put 
it all in one form?).  I've searched the docs and web and source, but I 
don't find anything that lets me branch.  I thought the "condition_dict" of 
the wizard view would do the trick.  Seems not.

Using the condition_dict can say when a step should be skipped.  But this 
isn't the same as jumping to a specific step.

What I really want is to (somewhere!) check the values of a form right 
after the user hit "submit". Based on those values, jump to the next 
appropriate form.

What is broken in my thinking about this?  Are people actually writing 
wizards with 1.4 that use the form wizard and do branching?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/lMGczulckp8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Form Wizard usable with branching?

2012-08-03 Thread mtnhiker
Answering my own question...

I debugged my brain a bit and got something working with branching.  Here's 
my interpretation of my brain bug.

First a "step" is not something attached to a particular form.  Its the 
index in a sequence.  The same form might be step 2 with one branching 
structure but step 3 for another.

Second, the "condition_dict" keyword to wizard.as_view() should be thought 
only as "use or don't use" a form. For me, this mean I had to stop thinking 
of how to make the wizard go from one node to another in a flow chart.  Its 
as if all nodes in a flow chart are possible and the condition_dict is used 
to look up-stream in the flow-chart to decide if a particular node (form) 
should be used.

I still would like to be able to design a wizard as a flow chart wtih 
branches that switch based upon field values. I'd like to do this very 
directly.  Perhaps I will write a django contrib that effectively tales 
input as a directed-graph that represents the flow chart, and generates the 
right condition_dict to make it happen.  (but first I have an app to build)

On Friday, August 3, 2012 7:27:03 PM UTC-7, mtnhiker wrote:
>
> I think I must be missing something. To me a wizard should provide 
> questions and branch according to the answers (otherwise why not just put 
> it all in one form?).  I've searched the docs and web and source, but I 
> don't find anything that lets me branch.  I thought the "condition_dict" of 
> the wizard view would do the trick.  Seems not.
>
> Using the condition_dict can say when a step should be skipped.  But this 
> isn't the same as jumping to a specific step.
>
> What I really want is to (somewhere!) check the values of a form right 
> after the user hit "submit". Based on those values, jump to the next 
> appropriate form.
>
> What is broken in my thinking about this?  Are people actually writing 
> wizards with 1.4 that use the form wizard and do branching?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/JZyPwzBIamoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PostGIS 2.0.0 problems

2012-08-03 Thread Will Tuladhar-Douglas
Folks,

I just checked and I'm running Postgres 9.1 and Postgis 2.0SVN with GeoDjango 
(on Mac OSX 10.7.4) . I'm not doing anything very exciting with GeoDjango so 
far, so perhaps there are problems I haven't encountered, but it does run, and 
it is possible to encode locations using the GeoDjango ORM features. I didn't 
do anything special for Django (1.4.1) or GeoDjango, but setting up PostGis 
does need to be done right, and the special version of psycopgsl is required - 
all of that is well documented, though.

-WBTD.



On 4 Aug 2012, at 04:24, Oleg Korsak wrote:

> looks like GeoDjango is dead, it is not solved for almost half of the year
> 
> четверг, 19 июля 2012 г., 21:23:03 UTC+3 пользователь Dominique Guardiola 
> Falco написал:
> 
> Is there a tutorial describing how to do this somewhere please ?
> Because right now, geodjango is unusable with PostGreSQL 9 + PostGIS 2
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/mmBsv7nuDvoJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.



- - -- --- -  -
Will Tuladhar-Douglas 
Anthropology ∙ Environments ∙ Religions
Wellcome Trust Research Fellow, Nepal, 2011-12.
Visiting Scientist, ICIMOD SL/PR group.
tending.to/garden

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