Re: why does if statement fail with

2010-01-07 Thread Russell Keith-Magee
On Fri, Jan 8, 2010 at 2:13 PM, neridaj wrote: > Yeah, I guess an error would help, oops. I just get 'if' statement > improperly formatted. This is the only if statement that has failed. http://www.chiark.greenend.org.uk/~sgtatham/bugs.html We need *all* the details, not just the select few that

Re: why does if statement fail with

2010-01-07 Thread neridaj
Yeah, I guess an error would help, oops. I just get 'if' statement improperly formatted. This is the only if statement that has failed. On Jan 7, 9:13 pm, Russell Keith-Magee wrote: > On Fri, Jan 8, 2010 at 1:10 PM, neridaj wrote: > > I'm using 1.2: > > django.VERSION > > (1, 2, 0, 'alpha',

Re: Error in importing user in the interactive console

2010-01-07 Thread sridharpandu
James As suggested by you "User" works. Not "user" as typed by me. Thanks Best regards Sridhar On Jan 8, 10:52 am, James Bennett wrote: > On Thu, Jan 7, 2010 at 11:50 PM, sridharpandu wrote: > > Couldn't understand your post. Pls eloborate > > You say you typed: > > >>> from django.ontrib.au

Re: Error in importing user in the interactive console

2010-01-07 Thread sridharpandu
James I copied the text from the console and pasted in the browser for some funny reason the 'c' doesn't appear. But I did type 'contrib' and not 'ontrib' Best regards Sridhar Pandurangiah On Jan 8, 10:52 am, James Bennett wrote: > On Thu, Jan 7, 2010 at 11:50 PM, sridharpandu wrote: > > Coul

Re: Error in importing user in the interactive console

2010-01-07 Thread James Bennett
On Thu, Jan 7, 2010 at 11:50 PM, sridharpandu wrote: > Couldn't understand your post. Pls eloborate You say you typed: >>> from django.ontrib.auth.models import user This is incorrect. There is no such thing as "django.ontrib.auth.models". There *is* such a thing as "django.contrib.auth.models"

Re: Error in importing user in the interactive console

2010-01-07 Thread sridharpandu
Kenneth Couldn't understand your post. Pls eloborate Best regards Sridhar On Jan 8, 10:39 am, Kenneth Gonsalves wrote: > On Friday 08 Jan 2010 11:10:12 am sridharpandu wrote:> from > django.ontrib.auth.models import user > > s/ontrib/contrib/  and User > -- > regards > Kenneth Gonsalves > Sen

Re: apache serving static files

2010-01-07 Thread Mike Dewhirst
On 8/01/2010 2:13am, Stephen Emslie wrote: Looks like the regular expression of the AliasMatch excludes any '/' characters in the pattern, so is only going to match the last part of the path. Or roughly equivalent to doing path.split('/')[-1]. does the following work? AliasMatch /(.*\.js) /

Re: Error in importing user in the interactive console

2010-01-07 Thread Kenneth Gonsalves
On Friday 08 Jan 2010 11:10:12 am sridharpandu wrote: > from django.ontrib.auth.models import user > s/ontrib/contrib/ and User -- regards Kenneth Gonsalves Senior Project Officer NRC-FOSS http://nrcfosshelpline.in/web/ -- You received this message because you are subscribed to the Google Group

Error in importing user in the interactive console

2010-01-07 Thread sridharpandu
I started the console by typing python manage.py shell then gave the following command from django.ontrib.auth.models import user I get the following error Traceback (most recent call last): File "", line 1, in ImportError: cannot import name user Any ideas what could be wrong. Best regar

Re: why does if statement fail with

2010-01-07 Thread Russell Keith-Magee
On Fri, Jan 8, 2010 at 1:10 PM, neridaj wrote: > I'm using 1.2: > django.VERSION > (1, 2, 0, 'alpha', 0) In which case you're going to need to give us some debug information. "It doesn't work" isn't especially helpful. Django has a very healthy test suite, if comparisons are covered by that

Re: why does if statement fail with

