Re: os.listdir() not returning unicode

2011-11-20 Thread Calvin Spealman
You may get more appropriate responses on the python-list mailing list, as this is not really a django question, but a python one. http://mail.python.org/mailman/listinfo/python-list On Sun, Nov 20, 2011 at 12:57 PM, Marc wrote: > Hello, > > I have an application that uses

Re: How to solve the instancemethod TypeError

2011-10-16 Thread Calvin Spealman
On Sun, Oct 16, 2011 at 6:07 AM, Tsung-Hsien wrote: > I have a photo page needed connecting each photo to different URL. > > -- > The URL as below: > url(r'^gallery/(?P\d+)/(?P\d+)/$', zoom_photo) > > The view as

Re: Easy question (I hope)

2011-10-07 Thread Calvin Spealman
On Fri, Oct 7, 2011 at 10:39 AM, bcrem wrote: > Howdy, > > I come from a C/C++ background, getting into some django/python now. > I'm used to a one-class/one-file paradigm, and don't much like > sticking all the models for an app in models.py.  It's a minor thing, > I know...

Re: Streamlining DJango Deployment — Novel idea from the world of CMSs

2011-09-07 Thread Calvin Spealman
Can you explain to those of us to whom it is not obvious, what is the point of this proposal? I don't understand what problem it would solve. On Wed, Sep 7, 2011 at 10:41 AM, Alec Taylor wrote: > Good morning, > > I have just recently starting migrating over from

Re: middleware

2011-07-14 Thread Calvin Spealman
You should use Django Debug Toolbar. It can handle this sort of thing, and many other things, for you. On Thu, Jul 14, 2011 at 1:34 AM, NISA BALAKRISHNAN wrote: > how to write a middleware that that stores all database requests. > How can i store all database

Re: delete unnecessarily fields =D

2011-07-07 Thread Calvin Spealman
It deleting "the language files that do not use" will save you any significant portion of your storage quota, then you seriously need a new hosting provider. On Thu, Jul 7, 2011 at 4:18 AM, Kase wrote: > I need to lower the amount of files on my server becouse is a shared >

Re: ANN: django-kolibri - a concept for Asynchronous Processors/Workflow management for django.

2011-06-21 Thread Calvin Spealman
Interesting project. My first question was going to be "Why aren't you just using Celery?" until I got to the part of the description that says it is built on *top* of celery. The first question that comes up for me is how or if you track which processes have already been run, to keep them from

Re: where is 'request' as in from x import y

2011-05-26 Thread Calvin Spealman
The request object is passed to the views in your views.py you have mapped to in your urls.py Do you understand the layout of a basic django project? A python module is not executed to handle a request, but is imported at the startup of the process and your view functions are called depending on

Re: unit testing and file location

2011-05-11 Thread Calvin Spealman
You can run your tests with their own --settings parameter with the specific variations you want to test under. On May 10, 2011 5:21 PM, "Brian Craft" wrote: I would like unit tests that do file manipulations to run with a different storage "location", so they're not

Re: Unable to access Dictionary values in Template (object pk is the dict key)

2011-05-04 Thread Calvin Spealman
You need to construct your query in the view function to filter for the comments you want. You can't do these sorts of things from the template, and that is largely by design so that you keep your logic in one place: your views, and your presentation in one place: your template. On Wed, May 4,

Re: Resolve function ?

2011-05-01 Thread Calvin Spealman
On Sun, May 1, 2011 at 1:34 PM, doniyor wrote: > hi There, > > i am novice in django so i need your help, i read books but if i talk > to you guys, may be i get it faster than reading books. > > so, what doesnot give me peace is that i dont understand the function >

Re: Using the same block in a django template to display different information depending on a variable

2011-04-04 Thread Calvin Spealman
Just put the condition inside the block. On Mon, Apr 4, 2011 at 7:34 PM, Ethan Yandow wrote: > Hey Mr. Django! I am trying to have different information display in > the same block depending on a variable "choice" which is simply an > int. The way I was planning on doing so

Re: WxPython and django

