Re: Django based Project Management software

2011-03-07 Thread Anand Agarwal
Its a hosted solution for subversion repository. Every project you create
has its own svn repository created on our servers.

-Regards
Anand
http://bootstraptoday.com

On Tue, Mar 8, 2011 at 11:47 AM, Kenneth Gonsalves
wrote:

> On Tue, 2011-03-08 at 11:40 +0530, Anand Agarwal wrote:
> > Yes
> >
> > http://bootstraptoday.com
> >
> >
>
> btw, what do you mean by 'it has subversion hosting'?
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> 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: Django-Celery: Rate Limit

2011-03-07 Thread Юлиян Попов
I tried but still no answers, that's why I decided to try here :(

-- 
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: When do we stop using Django admin?

2011-03-07 Thread vikalp sahni
Agree,

Admin should be considered as Admin for internal stuffs.

if there is lots of opening up required. you should treat it as a customized
app.

Opening up of a table or two might work good in admin itself, with not much
relations.

Regards,
//Vikalp

On Tue, Mar 8, 2011 at 11:46 AM, ajaishankar  wrote:

> Thanks Viklap
>
> We have been doing a lot of ModelAdmin & ModelForm tweaking as
> mentioned in those slides.
>
> But still kind of skeptical we should be opening up the admin to other
> companies; and go through the gymnastics of restricting say a foreign
> key lookup to just the data they are allowed to access etc.
>
> Ajai
>
> On Mar 7, 11:57 pm, vikalp sahni  wrote:
> > Hi,
> >
> > Django Admin is nicely structured to give you lot of flixibility.
> >
> > We have tweaked around admin using all possible features and with good
> > mingling of MIDDLEWARE, AUTH_BACKENDS  and STORAGE one can
> > achive a lot of integrations and customizations.
> >
> > have a look at these slides, it brings more amount of confidence to going
> > forward
> > with Django-Adminhttp://
> www.slideshare.net/lincolnloop/customizing-the-django-admin
> >
> >  >Regards,//Vikalp
> >
> >
> >
> > On Tue, Mar 8, 2011 at 11:19 AM, ajaishankar 
> wrote:
> > > Hi
> >
> > > We have a app built on Django, and have been using the admin to good
> > > effect.
> >
> > > Right now we want to open up the app to other companies:
> >
> > > 1. They can log in, create *their* own users
> > > 2. They can only see data that belongs to their company etc.
> > > 3. Also in one part of the app, we expect a highly customized UI where
> > > there is a lot of ajaxy image upload etc going on.
> >
> > > I do know we can tweak the admin to restrict querysets etc. and also
> > > override admin templates - but is admin preferable in this situation?
> >
> > > Or is it better to treat all this as a front end web app, and start
> > > work on fresh pages.
> >
> > > Any pointers would be much appreciated.
> >
> > > Thanks
> >
> > > Ajai
> >
> > > --
> > > 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.



Re: When do we stop using Django admin?

2011-03-07 Thread ajaishankar
Thanks KG :)

On Mar 8, 12:16 am, ajaishankar  wrote:
> Thanks Viklap
>
> We have been doing a lot of ModelAdmin & ModelForm tweaking as
> mentioned in those slides.
>
> But still kind of skeptical we should be opening up the admin to other
> companies; and go through the gymnastics of restricting say a foreign
> key lookup to just the data they are allowed to access etc.
>
> Ajai
>
> On Mar 7, 11:57 pm, vikalp sahni  wrote:
>
>
>
> > Hi,
>
> > Django Admin is nicely structured to give you lot of flixibility.
>
> > We have tweaked around admin using all possible features and with good
> > mingling of MIDDLEWARE, AUTH_BACKENDS  and STORAGE one can
> > achive a lot of integrations and customizations.
>
> > have a look at these slides, it brings more amount of confidence to going
> > forward
> > with 
> > Django-Adminhttp://www.slideshare.net/lincolnloop/customizing-the-django-admin
>
> > Regards,//Vikalp
>
> > On Tue, Mar 8, 2011 at 11:19 AM, ajaishankar  wrote:
> > > Hi
>
> > > We have a app built on Django, and have been using the admin to good
> > > effect.
>
> > > Right now we want to open up the app to other companies:
>
> > > 1. They can log in, create *their* own users
> > > 2. They can only see data that belongs to their company etc.
> > > 3. Also in one part of the app, we expect a highly customized UI where
> > > there is a lot of ajaxy image upload etc going on.
>
> > > I do know we can tweak the admin to restrict querysets etc. and also
> > > override admin templates - but is admin preferable in this situation?
>
> > > Or is it better to treat all this as a front end web app, and start
> > > work on fresh pages.
>
> > > Any pointers would be much appreciated.
>
> > > Thanks
>
> > > Ajai
>
> > > --
> > > 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: Django based Project Management software

2011-03-07 Thread Kenneth Gonsalves
On Tue, 2011-03-08 at 11:40 +0530, Anand Agarwal wrote:
> Yes
> 
> http://bootstraptoday.com
> 
> 

btw, what do you mean by 'it has subversion hosting'?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: When do we stop using Django admin?

2011-03-07 Thread Kenneth Gonsalves
On Mon, 2011-03-07 at 21:49 -0800, ajaishankar wrote:
> I do know we can tweak the admin to restrict querysets etc. and also
> override admin templates - but is admin preferable in this situation?

no
> 
> Or is it better to treat all this as a front end web app, and start
> work on fresh pages. 

yes
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: When do we stop using Django admin?

2011-03-07 Thread ajaishankar
Thanks Viklap

We have been doing a lot of ModelAdmin & ModelForm tweaking as
mentioned in those slides.

But still kind of skeptical we should be opening up the admin to other
companies; and go through the gymnastics of restricting say a foreign
key lookup to just the data they are allowed to access etc.

Ajai

On Mar 7, 11:57 pm, vikalp sahni  wrote:
> Hi,
>
> Django Admin is nicely structured to give you lot of flixibility.
>
> We have tweaked around admin using all possible features and with good
> mingling of MIDDLEWARE, AUTH_BACKENDS  and STORAGE one can
> achive a lot of integrations and customizations.
>
> have a look at these slides, it brings more amount of confidence to going
> forward
> with 
> Django-Adminhttp://www.slideshare.net/lincolnloop/customizing-the-django-admin
>
> Regards,//Vikalp
>
>
>
> On Tue, Mar 8, 2011 at 11:19 AM, ajaishankar  wrote:
> > Hi
>
> > We have a app built on Django, and have been using the admin to good
> > effect.
>
> > Right now we want to open up the app to other companies:
>
> > 1. They can log in, create *their* own users
> > 2. They can only see data that belongs to their company etc.
> > 3. Also in one part of the app, we expect a highly customized UI where
> > there is a lot of ajaxy image upload etc going on.
>
> > I do know we can tweak the admin to restrict querysets etc. and also
> > override admin templates - but is admin preferable in this situation?
>
> > Or is it better to treat all this as a front end web app, and start
> > work on fresh pages.
>
> > Any pointers would be much appreciated.
>
> > Thanks
>
> > Ajai
>
> > --
> > 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: Django based Project Management software

2011-03-07 Thread Anand Agarwal
Yes

http://bootstraptoday.com

-Anand

On Tue, Mar 8, 2011 at 5:43 AM, Kenneth Gonsalves wrote:

> On Mon, 2011-03-07 at 19:33 +0530, Anand Agarwal wrote:
> > Here is very simple & intuitive Web based Project Management
> > Application
> > based on django. Also it has subversion hosting.
> >
> > http://bit.ly/fazfqa
>
> http://bootstraptoday.com/  <- this one?
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> 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: django 1.2 + Google app engine + templatetags

2011-03-07 Thread Nick Rosencrantz
Solved.

-- 
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: When do we stop using Django admin?

2011-03-07 Thread vikalp sahni
Hi,

Django Admin is nicely structured to give you lot of flixibility.

We have tweaked around admin using all possible features and with good
mingling of MIDDLEWARE, AUTH_BACKENDS  and STORAGE one can
achive a lot of integrations and customizations.

have a look at these slides, it brings more amount of confidence to going
forward
with Django-Admin
http://www.slideshare.net/lincolnloop/customizing-the-django-admin

Regards,
//Vikalp

On Tue, Mar 8, 2011 at 11:19 AM, ajaishankar  wrote:

> Hi
>
> We have a app built on Django, and have been using the admin to good
> effect.
>
> Right now we want to open up the app to other companies:
>
> 1. They can log in, create *their* own users
> 2. They can only see data that belongs to their company etc.
> 3. Also in one part of the app, we expect a highly customized UI where
> there is a lot of ajaxy image upload etc going on.
>
> I do know we can tweak the admin to restrict querysets etc. and also
> override admin templates - but is admin preferable in this situation?
>
> Or is it better to treat all this as a front end web app, and start
> work on fresh pages.
>
> Any pointers would be much appreciated.
>
> Thanks
>
> Ajai
>
> --
> 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.



When do we stop using Django admin?

2011-03-07 Thread ajaishankar
Hi

We have a app built on Django, and have been using the admin to good
effect.

Right now we want to open up the app to other companies:

1. They can log in, create *their* own users
2. They can only see data that belongs to their company etc.
3. Also in one part of the app, we expect a highly customized UI where
there is a lot of ajaxy image upload etc going on.

I do know we can tweak the admin to restrict querysets etc. and also
override admin templates - but is admin preferable in this situation?

Or is it better to treat all this as a front end web app, and start
work on fresh pages.

Any pointers would be much appreciated.

Thanks

Ajai

-- 
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.



Cycle & Include tags

2011-03-07 Thread Brian Neal
I'm using a recent checkout of Django trunk.

If I have a template "test.html" which is this:

{{ rowcolors }}

the only way I could make cycle and include behave together is to do
this:

{% for obj in page.object_list %}

{% include 'test.html' %}
{% endfor %}

I thought that perhaps the new "silent" keyword would eliminate the
need to HTML comment out the cycle tag:

{% for obj in page.object_list %}
{% cycle 'odd' 'even' as rowcolors silent %}
{% include 'test.html' %}
{% endfor %}

However, the very first time through the for loop, rowcolors is not
set in the included template. It works on subsequent cycles though.

Is there a way to make this work without having to HTML comment out
the cycle tag output? Admittedly it's a minor annoyance.

Thanks!

-- 
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 aggreate in html django

2011-03-07 Thread sushanth Reddy
Hi Tom,

Can you please  add few lines of code example,
to make code more efficient?sorry for troubling.  

-- 
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: Problem using django and ajax-jQuery