2010-01-07 Thread Eric Abrahamsen
On Jan 8, 2010, at 12:54 PM, Russell Keith-Magee wrote: On Fri, Jan 8, 2010 at 12:50 PM, Eric Abrahamsen wrote: On Jan 8, 2010, at 12:28 PM, neridaj wrote: Can anyone tell me why this less than symbol is causing this if statement to fail? {% if page_obj.number|add:"4" < paginator.c

Re: why does if statement fail with

2010-01-07 Thread neridaj
I'm using 1.2: >>> django.VERSION (1, 2, 0, 'alpha', 0) On Jan 7, 8:54 pm, Russell Keith-Magee wrote: > On Fri, Jan 8, 2010 at 12:50 PM, Eric Abrahamsen wrote: > > > On Jan 8, 2010, at 12:28 PM, neridaj wrote: > > >> Can anyone tell me why this less than symbol is causing this if > >> statemen

Re: why does if statement fail with

2010-01-07 Thread Russell Keith-Magee
On Fri, Jan 8, 2010 at 12:50 PM, Eric Abrahamsen wrote: > > On Jan 8, 2010, at 12:28 PM, neridaj wrote: > >> Can anyone tell me why this less than symbol is causing this if >> statement to fail? >> >>       {% if page_obj.number|add:"4" < paginator.count %} >> >>       {% endif %} >> > > Because t

Re: why does if statement fail with

2010-01-07 Thread Eric Abrahamsen
On Jan 8, 2010, at 12:28 PM, neridaj wrote: Can anyone tell me why this less than symbol is causing this if statement to fail? {% if page_obj.number|add:"4" < paginator.count %} {% endif %} Because the if tag doesn't accept comparison operators. If you're trying to make a m

why does if statement fail with

2010-01-07 Thread neridaj
Can anyone tell me why this less than symbol is causing this if statement to fail? {% if page_obj.number|add:"4" < paginator.count %} {% endif %} Cheers, J -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

order for csrf middleware

2010-01-07 Thread Kenneth Gonsalves
hi some time back I had reported that csrf was not working for me on one site. I tried to replicate the error by making a simple minimal site with only two forms. But could not. I then noticed that the csrf middleware in settings.py which was generated by django was in the *3rd* position. Where

Re: strange behaviour of webfaction

2010-01-07 Thread Kenneth Gonsalves
On Friday 08 Jan 2010 7:37:33 am Mike Ramirez wrote: > > I have a client using webfaction. I had set up a django app there 3 years > > back. It runs on a particular version of django that I had set up. I have > > not had occasion to touch the code (or even ssh to the host) for more > > than 6 mont

Re: multi-db and ForeignKey

2010-01-07 Thread Russell Keith-Magee
On Fri, Jan 8, 2010 at 10:06 AM, Zbigniew Braniecki wrote: > On Jan 8, 1:33 am, Russell Keith-Magee wrote: > >> This is a known limitation, and there are plans to add this - or at >> least, to provide a workaround  - for 1.2 final. There have been some >> recent django-dev discussions if you want

Re: strange behaviour of webfaction

2010-01-07 Thread Mike Ramirez
On Thursday 07 January 2010 17:09:54 Kenneth Gonsalves wrote: > hi, > > I have a client using webfaction. I had set up a django app there 3 years > back. It runs on a particular version of django that I had set up. I have > not had occasion to touch the code (or even ssh to the host) for more tha

Re: multi-db and ForeignKey

2010-01-07 Thread Zbigniew Braniecki
On Jan 8, 1:33 am, Russell Keith-Magee wrote: > This is a known limitation, and there are plans to add this - or at > least, to provide a workaround  - for 1.2 final. There have been some > recent django-dev discussions if you want to see the state of our > thinking on the problem. The short vers

Re: 500 internal error when posting

2010-01-07 Thread Finity
I simply added that line as a comment, I would have course included this line, but the point was to show that execution never seems to hit that point. On another note, my 500 errors have gone as of now, sadly without any changes to the system. The problem is definitely outside of django (though c

strange behaviour of webfaction

2010-01-07 Thread Kenneth Gonsalves
hi, I have a client using webfaction. I had set up a django app there 3 years back. It runs on a particular version of django that I had set up. I have not had occasion to touch the code (or even ssh to the host) for more than 6 months now. On occasion my client gets 'nginx bad gateway' error.

Re: form.has_changed always true?

2010-01-07 Thread Karen Tracey
On Thu, Jan 7, 2010 at 7:14 PM, Alastair Campbell wrote: > > I've put the model form definition and the view up here: > http://dpaste.com/142308/ > > Any idea what I'm doing wrong? Perhaps something to do with loading > the form with data in the first place? > > You want to pass the instance para

Frontend Developer Wanted, Backend Experience a Huge Plus - Contract Work Immediately

2010-01-07 Thread sstartup
We are a start-up based out of New York looking for a developer with to finish off some existing work from our developer whose availability became limited. We are seeking a developer with the following skills: -XHTML/CSS -Javascript/Ajax -Django Templating Big Plus for Developers who have backen

Re: multi-db and ForeignKey

2010-01-07 Thread Russell Keith-Magee
On Fri, Jan 8, 2010 at 7:58 AM, Zbigniew Braniecki wrote: > I'm experimenting with multi-db and it fits perfectly some major > projects I'm working on. Man, I wish it was in django 1.1! :) Glad you're enjoying it :-) > Anyway, one issue I found that limits the scope of multi-db use is the > Fore

Re: Django Tutorial 1.1: Viewing SQLite3 tables

2010-01-07 Thread Justin Steward
On Fri, Jan 8, 2010 at 10:50 AM, wormser17 wrote: >        mlooby$ sqlite3 >        SQLite version 3.6.12 >        Enter ".help" for instructions >        Enter SQL statements terminated with a ";" >        sqlite> .schema >        sqlite> .schema; >        unknown command or invalid arguments:  "

Re: form.has_changed always true?

2010-01-07 Thread Alastair Campbell
Hi Margie, Thanks for the tip, when I do that, every filled-in field is returned as changed. I've put the model form definition and the view up here: http://dpaste.com/142308/ Any idea what I'm doing wrong? Perhaps something to do with loading the form with data in the first place? Kind regards

Re: Why there are so few open-source business applications in django?

2010-01-07 Thread Reinout van Rees
On 01/08/2010 12:26 AM, Ray wrote: On Jan 8, 9:35 am, Mohammad Tayseer wrote: I know that there are applications written in django for everything, but why there are so few open-source business application in django? I mean applications like warehouse management systems, HR systems, etc. The e

Aggregation question

2010-01-07 Thread VanL
I have a list of categorized posts, and I want to return the last five posts in each category. Within my view, I have categories = Post.objects.published().values('category') which gets me a list of categories that are not empty, but I am not sure how to go from there to having querysets that in

multi-db and ForeignKey

2010-01-07 Thread Zbigniew Braniecki
I'm experimenting with multi-db and it fits perfectly some major projects I'm working on. Man, I wish it was in django 1.1! :) Anyway, one issue I found that limits the scope of multi-db use is the ForeignKey constrain. It seems impossible to create a model that references another model from anoth