2011-03-31 Thread Calvin Spealman
t; Calvin, > > The database as well as the django app sits on a server > (internal--this is not meant for public access by the general public). > To access the app users would have to login to the server through http > and run the app from there. > > On 3/31/11, Calvin Spealman <iro

Re: WxPython and django

2011-03-31 Thread Calvin Spealman
to wxpython > module to display and take data from a form rendered with wxpython and send > to django. This must doable I think. > > On Wed, Mar 30, 2011 at 8:24 PM, Calvin Spealman <ironfro...@gmail.com> > wrote: >> >> They are completely unrelated. WX is a

Re: Force an ajax window to close

2011-03-30 Thread Calvin Spealman
You could add a header to the HTTP response that the JS on the clientside can see and interpret as "OK, this is ready to close now." I have done something similar to cause ajax-submitted forms to cause a redirect in the containing page. On Wed, Mar 30, 2011 at 10:24 PM, Mike Ramirez

Re: Is Django "leaking memory"?

2011-03-30 Thread Calvin Spealman
Python itself allocates memory in large chunks and can't release them until all objects in them have been garbage collected. Older versions of CPython didn't even release this chunks at all. On Wed, Mar 30, 2011 at 9:48 PM, dlamotte wrote: > I've documented what is going on

Re: WxPython and django

2011-03-30 Thread Calvin Spealman
They are completely unrelated. WX is a library for working with desktop-based UI toolkits, and Django is a framework for producing and delivering HTML/CSS/JS web content to a browser. On Wed, Mar 30, 2011 at 10:03 PM, Aref wrote: > Hello, > > I have created a small app

Re: check for existence in bulk

2011-03-30 Thread Calvin Spealman
I think your best bet is MyModel.objects.filter(some_field__in=ok_values).count() == len(ok_values) On Wed, Mar 30, 2011 at 12:44 PM, dmitry b wrote: > Hi, > > is there a way to check in bulk for record existence and get back a > map of results similar to what's returned

Re: subclassing User: can't log in, can't change password

2011-03-27 Thread Calvin Spealman
Do not subclass the User model. Create a profile model and register that with the auth app, which is how the authentication documentation tells you to go about this. http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users On Sun, Mar 27, 2011 at 10:54 AM,

Re: extend User Model for custom fields

2011-03-25 Thread Calvin Spealman
The auth app includes support to use a profile model, configured with AUTH_PROFILE_MODULE in settings, which the docs show you how to use. Yes you can use inheritance, but you might assume it is a good idea to use what the auth app promotes. On Fri, Mar 25, 2011 at 9:04 AM, Antonio Sánchez

Re: Error on django program with django-socialregistration....

2011-03-21 Thread Calvin Spealman
Do you possibly have a module or package in your project named "facebook"? One of the requirements for django-socialauth is the facebook python library, but if you have another module by the same name, that could be imported instead. On Mon, Mar 21, 2011 at 4:23 AM, Nge Nge

Re: How should I solve?

2011-03-20 Thread Calvin Spealman
How did you acquire and install socialauth? Looks like you are forgetting to quote a view name in your urls.py On Mar 20, 2011 10:55 AM, "Nge Nge" wrote: Hi everyone ! I am trying to connect facebook from django web page with login and registartion. I already try with

Re: Defining global names

2011-03-18 Thread Calvin Spealman
If it doesn't change, you can put it in the settings. On Mar 18, 2011 9:30 AM, "hank23" wrote: If I want to define a global variable that can be accessible by all of my views can I just define it at or near the top of my views.py and and also outside of any defined view?

Re: How can I create Django web page to connect Facebook login and registration?

2011-03-17 Thread Calvin Spealman
Nge, You should check out the excellent django-socialauth project, which can provide all the hookup you need to authenticate via Facebook (or twitter, linkedin, and others). Here is a good article to get started:

Session cache backend or cache API failure

2009-10-02 Thread Calvin Spealman
I've spent all day diagnosing this with no success. I would get random errors in logs with the traceback below, showing a failure to create a new session. Memcache logs show all 1 tries succeeding (I have also confirmed the empty sessions are still held in cache after). From what I can see,