2011-03-07 Thread Daniel Roseman
On Monday, March 7, 2011 3:32:51 PM UTC-8, Rami wrote:
>
> Thanks Andy!
>
> 1- you were correct about the form submitting the get method.
>
> 2- As you mentioned, the when I change the  if statement to 
> "request.GET.has_key('ajax')", it gets executed. the "?ajax" apparently 
> causes the statement to be interpreted as a GET (I didn't know that)
>
> The only reason I had the '/?ajax' in my syntax is because I was following 
> a tutorial that was for a get method. 
>

A clarification: the method is still POST. But it is possible to have both 
POST and GET data in the same request, which is what you've done here - data 
appended after the question-mark in a URL is GET, but the other data you're 
submitting is POST.
 

> Question:
>
> What is the difference between passing data variables to the server in the 
> URL vs in the [data] category of the the post method?
>
> i.e. having '/?ajax=' + $(this).attr('id') vs  id: $(this).attr('id')
>

As I say above, those appended to the URL are GET, and the others are POST. 
Practically speaking, for an AJAX request it makes very little difference, 
although good practice is still to use POST for actions that make changes 
(ie update the database).
--
DR. 

>  
>
 

-- 
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: Django based Project Management software

2011-03-07 Thread Kenneth Gonsalves
On Mon, 2011-03-07 at 19:33 +0530, Anand Agarwal wrote:
> Here is very simple & intuitive Web based Project Management
> Application
> based on django. Also it has subversion hosting.
> 
> http://bit.ly/fazfqa 

http://bootstraptoday.com/  <- this one?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
On Mon, Mar 7, 2011 at 10:51 PM, Mike Ramirez  wrote:

>  On Monday, March 07, 2011 01:20:47 pm Cal Leeming [Simplicity Media Ltd]
> wrote:
>
> > I wouldn't recommend using this method, I did this previously for several
>
> > months, and quickly switched to an alternative (which I mentioned in my
>
> > previous post).
>
> >
>
> > Generally speaking, keeping anything outside of the version control is
> just
>
> > not a good idea, unless it's a tmpfs, a sock dir, or autonomously managed
>
> > data store.
>
> >
>
> +1 local_settings.py
>
>  I do advocate a `local_setting.py.tmpl` that is in vc, it contains the
> settings that are expected to change per deployment. These are empty/blank
> defaults of the settings and allow the dev to choose their own poisons, from
> db, dbinfo to paths to installed apps. (settings.py has the mandatory, cross
> install stuff that is required). But no data that shouldn't be there, isn't
> (like db info, it being the #1 item to pick on because it has (a)
> password(s)).
>
> Currently I'm not sure where to put logging in this case, I'm using it in
> local_settings, but I'm pretty sure I'll end up with it back in settings.py
> when all is said and done.
>
> > As for never having to type --settings, with the solution I mentioned
>
> > before, you'd just have to prepend commands with DJANGO_ENVIRONMENT=dev
> or
>
> > prod. (e.g. DJANGO_ENVIRONMENT=dev ./manage.py shell). You can shorten
> the
>
> > name if you are really lazy (DE=dev or w/e).
>
> >
>
>  The real kicker in using a local_settings,py is how you import it with
> the settings.py
>
> `from local_settings import *` as your first line in settings.py, you don't
> need to worry about either env or --settings, it's just `./manage.py shell`
>
> K.I.S.S. is my prefered way of handling things, introducing new env vars
> moves away from simplicity and does not add much in this case.
>
> ftr. aliases can shorten all key strokes and has bash completion to save
> even more keystrokes in either situation.
>
> > I really would not recommend trying to do any sort of automatic
> environment
>
> > detection, this can lead to many many tears being shed.
>
> Agreed, except with dynamic paths, such as those based on:
>
> `PROJECT_PATH=os.path.abspath(os.path.dirname(__file__))`
>
> > The command line is
>
> > brutal and heartless, no matter if your a newbie or a seasoned pro.
>
> >
>
> Disagree, It's just doesn't try to anticipate anything and expects you to
> know what you want to do and does exactly what you tell it to do (rm/mv -i
> not withstanding). This isn't heartless or brutal, this is what should be
> expected. First lesson taught to me in programming classes.. "A computer
> does exactly what the programmer tells it to, nothing less, nothing more."
>
>  Really, as I write this, I begining to think these issues are more
> opinion based vs any real reason (read technical reason) and what fits the
> developer and situation.
>
> Mike
>

I have to disagree with this. Yes a computer only does exactly what you tell
it is, but you are working with other peoples programs and code, and unless
you have counted in every single factor, then you don't know 100% what the
outcome will be. The CLI can be brutal and heartless to careless mistakes,
non anticipation of circumstances etc. Lets face it, if we all knew 100%
what we were doing, we'd never have any bugs or errors. lol. And on top of
this, people have different coding/admin styles. Some like to think long and
hard, others like to get stuck right in.

 --
>
> Lightning strikes.
>
>  --
> 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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Mike Ramirez
On Monday, March 07, 2011 01:20:47 pm Cal Leeming [Simplicity Media Ltd] 
wrote:
> I wouldn't recommend using this method, I did this previously for several
> months, and quickly switched to an alternative (which I mentioned in my
> previous post).
> 
> Generally speaking, keeping anything outside of the version control is just
> not a good idea, unless it's a tmpfs, a sock dir, or autonomously managed
> data store.
> 

+1 local_settings.py

 I do advocate a `local_setting.py.tmpl` that is in vc, it contains the 
settings that are expected to change per deployment. These are empty/blank 
defaults of the settings and allow the dev to choose their own poisons, from 
db, dbinfo to paths to installed apps. (settings.py has the mandatory, cross 
install stuff that is required). But no data that shouldn't be there, isn't 
(like db info, it being the #1 item to pick on because it has (a) 
password(s)).

Currently I'm not sure where to put logging in this case, I'm using it in 
local_settings, but I'm pretty sure I'll end up with it back in settings.py 
when all is said and done.

> As for never having to type --settings, with the solution I mentioned
> before, you'd just have to prepend commands with DJANGO_ENVIRONMENT=dev or
> prod.  (e.g. DJANGO_ENVIRONMENT=dev ./manage.py shell). You can shorten the
> name if you are really lazy (DE=dev or w/e).
> 


The real kicker in using a local_settings,py is how you import it with the 
settings.py

`from local_settings import *` as your first line in settings.py, you don't 
need to worry about either env or --settings, it's just `./manage.py shell` 

K.I.S.S. is my prefered way of handling things, introducing new env vars moves 
away from simplicity and does not add much in this case. 

ftr. aliases can shorten all key strokes and has bash completion to save even 
more keystrokes in either situation.

> I really would not recommend trying to do any sort of automatic environment
> detection, this can lead to many many tears being shed. 

Agreed, except with dynamic paths, such as those based on:
`PROJECT_PATH=os.path.abspath(os.path.dirname(__file__))` 

> The command line is
> brutal and heartless, no matter if your a newbie or a seasoned pro.
> 

Disagree, It's just doesn't try to anticipate anything and expects you to know 
what you want to do and does exactly what you tell it to do (rm/mv -i not 
withstanding). This isn't heartless or brutal, this is what should be 
expected. First lesson taught to me in programming classes.. "A computer does 
exactly what the programmer tells it to, nothing less, nothing more." 


Really, as I write this, I begining to think these issues are more opinion 
based vs any real reason (read technical reason) and what fits the developer 
and situation. 

Mike

-- 
Lightning strikes.

-- 
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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Shawn Milochik
I really need to pay attention to whom incoming e-mail is addressed. I
thought I was continuing the thread on the list.

Shawn

-- 
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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
I guess it depends on what you need to do.

The webapps we run here have to meet a "high availability" criteria where it
can float between nodes without experiencing any problems, whilst keeping a
clear separation between dev, staging (if needed) and production
environments. Our webapps are also quite CLI intensive, meaning there is a
lot of behind the scenes stuff going on by our sys admins, thus our use of
environmental variables. Generally speaking, this would be considered to be
one step down from a truly enterprise deployment (the next step up would be
CI - continuous integration) but this is a separate consideration all
together.

OP - If you have the time/resources to play around, then I'd say try some
options out, and see which you feel most comfortable with. Like anything,
you can only learn with trial and error. Once you are happy with something,
stick with it, until you find something better, or until you find it is
becoming a hindrance :)

Cal

(Shawn, ive cc'd the list on this response, as OP may have a similar use
case as yourself)


On Mon, Mar 7, 2011 at 9:50 PM, Shawn Milochik  wrote:

> On Mon, Mar 7, 2011 at 4:20 PM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
> > I wouldn't recommend using this method, I did this previously for several
> > months, and quickly switched to an alternative (which I mentioned in my
> > previous post).
> > Generally speaking, keeping anything outside of the version control is
> just
> > not a good idea, unless it's a tmpfs, a sock dir, or autonomously managed
> > data store.
>
> It's a perfect solution for my use-case, which is turning on debug,
> changing database settings, and adding in things like
> django-debug-toolbar.
>
> Shawn
>

-- 
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.



FileWrapper not working for me.

2011-03-07 Thread Tom Eastman

Hey guys, I'm using the Maverick packages, so Django 1.2.3

I need to serve a large binary (an mp3 in this case) directly through 
Django to ensure good access control independent of the web server itself.


I have the following snippet of code, to download binary files via django:


filename = os.path.join(settings.MEDIA_ROOT,  diary.file.name)
filesize = os.path.getsize(filename)
mimetype, encoding = mimetypes.guess_type(filename)

lastmodified = http_date(os.path.getmtime(filename))

wrapper = FileWrapper(file(filename))
response = HttpResponse(wrapper, content_type=mimetype)
#response = HttpResponse(open(filename).read(), content_type=mimetype)

response['Content-Length'] = filesize
response['Last-Modified'] = lastmodified

return response


For some reason, I only ever get a zero-length response out of this. But 
if I uncomment the other HttpResponse, the one that reads it all into 
memory first (yuck!) it works just fine.  Why would the FileWrapper not 
be doing what it's supposed to do?


--
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.



date_heiarchy not working

2011-03-07 Thread Bobby Roberts
i've got this in my admin model:
 date_heiarchy='ShipDate'

Shipdate is a DateField.  The Date Heiarchy plugin is not showing on
my admin list view... has that been depricated in django 1.2+?

-- 
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: Multiple database queries

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, I should make myself more clear.

The complex lookups (such as range queries, full text search etc) take place
inside Sphinx Search, then we do ID lookups from the database with the
results from Sphinx.

You can do column lookups as well on Sphinx >=0.99, so if you wanted to
lookup the database for a username, you could do an "is exact" match on the
username column for that string, and it'll give you the database primary
key.

On Mon, Mar 7, 2011 at 9:49 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hey Vidja,
>
> May I ask why so many database instances are required? In my experience, if
> you get to the point where you really need this many, it's usually better to
> use a solution like Sphinx Search Engine, then employ your database as a
> heavy key/value store (with the bare necessary unique compound keys).
>
> We have a database with around 19 million rows (500,000 now added each
> day), which comes to around 20gb in the data lib folder. Now we push around
> 170 queries per second average (consisting of simple ID lookups), on a
> single quad core server with 8gb RAM. All the lookup queries take place
> inside Sphinx Search.
>
> This may not be appropriate for what you need, and does add some
> complexity, but I would certainly encourage you to explore this option if
> performance is what you need, without having to throw more and more hardware
> into it.
>
> Cal
>
>
>
> On Mon, Mar 7, 2011 at 9:41 PM, Vidja  wrote:
>
>> Hi all,
>>
>> does anyone have experience with querying against multiple databases
>> and performance issues? My plan is to query against 15-200  instances
>> of a database (Postgres on a 8 core 32 GB machine, each db about 200
>> mb) , all with the same schema (an thus model file), but with
>> different data.
>> Are there serious performance bottlenecks to be expected?
>>
>> --
>> 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: Multiple database queries

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
Hey Vidja,