Django Tutorial 1.1: Viewing SQLite3 tables

2010-01-07 Thread wormser17
Hello. First, some quick context about my approach (I am not a programmer): This is the directory where I installed Django: /Library/Python/2.6/ site-packages/django This is my project directory: /Users/mlooby/Sites/mysite Situation 1) I created a SQLite3 database, named "project.db," by editing

Re: 500 internal error when posting

2010-01-07 Thread gin tonic
Add: from django.http import HttpResponse -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.c

Re: Why there are so few open-source business applications in django?

2010-01-07 Thread Ray
On Jan 8, 9:35 am, Mohammad Tayseer wrote: > I know that there are applications written in django for everything, but why > there are so few open-source business application in django? I mean > applications like warehouse management systems, HR systems, etc. The existing > ones are out of date.

Re: Why there are so few open-source business applications in django?

2010-01-07 Thread Chris Moffitt
Well, I don't know the answer to your original question, but if you want to help out with Satchmo (http://www.satchmoproject.com) feel free to. It's an ecommerce framework not an HR or warehouse mgmt but maybe it will meet your needs. -Chris On Thu, Jan 7, 2010 at 4:35 PM, Mohammad Tayseer wrote:

Re: settings caching?

2010-01-07 Thread Emre Köse
Hi Benjamin, Your modifications on *.py files won't have any effect until you restart python application (apache server in this case). On Tue, Dec 8, 2009 at 18:14, Benjamin Wolf wrote: > Hi Daniel, > > thanks for your reply - yes indeed it was the server restart. > I found it out a while after