May I ask why so many database instances are required? In my experience, if
you get to the point where you really need this many, it's usually better to
use a solution like Sphinx Search Engine, then employ your database as a
heavy key/value store (with the bare necessary unique compound keys).

We have a database with around 19 million rows (500,000 now added each day),
which comes to around 20gb in the data lib folder. Now we push around 170
queries per second average (consisting of simple ID lookups), on a single
quad core server with 8gb RAM. All the lookup queries take place inside
Sphinx Search.

This may not be appropriate for what you need, and does add some complexity,
but I would certainly encourage you to explore this option if performance is
what you need, without having to throw more and more hardware into it.

Cal



On Mon, Mar 7, 2011 at 9:41 PM, Vidja  wrote:

> Hi all,
>
> does anyone have experience with querying against multiple databases
> and performance issues? My plan is to query against 15-200  instances
> of a database (Postgres on a 8 core 32 GB machine, each db about 200
> mb) , all with the same schema (an thus model file), but with
> different data.
> Are there serious performance bottlenecks to be expected?
>
> --
> 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.



Multiple database queries

2011-03-07 Thread Vidja
Hi all,

does anyone have experience with querying against multiple databases
and performance issues? My plan is to query against 15-200  instances
of a database (Postgres on a 8 core 32 GB machine, each db about 200
mb) , all with the same schema (an thus model file), but with
different data.
Are there serious performance bottlenecks to be expected?

-- 
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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
I wouldn't recommend using this method, I did this previously for several
months, and quickly switched to an alternative (which I mentioned in my
previous post).

Generally speaking, keeping anything outside of the version control is just
not a good idea, unless it's a tmpfs, a sock dir, or autonomously managed
data store.

As for never having to type --settings, with the solution I mentioned
before, you'd just have to prepend commands with DJANGO_ENVIRONMENT=dev or
prod.  (e.g. DJANGO_ENVIRONMENT=dev ./manage.py shell). You can shorten the
name if you are really lazy (DE=dev or w/e).

I really would not recommend trying to do any sort of automatic environment
detection, this can lead to many many tears being shed. The command line is
brutal and heartless, no matter if your a newbie or a seasoned pro.

On Mon, Mar 7, 2011 at 9:13 PM, Shawn Milochik  wrote:

> The easiest solution I've found:
>
>1. Create a file named local_settings.py that is *outside* of
> version control.
>
>2. Import local_settings at the bottom of settings.py, handling
> the exception if it doesn't exist.
>
>3. Override anything you like in local_settings.py.
>
> This has these advantages:
>
>1. You don't need to pass the --settings value when running
> manage.py commands.
>
>2. You *never* have to change settings in your dev environment
> (like DEBUG) -- leave them in "development mode."
>
>3. You have your production settings documented in the "official"
> settings.py.
>
>4. You never have to remember which settings file to use in which
> circumstances -- it's always the default.
>
> Shawn
>
> --
> 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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Shawn Milochik
The easiest solution I've found:

1. Create a file named local_settings.py that is *outside* of
version control.

2. Import local_settings at the bottom of settings.py, handling
the exception if it doesn't exist.

3. Override anything you like in local_settings.py.

This has these advantages:

1. You don't need to pass the --settings value when running
manage.py commands.

2. You *never* have to change settings in your dev environment
(like DEBUG) -- leave them in "development mode."

3. You have your production settings documented in the "official"
settings.py.

4. You never have to remember which settings file to use in which
circumstances -- it's always the default.

Shawn

-- 
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: Bug in Django admin?

2011-03-07 Thread Michael Radziej
Ahoj Martin,

On Mon, 07 Mar 2011 12:49:32 +0100, Martin Tiršel  wrote:
> When I use filter in Django admin (that produces URL  
> .../admin/appname/booltest/?completed__exact=False), I get results which  
> are with completed=True. This is the SQL query generated by Django
> admin:

It's the wrong URL, you should use

.../admin/appname/booltest/?completed__exact=False

(or has this changed since 1.1?)

Is there really a link somewhere in the admin to the "...=False" link,
or did you try to guess it?


Kind regards

Michael

-- 
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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
Oh I also added DJANGO_ENVIRONMENT into that, which lets you specify
environmental based settings overrides from the command line.

Enjoy :)

On Mon, Mar 7, 2011 at 9:09 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hi,
>
> Omg, I was *just* thinking about whether I should do a blog entry about
> this sort of requirement lmao.
>
> To combat multiple node hosting, we use a combination of code (as our
> webapps are split over multiple servers, all of which have different
> functions and varying environments)
>
> Here is a django snippet with it all in.
>
> http://djangosnippets.org/snippets/2384/
>
> If it doesn't make sense, then just let me know.
>
> Cal
>
> On Mon, Mar 7, 2011 at 8:58 PM, Michael Radziej  wrote:
>
>> On Mon, 7 Mar 2011 10:26:53 -0800 (PST), octopusgrabbus <
>> old_road_f...@verizon.net> wrote:
>> > So, my question is, is there an accepted way to populate BASE_URL and
>> > MEDIA_URL with some local setting, like perhaps calling a python
>> > function?, because it's Python code?
>>
>> I usually have a set of setting modules somewhere:
>>
>> base_settings.py - defines the settings that are common to all systems
>> prod_settings.py - imports * from base_settings and contains production
>> settings
>> test_settings.oy - similar
>>
>> BASE_URL and MEDIA_URL would then be set in prod_settings and
>> test_settings.
>>
>> And then I set DJANGO_SETTINGS_MODULE accordingly.
>>
>>
>> Does this make sense to you?
>>
>>
>> Kind regards
>>
>> Michael
>>
>> --
>> 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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Cal Leeming [Simplicity Media Ltd]
Hi,

Omg, I was *just* thinking about whether I should do a blog entry about this
sort of requirement lmao.

To combat multiple node hosting, we use a combination of code (as our
webapps are split over multiple servers, all of which have different
functions and varying environments)

Here is a django snippet with it all in.

http://djangosnippets.org/snippets/2384/

If it doesn't make sense, then just let me know.

Cal

On Mon, Mar 7, 2011 at 8:58 PM, Michael Radziej  wrote:

> On Mon, 7 Mar 2011 10:26:53 -0800 (PST), octopusgrabbus <
> old_road_f...@verizon.net> wrote:
> > So, my question is, is there an accepted way to populate BASE_URL and
> > MEDIA_URL with some local setting, like perhaps calling a python
> > function?, because it's Python code?
>
> I usually have a set of setting modules somewhere:
>
> base_settings.py - defines the settings that are common to all systems
> prod_settings.py - imports * from base_settings and contains production
> settings
> test_settings.oy - similar
>
> BASE_URL and MEDIA_URL would then be set in prod_settings and
> test_settings.
>
> And then I set DJANGO_SETTINGS_MODULE accordingly.
>
>
> Does this make sense to you?
>
>
> Kind regards
>
> Michael
>
> --
> 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: Main Application's settings.py floating multiple systems

2011-03-07 Thread Michael Radziej
On Mon, 7 Mar 2011 10:26:53 -0800 (PST), octopusgrabbus 
 wrote:
> So, my question is, is there an accepted way to populate BASE_URL and
> MEDIA_URL with some local setting, like perhaps calling a python
> function?, because it's Python code?

I usually have a set of setting modules somewhere:

base_settings.py - defines the settings that are common to all systems
prod_settings.py - imports * from base_settings and contains production
settings
test_settings.oy - similar

BASE_URL and MEDIA_URL would then be set in prod_settings and
test_settings.

And then I set DJANGO_SETTINGS_MODULE accordingly.


Does this make sense to you?


Kind regards

Michael

-- 
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 get next and previous element in a forloop in the template

2011-03-07 Thread Ariel
Could you give some idea ???
I am sorry about the previous message I had not finished.

Any help is appreciated.
Regards.


On Mon, Mar 7, 2011 at 3:39 PM, Ariel  wrote:

> Hi everybody:
>
> I would want to know in the django template tags how to get the next and
> the previous element when I am iterating in the forloop, I haven't found
> something similar, for instance I would want something like this:
>
> {% for element in list_elements %}
> {{forloop.get_prev_element.title}}
> {{forloop.get_next_element.title}}
>

-- 
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.



How to get next and previous element in a forloop in the template

2011-03-07 Thread Ariel
Hi everybody:

I would want to know in the django template tags how to get the next and the
previous element when I am iterating in the forloop, I haven't found
something similar, for instance I would want something like this:

{% for element in list_elements %}
{{forloop.get_prev_element.title}}
{{forloop.get_next_element.title}}

-- 
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: Caching and Vary: Cookie header

2011-03-07 Thread Thanos Diacakis
Doh - thanks.

I guess to keep the structure simple, I can set the page up for
anonymous users, fully cached and all, and then use AJAX to figure out
if they are logged in and tweak my header.

Thanos

On Mar 7, 9:43 am, Tom Evans  wrote:
> On Mon, Mar 7, 2011 at 4:23 PM, Thanos Diacakis  wrote:
> > I have spent several hours researching this, and I'm stumped, so
> > perhaps I could tap into some collective wisdom:
>
> > I have a website whose page template includes a "Sign-In or Register"
> > link at the top.   This is shown on pretty much every page.  If the
> > user is already signed in, this is replaced with "Hello _username_ |
> > My Account".  This is done by passing request.user to the template and
> > checking is_authenticated().
>
> > The problem is, that as soon as I touch request.user, the Vary: Cookie
> > header is tagged on, and that destroys caching.  Every anonymous user
> > gets their own version of the page cached, which is almost pointless.
>
> > I'm trying to figure out a way that I can fully utilize the cache for
> > anonymous users (i.e. one instance of the rendered page in the cache)
> > and I'm OK for caching with Vary: Cookie for logged in users.
>
> > So, is there a way to figure out if the user is logged in or not,
> > without tripping the Vary: Cookie header, or is there a better way of
> > doing this altogether?
>
> > BTW, it seems that it is significantly faster (15x CPU time) to cache
> > a whole view, that to cache a fragment, so I'd like to avoid that if
> > possible.
>
> > Thanks
>
> > Thanos
>
> If it is the same URL being visited by the anonymous users and the
> authenticated users, then how is the upstream cache to determine which
> version to send?
>
> Or put it like this, you want to have anonymous users viewing the page
> to not generate a 'Vary: cookie' header. This leads to the following
> situation:
>
> Anonymous user visits /contact-us/
> Django generates the anonymous version of the page and delivers it,
> with appropriate caching headers.
> Upstream cache stores anonymous version in cache
> Logged in user visits /contact-us/
> Upstream cache intercepts the request, looks in its cache for an
> appropriate hit, and delivers the anonymous page.
>
> The basic thing here is that you cannot have your cake and eat it as
> well. Either the page contains dynamic, user-specific content, in
> which case vary on cookie, or it does not, in which case cache it.
>
> If you want to deliver truly cache-able anonymous content, deliver it
> on a different URL to your dynamic content.
>
> Cheers
>
> 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: "DatabaseError: no such table:" in tests