Why there are so few open-source business applications in django?

2010-01-07 Thread Mohammad Tayseer
I know that there are applications written in django for everything, but why there are so few open-source business application in django? I mean applications like warehouse management systems, HR systems, etc. The existing ones are out of date. I really want to learn django by working on an ope

Re: 500 internal error when posting

2010-01-07 Thread Finity
> You really need to find a way to get the traceback, without that its > really hard to say what the problem is. Tools likehttp://areciboapp.com > are useful for this, but just setting DEBUG=True and restarting your > Apache/whatever should be enough. I'll have to try that arecibo, since I'm 100%

Re: 500 internal error when posting

2010-01-07 Thread Andy McKay
You really need to find a way to get the traceback, without that its really hard to say what the problem is. Tools like http://areciboapp.com are useful for this, but just setting DEBUG=True and restarting your Apache/whatever should be enough. -- Andy McKay, @clearwind Whistler conference:

Re: Python based web reporting tool?

2010-01-07 Thread Nick Lo
> I have a question for those of you doing web work with python. Is > anyone familiar with a python based reporting tool? I am about to > start on a pretty big web app and will need the ability to do some end > user reporting (invoices, revenue reports, etc). It can be an existing > django app or

Re: 500 internal error when posting

2010-01-07 Thread Finity
The size might be due to the fact were using Novell's iChain possibly? Here is the form processing code. This form, oddly enough, was working perfectly fine for a little while, so it seems to be a non- consistent bug (though I haven't been able to get it to work once at all today.) This form doe

Re: 500 internal error when posting