2011-03-07 Thread diogobaeder
Got it, Joel! I'm using South, and I didn't know I had to create a
migration for the new model, even before running the tests... well,
I'll remember that! :-)

Thanks for the help! Problem solved. :-)

Diogo



On Mar 7, 2:49 pm, diogobaeder  wrote:
> I doesn't make sense to run syncdb, since I'm running the test suite,
> and in memory, using SQLite.
>
> Any other idea?
>
> Thanks!
>
> On Mar 7, 2:41 pm, Joel Goldstick  wrote:
>
>
>
>
>
>
>
> > On Mon, Mar 7, 2011 at 12:17 PM, diogobaeder  wrote:
> > > Alright, I printed all the tables to the stdout, while in the test,
> > > and the table was not created before running the test. Am I missing
> > > something here? Just creating the model and associating the app in
> > > INSTALLED_APPS isn't enough?
>
> > > Also, there's another model in the same "models.py" module, and it's
> > > being loaded by the tests... is there any chance it's interfering in
> > > the other model? Here it is:
>
> > > # gear/models.py
>
> > > class DrumPiece(models.Model):
> > >    CATEGORY_CHOICES = (
> > >        ('cymbals', 'Cymbals'),
> > >        ('drums', 'Drums'),
> > >        ('sticks', 'Sticks'),
> > >        ('heads-and-muffling', 'Heads and Muffling'),
> > >        ('microphones', 'Microphones'),
> > >        ('percussion', 'Percussion'),
> > >        ('cases', 'Cases'),
> > >        ('m-audio', 'M-Audio'),
> > >    )
> > >    title = models.CharField(max_length=200)
> > >    description = models.TextField()
> > >    category = models.CharField(max_length=20,
> > > choices=CATEGORY_CHOICES)
> > >    image = ImageField(upload_to=env.get('files_uploads'))
> > >    sites = models.ManyToManyField(Site, blank=True, null=True)
>
> > >    def __unicode__(self):
> > >        return self.title
>
> > >    def save(self, *args, **kwargs):
> > >        choices = [choice[0] for choice in self.CATEGORY_CHOICES]
> > >        if self.category is not None and self.category not in choices:
> > >            self.category = self.CATEGORY_CHOICES[0][0]
> > >        super(DrumPiece, self).save(*args, **kwargs)
>
> > > Thanks again!
>
> > > Diogo
>
> > > On Mar 7, 1:41 pm, Diogo Baeder  wrote:
> > > > Hi there,
>
> > > > I'm having this weird error, where Django is failing while trying to run
> > > > one of my integration tests, saying that it couldn't find the necessary
> > > > table to create the model instance I want.
>
> > > > Here are the relevant parts of my code, an I'm running the tests in
> > > > SQLite in memory:
>
> > > > # gear/tests.py
> > > > from gear.models import ToGoPage
> > > > #...
> > > > class ToGoPageViewTest(TestCase):
> > > >      @istest
> > > >      def shows_an_active_to_go_page(self):
> > > >          to_go_page = ToGoPage.objects.create(
> > > >              content='Some content',
> > > >              active=True
> > > >          )
>
> > > >          response =
> > > > self.client.get('/do-you-want-daniel-playing-in-your-cd/')
>
> > > >          self.assertContains(response, 'Some content')
>
> > > > # gear/models.py
> > > > class ToGoPage(models.Model):
> > > >      content = models.TextField()
> > > >      active = models.BooleanField(default=True)
>
> > > > # the traceback when I run the test
> > > > ==
> > > > ERROR: shows_an_active_to_go_page
> > > (danielbaeder.gear.tests.ToGoPageViewTest)
> > > > --
> > > > Traceback (most recent call last):
> > > >    File
>
> > > "/home/diogo/sites/projetos/danielbaeder/danielbaeder/../danielbaeder/gear/
> > > tests.py",
> > > > line 140, in shows_an_active_to_go_page
> > > >      active=True
> > > >    File
>
> > > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > > /manager.py",
> > > > line 138, in create
> > > >      return self.get_query_set().create(**kwargs)
> > > >    File
>
> > > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > > /query.py",
> > > > line 360, in create
> > > >      obj.save(force_insert=True, using=self.db)
> > > >    File
>
> > > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > > /base.py",
> > > > line 460, in save
> > > >      self.save_base(using=using, force_insert=force_insert,
> > > > force_update=force_update)
> > > >    File
>
> > > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > > /base.py",
> > > > line 553, in save_base
> > > >      result = manager._insert(values, return_id=update_pk, using=using)
> > > >    File
>
> > > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > > /manager.py",
> > > > line 195, in _insert
> > > >      return insert_query(self.model, values, **kwargs)
> > > >    File
>
> > > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > > /query.py",
> > > > line 

Main Application's settings.py floating multiple systems

2011-03-07 Thread octopusgrabbus
Is there a standard, accepted way to use environment variable or other
substitution, so the application's settings.py file can exist on, for
example, a production and test system. Right now, I've taken to coding
the URL strings separately, and I know that's bad in the long run.

So, my question is, is there an accepted way to populate BASE_URL and
MEDIA_URL with some local setting, like perhaps calling a python
function?, because it's Python code?

Thanks.
cmn

-- 
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.



Treebeard Question

2011-03-07 Thread Tyler Brock
Hey guys,

Was wondering if you could help me figure this out...

I've got a class in a model that implements MP_Node from treebeard:
http://dpaste.com/481579/

When I tag something and send the tag request to the API I want to
create a new tag interaction (root node) as defined in the following
handler.

Piston handler: http://dpaste.com/481577/