2010-01-07 Thread Karen Tracey
On Thu, Jan 7, 2010 at 3:46 PM, Finity wrote: > I am getting a 500 server error when I try to submit (via "POST") a > certain form. The form is built like so: > > CATEGORY_CHOICES = ( >('desktop', 'Desktop Computer'), >('laptop', 'Laptop Computer'), >('printer', 'Printer'), >('ph

500 internal error when posting

2010-01-07 Thread Finity
I am getting a 500 server error when I try to submit (via "POST") a certain form. The form is built like so: CATEGORY_CHOICES = ( ('desktop', 'Desktop Computer'), ('laptop', 'Laptop Computer'), ('printer', 'Printer'), ('phone', 'Phone'), ('other', 'Other') ) class WorkorderFo

Re: Passing a parameter into a queryset for a generic view

2010-01-07 Thread Marco Rogers
I was looking for some convenient method like this to use with the object_list generic view. But writing my own wrapper view only took 2 secs. def speaker_list(request, session_month): if not session_month in settings.SESSIONS: return HttpResponseNotFound() speake

django-dbgettext -- Extracts translatable strings from Django models for handling via Django's standard i18n mechanisms.

2010-01-07 Thread DrMeers
http://bitbucket.org/drmeers/django-dbgettext/wiki/ django-dbgettext is a simple application for exporting dynamic translatable content from your Django models for inclusion in gettext catalogues along with the static translatable strings from your templates and code. * Works with existing mo

Reaching folders and files from webpage with django?

2010-01-07 Thread Paul Chany
Hi, Is it possyble with django to do the following: to create a webpage on which one can to open folders and files so so that folders and files are on the system where the webpage is too? After the folders or files are opened, to have the possibility to edit the file or to create, rename folder

Re: warning: Not importing directory

2010-01-07 Thread Delacroy Systems
Thanks alot for the answer. Its going in the right direction! There is nothing directly going to a 'locale' folder in pythonpath. Indirectly, there are 'locale' folders inside these: C:\Python25\Lib\site-packages\django_cms-2.0.2-py2.5.egg\cms and C:\Python25\Lib\site-packages\blocks These were c

Re: Ajax: no call_back?

2010-01-07 Thread gilbert F.
Great. Thanks Dan! On Jan 7, 10:44 am, Dan Hirsch wrote: > try using HttpResponseRedirect > return HttpResponseRedirect instead of render_to_response > > On Thu, Jan 7, 2010 at 7:21 PM, gilbert F. wrote: > > Hi Django community, > > > Here is a quick question that I would like to your help. Ther

Re: Ajax: no call_back?

2010-01-07 Thread Dan Hirsch
try using HttpResponseRedirect return HttpResponseRedirect instead of render_to_response On Thu, Jan 7, 2010 at 7:21 PM, gilbert F. wrote: > Hi Django community, > > Here is a quick question that I would like to your help. There is an > Ajax function in my views.py. As this Ajax function creates

Problems with HttpResponseRedirect(reverse()) No match found

2010-01-07 Thread Mac
Hi, I've read the django docs here: http://docs.djangoproject.com/en/dev/topics/http/urls/#reverse and am still having trouble with redirecting my views. Here is my view: def skipant_sale(request, notes=''): notes=notes if request.method == 'POST': # If the form has been submitted...

Re: warning: Not importing directory

2010-01-07 Thread Tom Evans
On Thu, Jan 7, 2010 at 10:41 AM, Delacroy Systems wrote: > If I create an __init__.py, I get this: > 'import site' failed; use -v for traceback > Traceback (most recent call last): >  File "manage.py", line 2, in >    from django.core.management import execute_manager >  File "c:\python25\Lib\sit

Ajax: no call_back?

2010-01-07 Thread gilbert F.
Hi Django community, Here is a quick question that I would like to your help. There is an Ajax function in my views.py. As this Ajax function creates very big data, there seems to be a problem for the function to call call_back javaScript function therefore data gets lost. Now I am considering to

Re: request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-07 Thread Tom Evans
2010/1/7 Andreas Pfrengle : > However I'm wondering how I would transform this concept on Formsets. > I think I would somehow need to expand already the formsets __init__ > to accept the additional 'request' parameter (otherwise I get "__init__ > () got an unexpected keyword argument 'request'"), a

Re: ForeignKey efficiency question

2010-01-07 Thread apramanik
Thanks! On Jan 7, 2:19 am, Daniel Roseman wrote: > On Jan 7, 5:07 am, apramanik wrote: > > > > > Oops not a join, but still a db hit :). > > > On Jan 6, 9:03 pm, apramanik wrote: > > > > Hey all, if I have a foreign key on a model (say Model B has a foreign > > > key to Model A) and I do someth

Re: Unable to delete certain admin objects. Get "coercing to unicode" error on some, but not all objects.

2010-01-07 Thread rc
Ahh. There was one foreign key relationship (table not managed under admin) that i missed. It was indeed returning an int. Fixed it by using force_unicode and it's now working. Thanks Karen. On Jan 6, 7:06 pm, Karen Tracey wrote: > On Wed, Jan 6, 2010 at 5:20 PM, rc wrote: > > I get the followi

Re: use of @vary_on_cookie decorator with URLconf based cache_page usage

2010-01-07 Thread Justin L
Thanks for the info. As another trial, I've attempted to use this in my views: patch_vary_headers(response, ['Cookie']) return response The behavior is the same. Pages are not caching when this variance is added. If I return all cache control back to the view, it works fine again. What a

Re: request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-07 Thread Tomasz Zieliński
On Jan 7, 4:23 pm, Andreas Pfrengle wrote: > On 7 Jan., 13:22, Tomasz Zieliñski > > > > MyForm(forms.Form): > > >     myfield = forms.ChoiceField(choices=CHOICES) > > > 1. Maybe you could use ModelChoiceField: > > >http://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield > > > 2.

Re: Python based web reporting tool?

2010-01-07 Thread Jirka Vejrazka
> I have a question for those of you doing web work with python. Is > anyone familiar with a python based reporting tool?  I am about to > start on a pretty big web app and will need the ability to do some end > user reporting (invoices, revenue reports, etc). It can be an existing > django app or

Re: Python based web reporting tool?

2010-01-07 Thread Reinout van Rees
On 01/07/2010 04:20 PM, Mark Freeman wrote: I have a question for those of you doing web work with python. Is anyone familiar with a python based reporting tool? I am about to start on a pretty big web app and will need the ability to do some end user reporting (invoices, revenue reports, etc).

Re: how can a test log in as a given user before calling client.get()?

2010-01-07 Thread Alex Robbins
I would use the create_user[1] function, then you can just enter the password, instead of the hash value. Might make your code a little more readable. Alex [1]http://docs.djangoproject.com/en/dev/topics/auth/#creating-users On Jan 6, 3:19 pm, Phlip wrote: > > Google cannot find any traffic on t

Re: auth unit tests fail because sites isn't used

2010-01-07 Thread msoulier
On Jan 7, 7:25 am, Tomasz Zieliński wrote: > I'm also getting this, so I'm only running my own tests (by passing > app names to test). Ok, I suppose that's one solution, but it seems like this test makes bad assumptions and should first check to see if the sites contrib is even in the installed a

Re: request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-07 Thread Andreas Pfrengle
On 7 Jan., 13:22, Tomasz Zieliński wrote: > On Jan 7, 1:04 pm, Andreas Pfrengle wrote: > > > > > Hello, > > > I am trying to implement a ChoiceField that's choices shall be > > calculated during form instantiation in the view depending on the > > users preferred language (according to request.LAN

Re: request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-07 Thread Andreas Pfrengle
On 7 Jan., 13:22, Tomasz Zieliński wrote: > On Jan 7, 1:04 pm, Andreas Pfrengle wrote: > > > > > Hello, > > > I am trying to implement a ChoiceField that's choices shall be > > calculated during form instantiation in the view depending on the > > users preferred language (according to request.LAN

Python based web reporting tool?

2010-01-07 Thread Mark Freeman
I have a question for those of you doing web work with python. Is anyone familiar with a python based reporting tool? I am about to start on a pretty big web app and will need the ability to do some end user reporting (invoices, revenue reports, etc). It can be an existing django app or anything p

Re: apache serving static files

2010-01-07 Thread Stephen Emslie
Looks like the regular expression of the AliasMatch excludes any '/' characters in the pattern, so is only going to match the last part of the path. Or roughly equivalent to doing path.split('/')[-1]. does the following work? AliasMatch /(.*\.js) /srv/www/ccm/htdocs/static/js/$1 On Thu, Jan

Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-07 Thread Patrick May
On Jan 6, 3:22 pm, Rob wrote: > Have you managed to figure this out - I'm having a similar (I believe > the same) issue. It was the typo pointed out by Daniel Roseman. You may need to turn on a more detailed debugging level in your httpd.conf to see it in the log. Good luck, Patrick -- You re

Re: using cache.set with large object

2010-01-07 Thread Yohan Boniface
Hi, Some element here : http://code.google.com/p/memcached/wiki/FAQ#What_is_the_maximum_data_size_you_can_store?_(1_megabyte) Cheers, 2010/1/7 Julian > hi, > > i'm using the low level caching for caching a very large object, in > this case a defaultdict with several 100.000 key-value-pairs. the

Re: Multiple Databases support in 1.2

2010-01-07 Thread Keith Fernie
On 07/01/10 10:51, cschand wrote: How we can create tables for the databases other than default? I have two databases and the settings are DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbtest1', 'USER': 'root', 'PASSWORD': 'pass

Field name "hiding" permitted now?

2010-01-07 Thread parxier
Hello, everyone! I hope someone can help me here. I'm trying to create an intermediate model hierarchy for data migration purposes (I'm using South). Basically I want to move 'phone' field (see below) from 'Call' model to its parent non-abstract 'Service' model and I need an intermediate state wh