The idea is, when no parent node is passed in that I want to create a
new tree for possible interactions that happen on that first tag. A
first tag is a new tree of interactions here. (the parent passing in
part isn't implemented yet so everything is a new tree at the moment)

Why is it that the first tag goes ok and subsequent tags are met with
the following error: http://dpaste.com/481583/

Can you only add one root? I've checked the arguments I've passed in
and none are defined as None and each have an id.

I've been looking at the examples and it seems like you can have many
roots. I would like to have a new root (tree) for each first tag on a
given page for a given piece of content.

Please let me know. Thanks in advance!

-- 
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 aggreate in html django

2011-03-07 Thread Tom Evans
On Mon, Mar 7, 2011 at 5:44 PM, sushanth Reddy  wrote:
> Hi ,
>
> I want to make total at the end of the each row,i have explained the details
> in below
> link.
>
> http://stackoverflow.com/questions/5223093/how-to-aggreate-in-html-django
>
> Can you please help me
>
> Thanks in advance
>
> sushanth
>

Er. You're iterating through a list of values, and outputting them,
and at the end of that list, you want to output the sum of the values
you've just output.

How hard have you thought about this?!

Did you consider having some sort of counter variable, and each time
you output a value, you increment the counter by that value..

BTW, looking at the code on stack overflow, it looks like you are
doing one sql query per cell in your output table. This is extremely
inefficient.
At most, this sort of task should only require 1 query to get the list
of users, and 1 query per user to get the list of all expenses for the
selected period.

Cheers

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: "DatabaseError: no such table:" in tests

2011-03-07 Thread diogobaeder
I doesn't make sense to run syncdb, since I'm running the test suite,
and in memory, using SQLite.

Any other idea?

Thanks!

On Mar 7, 2:41 pm, Joel Goldstick  wrote:
> On Mon, Mar 7, 2011 at 12:17 PM, diogobaeder  wrote:
> > Alright, I printed all the tables to the stdout, while in the test,
> > and the table was not created before running the test. Am I missing
> > something here? Just creating the model and associating the app in
> > INSTALLED_APPS isn't enough?
>
> > Also, there's another model in the same "models.py" module, and it's
> > being loaded by the tests... is there any chance it's interfering in
> > the other model? Here it is:
>
> > # gear/models.py
>
> > class DrumPiece(models.Model):
> >    CATEGORY_CHOICES = (
> >        ('cymbals', 'Cymbals'),
> >        ('drums', 'Drums'),
> >        ('sticks', 'Sticks'),
> >        ('heads-and-muffling', 'Heads and Muffling'),
> >        ('microphones', 'Microphones'),
> >        ('percussion', 'Percussion'),
> >        ('cases', 'Cases'),
> >        ('m-audio', 'M-Audio'),
> >    )
> >    title = models.CharField(max_length=200)
> >    description = models.TextField()
> >    category = models.CharField(max_length=20,
> > choices=CATEGORY_CHOICES)
> >    image = ImageField(upload_to=env.get('files_uploads'))
> >    sites = models.ManyToManyField(Site, blank=True, null=True)
>
> >    def __unicode__(self):
> >        return self.title
>
> >    def save(self, *args, **kwargs):
> >        choices = [choice[0] for choice in self.CATEGORY_CHOICES]
> >        if self.category is not None and self.category not in choices:
> >            self.category = self.CATEGORY_CHOICES[0][0]
> >        super(DrumPiece, self).save(*args, **kwargs)
>
> > Thanks again!
>
> > Diogo
>
> > On Mar 7, 1:41 pm, Diogo Baeder  wrote:
> > > Hi there,
>
> > > I'm having this weird error, where Django is failing while trying to run
> > > one of my integration tests, saying that it couldn't find the necessary
> > > table to create the model instance I want.
>
> > > Here are the relevant parts of my code, an I'm running the tests in
> > > SQLite in memory:
>
> > > # gear/tests.py
> > > from gear.models import ToGoPage
> > > #...
> > > class ToGoPageViewTest(TestCase):
> > >      @istest
> > >      def shows_an_active_to_go_page(self):
> > >          to_go_page = ToGoPage.objects.create(
> > >              content='Some content',
> > >              active=True
> > >          )
>
> > >          response =
> > > self.client.get('/do-you-want-daniel-playing-in-your-cd/')
>
> > >          self.assertContains(response, 'Some content')
>
> > > # gear/models.py
> > > class ToGoPage(models.Model):
> > >      content = models.TextField()
> > >      active = models.BooleanField(default=True)
>
> > > # the traceback when I run the test
> > > ==
> > > ERROR: shows_an_active_to_go_page
> > (danielbaeder.gear.tests.ToGoPageViewTest)
> > > --
> > > Traceback (most recent call last):
> > >    File
>
> > "/home/diogo/sites/projetos/danielbaeder/danielbaeder/../danielbaeder/gear/
> > tests.py",
> > > line 140, in shows_an_active_to_go_page
> > >      active=True
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /manager.py",
> > > line 138, in create
> > >      return self.get_query_set().create(**kwargs)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /query.py",
> > > line 360, in create
> > >      obj.save(force_insert=True, using=self.db)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /base.py",
> > > line 460, in save
> > >      self.save_base(using=using, force_insert=force_insert,
> > > force_update=force_update)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /base.py",
> > > line 553, in save_base
> > >      result = manager._insert(values, return_id=update_pk, using=using)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /manager.py",
> > > line 195, in _insert
> > >      return insert_query(self.model, values, **kwargs)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /query.py",
> > > line 1436, in insert_query
> > >      return query.get_compiler(using=using).execute_sql(return_id)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /sql/compiler.py",
> > > line 791, in execute_sql
> > >      cursor = super(SQLInsertCompiler, self).execute_sql(None)
> > >    File
>
> > "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> > /sql/compiler.py",
> > > line 735, in execute_sql
> > >      cursor.execute(sql, params)

How to aggreate in html django

2011-03-07 Thread sushanth Reddy
Hi ,

I want to make total at the end of the each row,i have explained the details 
in below
link.

http://stackoverflow.com/questions/5223093/how-to-aggreate-in-html-django

Can you please help me 

Thanks in advance

sushanth

-- 
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: Caching and Vary: Cookie header

2011-03-07 Thread Tom Evans
On Mon, Mar 7, 2011 at 4:23 PM, Thanos Diacakis  wrote:
> I have spent several hours researching this, and I'm stumped, so
> perhaps I could tap into some collective wisdom:
>
> I have a website whose page template includes a "Sign-In or Register"
> link at the top.   This is shown on pretty much every page.  If the
> user is already signed in, this is replaced with "Hello _username_ |
> My Account".  This is done by passing request.user to the template and
> checking is_authenticated().
>
> The problem is, that as soon as I touch request.user, the Vary: Cookie
> header is tagged on, and that destroys caching.  Every anonymous user
> gets their own version of the page cached, which is almost pointless.
>
> I'm trying to figure out a way that I can fully utilize the cache for
> anonymous users (i.e. one instance of the rendered page in the cache)
> and I'm OK for caching with Vary: Cookie for logged in users.
>
> So, is there a way to figure out if the user is logged in or not,
> without tripping the Vary: Cookie header, or is there a better way of
> doing this altogether?
>
> BTW, it seems that it is significantly faster (15x CPU time) to cache
> a whole view, that to cache a fragment, so I'd like to avoid that if
> possible.
>
> Thanks
>
> Thanos
>

If it is the same URL being visited by the anonymous users and the
authenticated users, then how is the upstream cache to determine which
version to send?

Or put it like this, you want to have anonymous users viewing the page
to not generate a 'Vary: cookie' header. This leads to the following
situation:

Anonymous user visits /contact-us/
Django generates the anonymous version of the page and delivers it,
with appropriate caching headers.
Upstream cache stores anonymous version in cache
Logged in user visits /contact-us/
Upstream cache intercepts the request, looks in its cache for an
appropriate hit, and delivers the anonymous page.

The basic thing here is that you cannot have your cake and eat it as
well. Either the page contains dynamic, user-specific content, in
which case vary on cookie, or it does not, in which case cache it.

If you want to deliver truly cache-able anonymous content, deliver it
on a different URL to your dynamic content.

Cheers

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: interface admin

2011-03-07 Thread vikalp sahni
check out.

django-admin-tools

https://bitbucket.org/izi/django-admin-tools/wiki/Home

it  might help you.

Regards,
//Vikalp

On Mon, Mar 7, 2011 at 6:44 PM, galbourn  wrote:

> I started in Django and I have a question.
> Is it possible to generate different admin interfaces that are
> accessible according to user profiles?
>
> What is the easiest solution to manage different interfaces according
> to user profiles?
>
> Thank you for your 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.
>
>

-- 
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 csv header and row format problem

2011-03-07 Thread sushanth Reddy
Hi,

I am trying to create csv download ,but results download gives me in 
different format

below is the link which gives the details of the problem 
http://stackoverflow.com/questions/5222841/django-csv-header-and-row-format-problem

-- 
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: "DatabaseError: no such table:" in tests

2011-03-07 Thread Joel Goldstick
On Mon, Mar 7, 2011 at 12:17 PM, diogobaeder  wrote:

> Alright, I printed all the tables to the stdout, while in the test,
> and the table was not created before running the test. Am I missing
> something here? Just creating the model and associating the app in
> INSTALLED_APPS isn't enough?
>
> Also, there's another model in the same "models.py" module, and it's
> being loaded by the tests... is there any chance it's interfering in
> the other model? Here it is:
>
> # gear/models.py
>
> class DrumPiece(models.Model):
>CATEGORY_CHOICES = (
>('cymbals', 'Cymbals'),
>('drums', 'Drums'),
>('sticks', 'Sticks'),
>('heads-and-muffling', 'Heads and Muffling'),
>('microphones', 'Microphones'),
>('percussion', 'Percussion'),
>('cases', 'Cases'),
>('m-audio', 'M-Audio'),
>)
>title = models.CharField(max_length=200)
>description = models.TextField()
>category = models.CharField(max_length=20,
> choices=CATEGORY_CHOICES)
>image = ImageField(upload_to=env.get('files_uploads'))
>sites = models.ManyToManyField(Site, blank=True, null=True)
>
>def __unicode__(self):
>return self.title
>
>def save(self, *args, **kwargs):
>choices = [choice[0] for choice in self.CATEGORY_CHOICES]
>if self.category is not None and self.category not in choices:
>self.category = self.CATEGORY_CHOICES[0][0]
>super(DrumPiece, self).save(*args, **kwargs)
>
>
> Thanks again!
>
> Diogo
>
>
>
> On Mar 7, 1:41 pm, Diogo Baeder  wrote:
> > Hi there,
> >
> > I'm having this weird error, where Django is failing while trying to run
> > one of my integration tests, saying that it couldn't find the necessary
> > table to create the model instance I want.
> >
> > Here are the relevant parts of my code, an I'm running the tests in
> > SQLite in memory:
> >
> > # gear/tests.py
> > from gear.models import ToGoPage
> > #...
> > class ToGoPageViewTest(TestCase):
> >  @istest
> >  def shows_an_active_to_go_page(self):
> >  to_go_page = ToGoPage.objects.create(
> >  content='Some content',
> >  active=True
> >  )
> >
> >  response =
> > self.client.get('/do-you-want-daniel-playing-in-your-cd/')
> >
> >  self.assertContains(response, 'Some content')
> >
> > # gear/models.py
> > class ToGoPage(models.Model):
> >  content = models.TextField()
> >  active = models.BooleanField(default=True)
> >
> > # the traceback when I run the test
> > ==
> > ERROR: shows_an_active_to_go_page
> (danielbaeder.gear.tests.ToGoPageViewTest)
> > --
> > Traceback (most recent call last):
> >File
> >
> "/home/diogo/sites/projetos/danielbaeder/danielbaeder/../danielbaeder/gear/
> tests.py",
> > line 140, in shows_an_active_to_go_page
> >  active=True
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /manager.py",
> > line 138, in create
> >  return self.get_query_set().create(**kwargs)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /query.py",
> > line 360, in create
> >  obj.save(force_insert=True, using=self.db)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /base.py",
> > line 460, in save
> >  self.save_base(using=using, force_insert=force_insert,
> > force_update=force_update)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /base.py",
> > line 553, in save_base
> >  result = manager._insert(values, return_id=update_pk, using=using)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /manager.py",
> > line 195, in _insert
> >  return insert_query(self.model, values, **kwargs)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /query.py",
> > line 1436, in insert_query
> >  return query.get_compiler(using=using).execute_sql(return_id)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /sql/compiler.py",
> > line 791, in execute_sql
> >  cursor = super(SQLInsertCompiler, self).execute_sql(None)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models
> /sql/compiler.py",
> > line 735, in execute_sql
> >  cursor.execute(sql, params)
> >File
> >
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/backen
> ds/sqlite3/base.py",
> > line 234, in execute
> >  return Database.Cursor.execute(self, query, params)
> > DatabaseError: no such table: gear_togopage
> >
> > Any ideas? Shouldn't Django be creating the table for me, among other
> > tables, since I'm running the test suite?
> 

Organization and User Mgmt

2011-03-07 Thread Venkatraman S
Are there elegant solutions for managing the Organization/Employees/Users in
a djanogo-App?
OR do i need to create an Organization model and map the 'users' as employee
and user and assign suitable permissions?

Any tried+tested approaches?

-V-

-- 
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: "DatabaseError: no such table:" in tests

2011-03-07 Thread diogobaeder
Alright, I printed all the tables to the stdout, while in the test,
and the table was not created before running the test. Am I missing
something here? Just creating the model and associating the app in
INSTALLED_APPS isn't enough?

Also, there's another model in the same "models.py" module, and it's
being loaded by the tests... is there any chance it's interfering in
the other model? Here it is:

# gear/models.py

class DrumPiece(models.Model):
CATEGORY_CHOICES = (
('cymbals', 'Cymbals'),
('drums', 'Drums'),
('sticks', 'Sticks'),
('heads-and-muffling', 'Heads and Muffling'),
('microphones', 'Microphones'),
('percussion', 'Percussion'),
('cases', 'Cases'),
('m-audio', 'M-Audio'),
)
title = models.CharField(max_length=200)
description = models.TextField()
category = models.CharField(max_length=20,
choices=CATEGORY_CHOICES)
image = ImageField(upload_to=env.get('files_uploads'))
sites = models.ManyToManyField(Site, blank=True, null=True)

def __unicode__(self):
return self.title

def save(self, *args, **kwargs):
choices = [choice[0] for choice in self.CATEGORY_CHOICES]
if self.category is not None and self.category not in choices:
self.category = self.CATEGORY_CHOICES[0][0]
super(DrumPiece, self).save(*args, **kwargs)


Thanks again!

Diogo



On Mar 7, 1:41 pm, Diogo Baeder  wrote:
> Hi there,
>
> I'm having this weird error, where Django is failing while trying to run
> one of my integration tests, saying that it couldn't find the necessary
> table to create the model instance I want.
>
> Here are the relevant parts of my code, an I'm running the tests in
> SQLite in memory:
>
> # gear/tests.py
> from gear.models import ToGoPage
> #...
> class ToGoPageViewTest(TestCase):
>      @istest
>      def shows_an_active_to_go_page(self):
>          to_go_page = ToGoPage.objects.create(
>              content='Some content',
>              active=True
>          )
>
>          response =
> self.client.get('/do-you-want-daniel-playing-in-your-cd/')
>
>          self.assertContains(response, 'Some content')
>
> # gear/models.py
> class ToGoPage(models.Model):
>      content = models.TextField()
>      active = models.BooleanField(default=True)
>
> # the traceback when I run the test
> ==
> ERROR: shows_an_active_to_go_page (danielbaeder.gear.tests.ToGoPageViewTest)
> --
> Traceback (most recent call last):
>    File
> "/home/diogo/sites/projetos/danielbaeder/danielbaeder/../danielbaeder/gear/ 
> tests.py",
> line 140, in shows_an_active_to_go_page
>      active=True
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /manager.py",
> line 138, in create
>      return self.get_query_set().create(**kwargs)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /query.py",
> line 360, in create
>      obj.save(force_insert=True, using=self.db)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /base.py",
> line 460, in save
>      self.save_base(using=using, force_insert=force_insert,
> force_update=force_update)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /base.py",
> line 553, in save_base
>      result = manager._insert(values, return_id=update_pk, using=using)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /manager.py",
> line 195, in _insert
>      return insert_query(self.model, values, **kwargs)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /query.py",
> line 1436, in insert_query
>      return query.get_compiler(using=using).execute_sql(return_id)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /sql/compiler.py",
> line 791, in execute_sql
>      cursor = super(SQLInsertCompiler, self).execute_sql(None)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models 
> /sql/compiler.py",
> line 735, in execute_sql
>      cursor.execute(sql, params)
>    File
> "/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/backen 
> ds/sqlite3/base.py",
> line 234, in execute
>      return Database.Cursor.execute(self, query, params)
> DatabaseError: no such table: gear_togopage
>
> Any ideas? Shouldn't Django be creating the table for me, among other
> tables, since I'm running the test suite?
>
> Thanks!
>
> --
> Diogo Baeder - desenvolvedor webhttp://diogobaeder.com.br

-- 
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 

which statements are right?

2011-03-07 Thread yongzhen zhang
Hi,
When i am doing some exercises, i found some questions are very to
understand, Could you tell me which sentiences are correct?
1. Models convert data from relational database form to objects and
vice versa.
2. Django model has to be written for a specific relation database
3. Foreignkey are used to refer to elements in the other databases

about the views:

4. they interpret user input contained in the HTTP requests
5. they create the user interface
6. they access the models

about the templates:

7. Templates can specify any HTTP Headers for the response

The last thing is that why  django has a mechanism to protects against
calling methods from template that have side effects is a good idea?

-- 
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.



Caching and Vary: Cookie header

2011-03-07 Thread Thanos Diacakis
I have spent several hours researching this, and I'm stumped, so
perhaps I could tap into some collective wisdom:

I have a website whose page template includes a "Sign-In or Register"
link at the top.   This is shown on pretty much every page.  If the
user is already signed in, this is replaced with "Hello _username_ |
My Account".  This is done by passing request.user to the template and
checking is_authenticated().

The problem is, that as soon as I touch request.user, the Vary: Cookie
header is tagged on, and that destroys caching.  Every anonymous user
gets their own version of the page cached, which is almost pointless.

I'm trying to figure out a way that I can fully utilize the cache for
anonymous users (i.e. one instance of the rendered page in the cache)
and I'm OK for caching with Vary: Cookie for logged in users.

So, is there a way to figure out if the user is logged in or not,
without tripping the Vary: Cookie header, or is there a better way of
doing this altogether?

BTW, it seems that it is significantly faster (15x CPU time) to cache
a whole view, that to cache a fragment, so I'd like to avoid that if
possible.

Thanks

Thanos

-- 
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: Weird behaviour in Django logging (Django 1.3 RC)

2011-03-07 Thread Edwin
Sorry I wasn't clear enough. Here's the stack trace:

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py" in get_response
  89. response = middleware_method(request)
File "/home/user/projects/django/../django/common/middleware.py" in
process_request
  27. return login(request, **defaults)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
decorators.py" in _wrapped_view
  93. response = view_func(request, *args,
**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
cache.py" in _wrapped_view_func
  79. response = view_func(request, *args, **kwargs)
File "/home/user/projects/django/../django/apps/django_extra_auth/
views.py" in login
  57. auth_login(request, form.get_user())
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/
__init__.py" in login
  85. user_logged_in.send(sender=user.__class__, request=request,
user=user)
File "/usr/local/lib/python2.6/dist-packages/django/dispatch/
dispatcher.py" in send
  172. response = receiver(signal=self, sender=sender,
**named)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/
models.py" in update_last_login
  50. user.save()
File "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py"
in save
  460. self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py"
in save_base
  570. created=(not record_exists), raw=raw,
using=using)
File "/usr/local/lib/python2.6/dist-packages/django/dispatch/
dispatcher.py" in send
  172. response = receiver(signal=self, sender=sender,
**named)
File "/home/user/projects/django/apps/history/audit.py" in
post_save_handler
  102. logging.log_to_db(logging.INFO, msg, log_type)
File "/home/user/projects/django/apps/history/__init__.py" in
log_to_db
  61. db_logger.log(level, msg, extra=extras)
File "/usr/lib/python2.6/logging/__init__.py" in log
  1119. self._log(level, msg, args, **kwargs)
File "/usr/lib/python2.6/logging/__init__.py" in _log
  1173. self.handle(record)
File "/usr/lib/python2.6/logging/__init__.py" in handle
  1183. self.callHandlers(record)
File "/usr/lib/python2.6/logging/__init__.py" in callHandlers
  1220. hdlr.handle(record)
File "/usr/lib/python2.6/logging/__init__.py" in handle
  679. self.emit(record)
File "/home/user/projects/django/apps/history/handlers.py" in emit
  11. timestamp = datetime.strptime(record.asctime,
settings.LOG_DATE_FORMAT)


Also, I have a wrapper to call db_logger, which you can see from the
stacktrace:
def log_to_db(self, level, msg, log_type, extra={}):
db_logger = logging.getLogger('db_logger')
extras = {
'category': log_type.category.name,
'sub_category': log_type.sub_category.name,
'type_id': log_type.type_id,
}
extras.update(extra)
db_logger.log(level, msg, extra=extras)


My DB Handler looks like this:

class DatabaseHandler(logging.Handler):
def emit(self, record):
user = getattr(record, 'user', None)
category = getattr(record, 'category', None)
sub_category = getattr(record, 'sub_category', None)
type_id = getattr(record, 'type_id', None)
timestamp = datetime.strptime(record.asctime,
settings.LOG_DATE_FORMAT)
from history.models import LogRecord
LogRecord.objects.create(timestamp=timestamp,
level=record.levelname,
category=category, sub_category=sub_category,
type_id=type_id,
message=record.message, user=user)


Thanks again.

On Mar 5, 10:59 pm, Russell Keith-Magee 
wrote:
> On Sat, Mar 5, 2011 at 10:41 AM, Edwin  wrote:
> > I'm getting a strange behaviour when setting up logging. Here's my
> > logging configuration:
>
> > LOGGING =
> > {
> >    'version': 1,
> >    'disable_existing_loggers': True,
> >    'formatters': {
> >        'admin_configuration': {
> >            'format': '%(asctime)s %(levelname)s %(category)s %
> > (sub_category)s %(type_id)s %(message)s',
> >            'datefmt': LOG_DATE_FORMAT,
> >        },
> >    },
> >    'handlers': {
> >        'admin_console': {
> >            'level':'DEBUG',
> >            'class':'logging.StreamHandler',
> >            'formatter': 'admin_configuration'
> >        },
> >        'db': {
> >            'level':'DEBUG',
> >            'class':'apps.history.handlers.DatabaseHandler',
> >            'formatter': 'admin_configuration'
> >        },
> >    },
> >    'loggers': {
> >        'db_logger': {
> >            'handlers': [ 'admin_console', 'db' ],
> >            'level': 'DEBUG',
> >            'propagate': False,
> >        },
> >    }
> > }
>
> > I then created a Database log handler and the 

"DatabaseError: no such table:" in tests

2011-03-07 Thread Diogo Baeder

Hi there,

I'm having this weird error, where Django is failing while trying to run 
one of my integration tests, saying that it couldn't find the necessary 
table to create the model instance I want.


Here are the relevant parts of my code, an I'm running the tests in 
SQLite in memory:




# gear/tests.py
from gear.models import ToGoPage
#...
class ToGoPageViewTest(TestCase):
@istest
def shows_an_active_to_go_page(self):
to_go_page = ToGoPage.objects.create(
content='Some content',
active=True
)

response = 
self.client.get('/do-you-want-daniel-playing-in-your-cd/')


self.assertContains(response, 'Some content')



# gear/models.py
class ToGoPage(models.Model):
content = models.TextField()
active = models.BooleanField(default=True)



# the traceback when I run the test
==
ERROR: shows_an_active_to_go_page (danielbaeder.gear.tests.ToGoPageViewTest)
--
Traceback (most recent call last):
  File 
"/home/diogo/sites/projetos/danielbaeder/danielbaeder/../danielbaeder/gear/tests.py", 
line 140, in shows_an_active_to_go_page

active=True
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/manager.py", 
line 138, in create

return self.get_query_set().create(**kwargs)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/query.py", 
line 360, in create

obj.save(force_insert=True, using=self.db)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/base.py", 
line 460, in save
self.save_base(using=using, force_insert=force_insert, 
force_update=force_update)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/base.py", 
line 553, in save_base

result = manager._insert(values, return_id=update_pk, using=using)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/manager.py", 
line 195, in _insert

return insert_query(self.model, values, **kwargs)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/query.py", 
line 1436, in insert_query

return query.get_compiler(using=using).execute_sql(return_id)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/sql/compiler.py", 
line 791, in execute_sql

cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/models/sql/compiler.py", 
line 735, in execute_sql

cursor.execute(sql, params)
  File 
"/home/diogo/Envs/danielbaeder/lib/python2.6/site-packages/django/db/backends/sqlite3/base.py", 
line 234, in execute

return Database.Cursor.execute(self, query, params)
DatabaseError: no such table: gear_togopage




Any ideas? Shouldn't Django be creating the table for me, among other 
tables, since I'm running the test suite?


Thanks!

--
Diogo Baeder - desenvolvedor web
http://diogobaeder.com.br

--
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.



signals and abstract base classes

2011-03-07 Thread Sneaky Wombat
Hey, wondering if i'm doing this wrong.  I'm using the new receiver
decorator in the 1.3 svn devel code..

In [2]: django.VERSION
Out[2]: (1, 3, 0, 'rc', 1)

If I leave sender out of the receiver decorator, it works fine, but I
can't get it to work with an abstract base class as the sender.  While
debugging, I noticed that foo would be the sender and I wouldn't ever
see abs (if I remember correctly) as the sender.  Is using an abs
outside of the scope of this decorator or am I going about it wrong?

class abs(models.Model):
abs_field1 = models.IntegerField()
abs_field2 = models.CharField(max_length=1)

class Meta:
abstract = True


@receiver(pre_save,sender=abs)
def pre_save(sender,instance,using,**kwargs):
# do stuff useful here
print sender


class foo(abs):
display = models.CharField(max_length=1)

-- 
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: Django-Celery: Rate Limit

2011-03-07 Thread Casey S. Greene

You might want to try these questions on the celery mailing list:
http://groups.google.com/group/celery-users

Hope this helps,
Casey

On 03/07/2011 09:58 AM, ju wrote:

Why when I use rate_limit even the first task and the first try is
waiting for some time before it's executed?

--
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: data model help?

2011-03-07 Thread Tim
On Mar 5, 12:39 pm, Michael Radziej  wrote:
> Hi Tim!
>
> On Sat, 5 Mar 2011 06:05:51 -0800 (PST), Tim  wrote:
> > For me that looks a little complex. The 'sequence' doesn't really
> > belong to the Chapter or the Book, but to their relationship. A
> > Chapter may have one sequence number when part of Book A, and another
> > for Book B.
>
> That's a classic example for a many-to-many relationship with additional
> data.
>
> class Book(models.Model):
>       (...)
>
> class Chapter(models.Model):
>       (...)
>       book = models.ManyToManyField(through="BookChapter")
>
> class BookChapter(models.Model):
>       (...)
>       sequence = models.IntegerField
>
> You can find more info about the `through` parameter at:
>
> http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.mod...
>
> Hope that helps,
>
> Michael

Hey Michael!
thanks for that info. That definitely helps--it's exactly the solution
I was looking for.
thanks!
--Tim

-- 
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-Celery: Rate Limit

2011-03-07 Thread ju
Why when I use rate_limit even the first task and the first try is waiting 
for some time before it's executed?

-- 
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-Celery: Task Retry and worker shut down

2011-03-07 Thread ju
What will happend if I shut down worker thread but the tasks is waiting for 
retry? Will I lose  the task and how to avoid that?

What is the correct way to stop django-celery worker in Windows?

-- 
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: celery tasks and circular imports

2011-03-07 Thread Brian Bouterse
I too "protect" code from being interpreted at import time by putting import
statements directly in the tasks that need them.  I don't think there is
anything wrong with this approach the from a Python perspective other than
possibly these:

* imports are parsed at runtime and thus an import occurs for each time the
code is run<=== performance problem
* import errors aren't discovered until runtime

I too am looking for a better way to do this.

Brian

On Mon, Mar 7, 2011 at 8:25 AM, Shawn Milochik  wrote:

> If there's a "correct" way to do this I'd love to hear it also.
>
> At present I do the model imports in tasks.py within the task that
> requires the model. This is because in my models.py I import tasks
> from tasks.py.
>
> Shawn
>
> --
> 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.
>
>


-- 
Brian Bouterse
ITng Services

-- 
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 based Project Management software

2011-03-07 Thread Anand Agarwal
Here is very simple & intuitive Web based Project Management Application
based on django. Also it has subversion hosting.

http://bit.ly/fazfqa

-Regards
Anand

-- 
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: celery tasks and circular imports

2011-03-07 Thread Shawn Milochik
If there's a "correct" way to do this I'd love to hear it also.

At present I do the model imports in tasks.py within the task that
requires the model. This is because in my models.py I import tasks
from tasks.py.

Shawn

-- 
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.



interface admin

2011-03-07 Thread galbourn
I started in Django and I have a question.
Is it possible to generate different admin interfaces that are
accessible according to user profiles?

What is the easiest solution to manage different interfaces according
to user profiles?

Thank you for your 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.



interface admin

2011-03-07 Thread galbourn
I started in Django and I have a question.
Is it possible to generate different admin interfaces that are
accessible according to user profiles?

What is the easiest solution to manage different interfaces according
to user profiles?

Thank you for your 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.



celery tasks and circular imports

2011-03-07 Thread cerberos
I have tasks.py that imports models to access the managers. I also
want to import a task in a custom save method of one of my models but
can't as this creates a circular import.

I'm happy to use signals instead hover I don't really know where to
register them apart from models.py (which would also create a circular
import).

Russel Keith Magee said "Django 1.3 will probably introduce a third
option -- a reliable place
to register signals" [1] however the release notes [2] don't make any
mention of this.

The best thing I can think of at the moment is adding the import in
the custom save method, this seems like it could be a common problem -
there must be a better solution?

[1]
http://groups.google.com/group/django-users/browse_thread/thread/39bd9c6c1c25aad2/6ea0ca4a21e72bde?lnk=gst=circular+import#6ea0ca4a21e72bde
[2] http://docs.djangoproject.com/en/dev/releases/1.3/

-- 
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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Gergely
Thanks a lot Tom!

Now I see that not the "REFERENCES" is missing but the "ALTER" at the
end of the script.
And of course the reason is clear, you are right.

I will test it with the latest django and sqlite and report the result
here.

Regards,
Gergely

On márc. 7, 13:33, Tom Evans  wrote:
> On Mon, Mar 7, 2011 at 12:04 PM, Tom Evans  wrote:
> > If so, then there is no difference in the SQL generated - why would there 
> > be?
>
> > Cheers
>
> > Tom
>
> Oh, I'm waay wrong:
>
> class Series(models.Model):
>   pass
> class Episode(models.Model):
>   series = models.ForeignKey('Series')
>
> =>
>
> BEGIN;
> CREATE TABLE "app_series" (
>     "id" serial NOT NULL PRIMARY KEY
> )
> ;
> CREATE TABLE "app_episode" (
>     "id" serial NOT NULL PRIMARY KEY,
>     "series_id" integer NOT NULL REFERENCES "app_series" ("id")
> DEFERRABLE INITIALLY DEFERRED
> )
> ;
> CREATE INDEX "app_episode_series_id" ON "app_episode" ("series_id");
> COMMIT;
>
> where as:
>
> class Episode(models.Model):
>   series = models.ForeignKey('Series')
> class Series(models.Model):
>   pass
>
> =>
>
> BEGIN;
> CREATE TABLE "app_episode" (
>     "id" serial NOT NULL PRIMARY KEY,
>     "series_id" integer NOT NULL
> )
> ;
> CREATE TABLE "app_series" (
>     "id" serial NOT NULL PRIMARY KEY
> )
> ;
> ALTER TABLE "app_episode" ADD CONSTRAINT "series_id_refs_id_61c5b6e4"
> FOREIGN KEY ("series_id") REFERENCES "app_series" ("id") DEFERRABLE
> INITIALLY DEFERRED;
> CREATE INDEX "app_episode_series_id" ON "app_episode" ("series_id");
> COMMIT;
>
> Django 1.2.5, using postgres_psycopg2 backend.
>
> I can understand why it does this. The table it references needs to
> exist before Django can create a reference to it. By declaring it in
> one order leads Django to assume that the table does not exist yet,
> and to defer the creation of the reference constraint pointing to it.
>
> To have both situations producing the same SQL would require Django to
> understand and re-order the table creation queries, and that isn't
> necessary or worthwhile - the order that the developer chose is used
> instead.
>
> Cheers
>
> 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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Tom Evans
On Mon, Mar 7, 2011 at 12:04 PM, Tom Evans  wrote:
> If so, then there is no difference in the SQL generated - why would there be?
>
> Cheers
>
> Tom
>

Oh, I'm waay wrong:

class Series(models.Model):
  pass
class Episode(models.Model):
  series = models.ForeignKey('Series')

=>


BEGIN;
CREATE TABLE "app_series" (
"id" serial NOT NULL PRIMARY KEY
)
;
CREATE TABLE "app_episode" (
"id" serial NOT NULL PRIMARY KEY,
"series_id" integer NOT NULL REFERENCES "app_series" ("id")
DEFERRABLE INITIALLY DEFERRED
)
;
CREATE INDEX "app_episode_series_id" ON "app_episode" ("series_id");
COMMIT;


where as:

class Episode(models.Model):
  series = models.ForeignKey('Series')
class Series(models.Model):
  pass


=>

BEGIN;
CREATE TABLE "app_episode" (
"id" serial NOT NULL PRIMARY KEY,
"series_id" integer NOT NULL
)
;
CREATE TABLE "app_series" (
"id" serial NOT NULL PRIMARY KEY
)
;
ALTER TABLE "app_episode" ADD CONSTRAINT "series_id_refs_id_61c5b6e4"
FOREIGN KEY ("series_id") REFERENCES "app_series" ("id") DEFERRABLE
INITIALLY DEFERRED;
CREATE INDEX "app_episode_series_id" ON "app_episode" ("series_id");
COMMIT;


Django 1.2.5, using postgres_psycopg2 backend.


I can understand why it does this. The table it references needs to
exist before Django can create a reference to it. By declaring it in
one order leads Django to assume that the table does not exist yet,
and to defer the creation of the reference constraint pointing to it.

To have both situations producing the same SQL would require Django to
understand and re-order the table creation queries, and that isn't
necessary or worthwhile - the order that the developer chose is used
instead.

Cheers

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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Tom Evans
On Mon, Mar 7, 2011 at 11:08 AM, Gergely  wrote:
> And if you change the order?
> If the foreign key references a model defined later?
>
> Gergely
>

Do you mean:

  class Episode(models.Model):
series = models.ForeignKey('Series')

  class Series(models.Model):
pass


instead of:

  class Series(models.Model):
pass

  class Episode(models.Model):
series = models.ForeignKey(Series)

?

If so, then there is no difference in the SQL generated - why would there be?

Cheers

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.



django and music archives

2011-03-07 Thread Kenneth Gonsalves
hi,

is anyone aware of any django project to do with managing an archive of
music and playing the same? All searches only show up the other musical
django ;-)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: Problem of installing haystack and thumbnail a python app

2011-03-07 Thread bayuadji
Hi,

looked from your staktrace it seems that python didn't found thumbnail and 
haystack library.

You could check by running sys.path from your django shell


-adji-
-Original Message-
From: yozloy 
Sender: django-users@googlegroups.com
Date: Sun, 6 Mar 2011 20:50:28 
To: 
Reply-To: django-users@googlegroups.com
Subject: Problem of installing haystack and thumbnail a python app

Hey guys
I'm new to Python, I want to install this python app called 
mirosubson my VPS, and I followed the 
installation guide in this github pages, when 
I got to the step 8: 

python manage.py syncdb

I got the following error:

root@makserver:/usr/local/src/mirosubs# python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 35, in 
execute_manager(settings)
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 438, in execute_manager
utility.execute()
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, 
name))
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/utils/importlib.py",
 
line 35, in import_module
__import__(name)
  File 
"/usr/local/lib/python2.6/dist-packages/South-0.7.3-py2.6.egg/south/management/commands/__init__.py",
 
line 10, in 
import django.template.loaders.app_directories
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/template/loaders/app_directories.py",
 
line 23, in 
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError haystack: 
cannot import name Thumbnail

Anybody can tell me how to solve this problem?

-- 
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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Michal Petrucha
> And if you change the order?
> If the foreign key references a model defined later?
Correct me if I'm wrong, but you can't do that -- python will
complain.