Re: Page load very slow, in Django site

2010-01-07 Thread Sam Lai
2010/1/7 Daniel Roseman : > On Jan 7, 7:46 am, NMarcu wrote: >> Hello all, >> >>     My page is loading very slow, more then 5 sec per page. I'm using >> apache2. How can I see what is the problem, or what can be the reason? > > Django debug toolbar: > http://github.com/robhudson/django-debug-tool

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2010-01-07 Thread Philippe Raoult
Hi Sam, I've read your description and it doesn't mention how often your data changes. If it's not too often, you might want to consider simply caching the whole results or parts of it. You'll then have to add a bit of code to regenerate the cache every time the data changes. It looks to me like y

apache serving static files

2010-01-07 Thread Mike Dewhirst
I want to serve development code from SuSE 11.1 using Apache 2.2 with mod_wsgi in parallel with the Django server on WinXP. It works - except I have obviously outsmarted myself configuring Apache to serve javascript. In particular tiny_mce.js. As an example, here is part of my ../templates/

Re: auth unit tests fail because sites isn't used

2010-01-07 Thread Tomasz Zieliński
On Jan 6, 10:01 pm, msoulier wrote: > I can't find anywhere in the django docs where it says that > django.contrib.auth uses django.contrib.sites, but when I run my unit > tests I get this > > (...) > > -- > Ran 45 tests in 22.37

Re: request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-07 Thread Tomasz Zieliński
On Jan 7, 1:04 pm, Andreas Pfrengle wrote: > Hello, > > I am trying to implement a ChoiceField that's choices shall be > calculated during form instantiation in the view depending on the > users preferred language (according to request.LANGUAGE_CODE from > LocaleMiddleware). > > Example forms.py:

Re: how relate webpage with databse in my harddisk?

2010-01-07 Thread gintare
One more question: Is it possible to add "mysite" to some external server and be able to access it as a superuser for me or as normal users for others? How and where i could put "mysite"? On Jan 6, 11:31 pm, Kenny Meyer wrote: > > How other can access pages i generated with django? > > You mea

request.LANGUAGE_CODE-sensitive choices in forms.ChoiceField?

2010-01-07 Thread Andreas Pfrengle
Hello, I am trying to implement a ChoiceField that's choices shall be calculated during form instantiation in the view depending on the users preferred language (according to request.LANGUAGE_CODE from LocaleMiddleware). Example forms.py: CHOICES = zip( [x.number for x in MyModel.objects.all(

users sessions logging

2010-01-07 Thread Казбек
Good day. For sessions logging i use wrapper for django login and logout functions. I save session id from request, save session id to my table, and then pass request to django login function. but when the django's login function ends, user's session id in django changes. and my table and django's

can you daisy chain foreign keys to produce a selector form

2010-01-07 Thread shofty
I'm trying to create a vehicle selector form using the following model code. class CarManu(models.Model): car_manu = models.CharField(max_length=40) class CarModel(models.Model): manu = models.ForeignKey(CarManu) car_model = models.CharField(max_length=40) class CarYear(m

using cache.set with large object

2010-01-07 Thread Julian
hi, i'm using the low level caching for caching a very large object, in this case a defaultdict with several 100.000 key-value-pairs. the problem is, everytime I try to retrieve the data with cache.get, it returns None. I'm using memcached and the caching time is set to one week. caching smaller o

Re: Multiple Databases support in 1.2