I can't find a better reference off the bat than
http://docs.djangoproject.com/en/1.2/ref/django-admin/#inspectdb
It says that you have to rearrange your model definitions so that they
reference existing ones. If you try to reference a model defined
later, you'll get errors while importing the models.py file.

Michal Petrucha


signature.asc
Description: Digital signature


TemplateDoesNotExist Help

2011-03-07 Thread ptr21
Hi guys,

I'm starting to learn how use Python as part of my class project. I
decided to use the Django framework w/ Eclipse and I've completely
stuck on an seemingly common error. Here are some snippets of the
code:

views.py

from django.template.loader import get_template
from django.template import Context
from django.http import HttpResponse
import datetime

def current_datetime(request):
now = datetime.datetime.now()
t = get_template('current_datetime.html')
html = t.render(Context({'current_date': now}))
return HttpResponse(html)

urls
---
urlpatterns = patterns('',
('^date/$', current_datetime)

)
settings.py
-
TEMPLATE_DIRS = [
 'G:/'
]


ERROR
--
Request Method: GET
Request URL:http://127.0.0.1:8000/date/
Django Version: 1.2.5
Exception Type: TemplateDoesNotExist
Exception Value:current_date.html

Django tried loading these templates, in this order:

Using loader django.template.loaders.filesystem.Loader:
G:/current_date.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
c:\python27\lib\site-packages\django\contrib\sitemaps\templates
\current_date.html (File does not exist)
c:\python27\lib\site-packages\django\contrib\admin\templates
\current_date.html (File does not exist)


I even put my current_date html in the other 2 folders above. I'm
definitely 100% clear that I have current_date.html in my G:/
directory. Before I had created a template folder within the project
directory (using the full directory path) and tried to reference it
there but failed also. Thanks.

-- 
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.



Problem of installing haystack and thumbnail a python app

2011-03-07 Thread yozloy
Hey guys
I'm new to Python, I want to install this python app called 
mirosubson my VPS, and I followed the 
installation guide in this github pages, when 
I got to the step 8: 

python manage.py syncdb

I got the following error:

root@makserver:/usr/local/src/mirosubs# python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 35, in 
execute_manager(settings)
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 438, in execute_manager
utility.execute()
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/core/management/__init__.py",
 
line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, 
name))
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/utils/importlib.py",
 
line 35, in import_module
__import__(name)
  File 
"/usr/local/lib/python2.6/dist-packages/South-0.7.3-py2.6.egg/south/management/commands/__init__.py",
 
line 10, in 
import django.template.loaders.app_directories
  File 
"/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/template/loaders/app_directories.py",
 
line 23, in 
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError haystack: 
cannot import name Thumbnail

Anybody can tell me how to solve this problem?

-- 
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.



Bug in Django admin?

2011-03-07 Thread Martin Tiršel

Hello,

I have such model:

class BoolTest(models.Model):
NO = False
YES = True
YES_NO_CHOICES = (
(NO, 'no'),
(YES, 'yes')
)
name = models.CharField(
max_length=30
)
completed = models.BooleanField(
default=NO,
choices=YES_NO_CHOICES
)


and admin definition:

class BoolTestAdmin(admin.ModelAdmin):
list_filter = ('completed',)
list_display = ('name', 'completed')

admin.site.register(BoolTest, BoolTestAdmin)

When I use filter in Django admin (that produces URL  
.../admin/appname/booltest/?completed__exact=False), I get results which  
are with completed=True. This is the SQL query generated by Django admin:


SELECT `appname_booltest`.`id`, `appname_booltest`.`name`,  
`appname_booltest`.`completed` FROM `appname_booltest` WHERE  
`appname_booltest`.`completed` = 1  ORDER BY `appname_booltest`.`id` DESC


But when I do:


bt = BoolTest.objects.filter(completed__exact=False)


Then everything is ok:

SELECT `appname_booltest`.`id`, `appname_booltest`.`name`,  
`appname_booltest`.`completed` FROM `appname_booltest` WHERE  
`appname_booltest`.`completed` = 0  LIMIT 21


Is it a bug or I did something wrong?

Thanks,
Martin

--
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: Payment Gateways

2011-03-07 Thread Kenneth Gonsalves
On Mon, 2011-03-07 at 06:03 -0500, CLIFFORD ILKAY wrote:
> You can use whatever you like as long as it has an API and 
> documentation. We've used SecurePay (an Australian one),
> InternetSecure, 
> BeanStream, Authorize.net, and others that I can't remember right
> now. 
> They all have their pros and cons. A quick checklist of what to look
> for: 

for India I have found Ccavenue a good bet - they only have php and java
interfaces, but there is an open source python interface which works
with django.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Gergely
And if you change the order?
If the foreign key references a model defined later?

Gergely

On márc. 7, 11:40, Tom Evans  wrote:
> On Mon, Mar 7, 2011 at 10:04 AM, Gergely  wrote:
> > Ok, lets concentrate 1 question at a time.
>
> > If you define the referenced model later and use "lazy" relationship
> > in the foreign key field (with the name of the model instead of the
> > model itself) than in the generated sql you will not find the
> > "REFERENCES" part of the foreign key definition.
> > DB engine: sqlite. Django version: 1.2.4
>
> > Example:
>
> > Model:
> > class Book(models.Model):
> > publisher = models.ForeignKey("Publisher")
>
> > class Publisher(models.Model):
>
> > Generated sql:
> > CREATE TABLE "books_book" (
> >  "id" integer NOT NULL PRIMARY KEY,
> >  "publisher_id" integer NOT NULL,
> >  )
>
> > Best regards,
> > Gergely
>
> Use a better SQL engine. This is Django 1.2.5 + postgresql:
>
> class Series(models.Model):
>   pass
>
> class Episode(models.Model):
>   series = models.ForeignKey('Series',)
>
> CREATE TABLE "media_episode" (
>     "id" serial NOT NULL PRIMARY KEY,
>     "series_id" integer NOT NULL REFERENCES "media_series" ("id")
> DEFERRABLE INITIALLY DEFERRED
> )
>
> Cheers
>
> 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: Payment Gateways

2011-03-07 Thread CLIFFORD ILKAY

On 03/07/2011 05:01 AM, Venkatraman S wrote:

Hi,

Would like to know which payment gateways do people use for managing
money movements in their sites?
I wouldnt like to go the Paypal way, any other suggestions?


Hi,

You can use whatever you like as long as it has an API and 
documentation. We've used SecurePay (an Australian one), InternetSecure, 
BeanStream, Authorize.net, and others that I can't remember right now. 
They all have their pros and cons. A quick checklist of what to look for:


* API

* Documentation - very important

* Test environment, a.k.a. sandbox - very important. Some have great 
restrictions on what you can do in that environment so pay attention to 
the details.


* Which currencies will they process?

* Which credit cards and which other payment methods will they accept?

* Fees - the pricing is all over the place and like anything, volume 
will get you discounts.

--
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6


+1 416-410-3326

--
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: Ordering of querysets

2011-03-07 Thread Tom Evans
On Fri, Mar 4, 2011 at 8:40 PM, Sidney Cadot  wrote:
> Hi Tom,
>
>> Unless I'm being dense, you cannot represent this as a single SQL
>> query, so logically you cannot represent this as a QuerySet.
>
> It is possible by using a nested query, e.g.
>
> SELECT * FROM (SELECT * FROM some_table ORDER BY timestamp DESC LIMIT 10)
> ORDER BY timestamp ASC;

MySQL at least will barf on an limited subquery:

This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

I'm not sure what versions do, if any.

>
> But I suppose QuerySets are designed to map onto a single, non-nested query
> (I don't know the innards of Django I'm afraid) so such a construct would be
> out of reach.
> An alternative would be to augment querysets such that it would be possible
> to iterate over them in reverse order.
>

QuerySets aren't designed that way at all, most filter arguments that
take a list will also take a queryset, and the new composed queryset
will have a sub-query.

Eg:

UsageLogEntry.objects.filter(
id__in=UsageLogEntry.objects.all().order_by('-time')[:10]
  ).order_by('time')

would be perfectly valid as far as Django is concerned, but unstable
and non-portable from a DB perspective (MySQL won't allow that).

Reverse iterators over a queryset would be great, but would require
either caching on the queryset result (in which case, you're back to
"It's trivial in python") or reverse iterator support for the database
API, which again, don't exist.


Cheers

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: another foreignkey question

2011-03-07 Thread het.oosten
Just after I posted my question i found the solution:

In the view: content = Frontpage.objects.all()

In the template;


{% for x in content %}
Tekst:  {{x.text}}
{% for y in x.frontpageimages_set.all %}
alt: {{ y.image }}
{% endfor %}
{% endfor %}

(just in case anybody runs into the same problem)

-- 
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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Tom Evans
On Mon, Mar 7, 2011 at 10:04 AM, Gergely  wrote:
> Ok, lets concentrate 1 question at a time.
>
> If you define the referenced model later and use "lazy" relationship
> in the foreign key field (with the name of the model instead of the
> model itself) than in the generated sql you will not find the
> "REFERENCES" part of the foreign key definition.
> DB engine: sqlite. Django version: 1.2.4
>
> Example:
>
> Model:
> class Book(models.Model):
> publisher = models.ForeignKey("Publisher")
>
> class Publisher(models.Model):
>
> Generated sql:
> CREATE TABLE "books_book" (
>  "id" integer NOT NULL PRIMARY KEY,
>  "publisher_id" integer NOT NULL,
>  )
>
> Best regards,
> Gergely
>

Use a better SQL engine. This is Django 1.2.5 + postgresql:

class Series(models.Model):
  pass

class Episode(models.Model):
  series = models.ForeignKey('Series',)


CREATE TABLE "media_episode" (
"id" serial NOT NULL PRIMARY KEY,
"series_id" integer NOT NULL REFERENCES "media_series" ("id")
DEFERRABLE INITIALLY DEFERRED
)

Cheers

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.



another foreignkey question

2011-03-07 Thread het.oosten
I have two models:

class Frontpage(models.Model):
title = models.CharField(max_length=200)
text = models.TextField()
def __unicode__(self):
return self.title
class Meta:
verbose_name_plural = "Frontpage"

class FrontpageImages(models.Model):
title = models.CharField(max_length=200)
alt = models.CharField(max_length=200)
image = models.ImageField(upload_to='upload/%Y/%m/%d')
page = models.ForeignKey(Frontpage)
def __unicode__(self):
return self.title

I will have one page with 4 blocks in it. In every block i want to
show the text from the frontpage model, and all his related images.
Like:

Block1:
Block2:etc.
text text
   - image1  -image4
   - image2  -image5
   - image3  -image6

I cannot fetch all object from Frontpage and access frontpageimages
using _set

I could solve it by making 4 queries for id 1 till 4 but that would be
a bit overkill. What is the right way to use this data in my template?

Regards,

Rob

-- 
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: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-07 Thread Gergely
Ok, lets concentrate 1 question at a time.

If you define the referenced model later and use "lazy" relationship
in the foreign key field (with the name of the model instead of the
model itself) than in the generated sql you will not find the
"REFERENCES" part of the foreign key definition.
DB engine: sqlite. Django version: 1.2.4

Example:

Model:
class Book(models.Model):
publisher = models.ForeignKey("Publisher")

class Publisher(models.Model):

Generated sql:
CREATE TABLE "books_book" (
  "id" integer NOT NULL PRIMARY KEY,
  "publisher_id" integer NOT NULL,
 )

Best regards,
Gergely

On márc. 6, 23:29, Ramiro Morales  wrote:
> On Sun, Mar 6, 2011 at 6:57 PM, Gergely  wrote:
> > Hello,
> > I'm trying to find an answer to an old question that is why I'm
> > forwarding this old message.
> > I tried to find the documentation of this change but couldn't.
> > Could you please help me?
> > I would like to find out:
> >  - why is only one foreign key generated in the intermediary join
> > table?
> >  - can I influence the sql generation to have both foreign keys
> > (without specifying my own join table) ?
>
> You don't show us you models and the generated SQL so
> I doubt anybody can help you here, please also include the
> information requested below for your second question.
>
>
>
>
>
>
>
>
>
>
>
> > There is a similar behaviour at simple foreign keys:
> > If you define the referenced model later and use "lazy" relationship
> > in the foreign key field (with the name of the model instead of the
> > model itself) than in the generated sql you will not find the
> > "REFERENCES" part of the foreign key definition.
> > Example:
>
> > Model:
> > class Book(models.Model):
> >    publisher = models.ForeignKey("Publisher")
>
> > class Publisher(models.Model):
>
> > Generated sql:
> > CREATE TABLE "books_book" (
> >    "id" integer NOT NULL PRIMARY KEY,
> >    "publisher_id" integer NOT NULL,
> > )
>
> What database engine are you using? What version of Django?
>
> --
> Ramiro Morales

-- 
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.



Payment Gateways

2011-03-07 Thread Venkatraman S
Hi,

Would like to know which payment gateways do people use for managing money
movements in their sites?
I wouldnt like to go the Paypal way, any other suggestions?

-V-

-- 
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.