2010-01-07 Thread cschand
Thanks Russ On Jan 7, 4:20 pm, Russell Keith-Magee wrote: > On Thu, Jan 7, 2010 at 6:51 PM, cschand wrote: > > When I run syncdb command it creates tables for default (dbtest1 > > database) only. How can I create tables for db2? Is it possible to > > create at runtime? > > syncdb (and all the ot

Re: Multiple Databases support in 1.2

2010-01-07 Thread Russell Keith-Magee
On Thu, Jan 7, 2010 at 6:51 PM, cschand wrote: > When I run syncdb command it creates tables for default (dbtest1 > database) only. How can I create tables for db2? Is it possible to > create at runtime? syncdb (and all the other database-related management commands) now takes a --database argume

Re: Django Contrib's UserCreationForm (Potential Bug)

2010-01-07 Thread Sandman
On 1/7/10 2:13 AM, Daniel Roseman wrote: > On Jan 7, 4:36�am, Sandman wrote: >> Hi All, >> >> Happy new year. >> >> I've been using the svn version of django while developing a small app. >> Yesterday after I updated the code, one of my tests started returning an >> error. In fixing this error, I

Multiple Databases support in 1.2

2010-01-07 Thread cschand
How we can create tables for the databases other than default? I have two databases and the settings are DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbtest1', 'USER': 'root', 'PASSWORD': 'pass', 'HOST': '', 'PORT': ''

Re: warning: Not importing directory

2010-01-07 Thread Delacroy Systems
If I create an __init__.py, I get this: 'import site' failed; use -v for traceback Traceback (most recent call last): File "manage.py", line 2, in from django.core.management import execute_manager File "c:\python25\Lib\site-packages\django\core\management \__init__.py", line 3, in fr

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2010-01-07 Thread Sam Walters
Thanks Koen I had suspected such things would exist but couldnt find them. I will take a look at this. Looks like a neat addon which would greatly help my project turnaround time. cheers Sam On Wed, Jan 6, 2010 at 11:07 PM, koenb wrote: > > On 31 dec 2009, 01:56, Sam Walters wrote: >> Thanks fo

Re: list_display functionality for inlines ?

2010-01-07 Thread frans
On 7 jan, 11:15, Daniel Roseman wrote: > On Jan 7, 9:22 am, frans wrote: > > > Is this something which exists ? Looking at Tabular/Stacked Inline > > features I think not. > > So then, I assume I want a Pony , however, I think many people want > > this pony so its probably impossible to re-use th

Re: ForeignKey efficiency question

2010-01-07 Thread Daniel Roseman
On Jan 7, 5:07 am, apramanik wrote: > Oops not a join, but still a db hit :). > > On Jan 6, 9:03 pm, apramanik wrote: > > > Hey all, if I have a foreign key on a model (say Model B has a foreign > > key to Model A) and I do something like this: > > > a = A.objects.get( pk = 1 ) > > b = B.objects.

Re: Page load very slow, in Django site

2010-01-07 Thread Daniel Roseman
On Jan 7, 7:46 am, NMarcu wrote: > Hello all, > >     My page is loading very slow, more then 5 sec per page. I'm using > apache2. How can I see what is the problem, or what can be the reason? Django debug toolbar: http://github.com/robhudson/django-debug-toolbar -- DR. -- You received this mes

Re: Does anyone have a Django or Python flow chart?

2010-01-07 Thread Daniel Roseman
On Jan 7, 4:44 am, spike wrote: > Does anyone have a Django or Python flow chart? A flow chart of what? -- 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-us...@googlegroups.com. To unsubscribe fr

Re: list_display functionality for inlines ?

2010-01-07 Thread Daniel Roseman
On Jan 7, 9:22 am, frans wrote: > Is this something which exists ? Looking at Tabular/Stacked Inline > features I think not. > So then, I assume I want a Pony , however, I think many people want > this pony so its probably impossible to re-use the list_display > functionality for inlines ? > > It

Re: Django Contrib's UserCreationForm (Potential Bug)

2010-01-07 Thread Daniel Roseman
On Jan 7, 4:36 am, Sandman wrote: > Hi All, > > Happy new year. > > I've been using the svn version of django while developing a small app. > Yesterday after I updated the code, one of my tests started returning an > error. In fixing this error, I may have uncovered a bug but I can't be > sure if

Re: warning: Not importing directory

2010-01-07 Thread Daniel Roseman
On Jan 7, 7:40 am, Delacroy Systems wrote: > How do I solve this? Happens when I do a runserver... > > warning: Not importing directory 'C:\Python25\Lib\site-packages\blocks > \locale': missing __init__.py > warning: Not importing directory 'C:\Python25\Lib\site-packages > \django_cms-2.0.2-py2.5.

list_display functionality for inlines ?

2010-01-07 Thread frans
Is this something which exists ? Looking at Tabular/Stacked Inline features I think not. So then, I assume I want a Pony , however, I think many people want this pony so its probably impossible to re-use the list_display functionality for inlines ? It be very nice though. Hopefully someone could p

Re: Data Level Access Control

2010-01-07 Thread derek
You can also look at the blog entry that James Bennett (on the Django dev team) wrote on this topic http://www.b-list.org/weblog/2008/dec/24/admin/ He says "For a free bonus Christmas present, I’ll also explain another frequently-requested item: how to ensure that people can only see/edit things