Re: problem with permalink

2008-07-22 Thread mwebs
Yes, I tried this but the problem still exists. it s the same when I do like this: @permalink def get_url(self): return ('experiment_view', (), {'exp_id': self.id}) and the same when I do it like in the example [1]: def get_url(self): return ('experiment_view', (), {'exp_id':

problem with permalink

2008-07-22 Thread mwebs
Hello, I have a very strange problem with the permalink-decorator: model: def get_url(self): return permalink('experiment_view', (), {'exp_id': self.id}) urls.py: ... url(r'^(?P\d+)$', 'edit_experiment', name='experiment_view'), in my template {{exp.get_url}} returns an empty

Re: Migrating to newforms-admin and classes already registered error

2008-07-22 Thread Peter Bailey
That works much better Malcolm, thank you very much. Appreciate the explanations too. Cheers, Peter On Jul 22, 3:23 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-22 at 12:21 -0700, Peter Bailey wrote: > > Hi all. I am attempting to convert an app I am writing to use the

ticket #6755 closed: Model Inheritance doesn't work in the admin.

2008-07-22 Thread Andre Meyer
hi all wow, ticket #6755 is closed! so, just tried it out and got an error, oh my dear! is it me or is there still a problem? here is the code (simplified) *model.py* class Item(models.Model): pass class Note(models.Model): text =

AttributeError: 'module' object has no attribute

2008-07-22 Thread Tom
From: Morgan Packard gmail.com> Subject: newbie -- hiccups in following tutorial Newsgroups: gmane.comp.python.django.user Date: 2008-07-22 09:02:56 GMT (13 hours and 48 minutes ago) Hello all, I'm going through the tutorial at http://www.djangoproject.com/documentation/tutorial01/, and am

Re: Overriding save_add/save_change fails when using NFA?

2008-07-22 Thread Joseph Kocherhans
On Tue, Jul 22, 2008 at 5:12 PM, Huuuze <[EMAIL PROTECTED]> wrote: > > I'd appreciate it if someone else chimed in, but it appears as though > the HOWTO contains a typo. I've looked at the older versions of > Django and the NFA branch and none of them include the "model" > parameter in the

Re: WSGIScriptAlias and change #8015

2008-07-22 Thread arsyed
On Tue, Jul 22, 2008 at 2:29 PM, Marty Alchin <[EMAIL PROTECTED]> wrote: > > On Tue, Jul 22, 2008 at 4:40 AM, arsyed <[EMAIL PROTECTED]> wrote: >> urlpatterns = patterns('', >>(r'^/foo$', foo), >> ) >> >> --error message >> >> GET http://localhost/mysite/foo results in: >> >> Using the

Re: WSGIScriptAlias and change #8015

2008-07-22 Thread arsyed
On Tue, Jul 22, 2008 at 2:05 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Tue, 2008-07-22 at 10:58 -0700, Malcolm Tredinnick wrote: >> >> On Tue, 2008-07-22 at 04:40 -0400, arsyed wrote: >> > Hi - With the change in 8015: >> > >> >

Re: URL problems after newforms admin migration

2008-07-22 Thread Matthew
Hmm, unfortunately I'm running this test environment on a Media Temple Gridserver container, so I have no access to the httpd.conf for changing stuff like that :( I'm not too bothered with the problem whilst I'm testing it, but I wouldn't want this to crop up when I'm trying to move it all across

Re: Form.clean() and custom error handling

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 15:20 -0700, John-Scott wrote: > All, > > I had previously been using a bit of a hack (thought I found examples > of this on the mailing list, but can't find any evidence now) so that > I could actually associated field specific errors with the actual > field instead of

Re: Streaming uploads help

2008-07-22 Thread Marty Alchin
On Tue, Jul 22, 2008 at 5:50 PM, Chris <[EMAIL PROTECTED]> wrote: > Right now I am simply doing this which obviously does not get the > directory structure that I want. > > PATH_ROOT = os.path.join(MEDIA_ROOT, 'event-photos', ph.name) > IMAGE_PATH = os.path.join('event-photos', ph.name) >

Re: superuser has no rights with newforms admin

2008-07-22 Thread stranger
I am using django (revision 8055.). after updating the site seems to work fine but the admin panel still shows me You don't have permission to edit anything. I do have admin.autodiscover() and induvidually registered models in admin.py in all apps. I tried commenting out the

Form.clean() and custom error handling

2008-07-22 Thread John-Scott
All, I had previously been using a bit of a hack (thought I found examples of this on the mailing list, but can't find any evidence now) so that I could actually associated field specific errors with the actual field instead of having everything stuffed into __all__ / non_field_errors. The hack

Re: Overriding save_add/save_change fails when using NFA?

2008-07-22 Thread Huuuze
I'd appreciate it if someone else chimed in, but it appears as though the HOWTO contains a typo. I've looked at the older versions of Django and the NFA branch and none of them include the "model" parameter in the "save_add" method. Anyone else agree? On Jul 22, 5:05 pm, Huuuze <[EMAIL

Streaming uploads help

2008-07-22 Thread Chris
Hello I have an image field in my photos model that has an upload_to='event-photos/%Y/%m/%d/' variable but I am not sure how I can reference this using streaming uploads. before streaming uploads you could do something like: p = Photo(**params) p.save_photo_file(photo.filename, photo.content)

Overriding save_add/save_change fails when using NFA?

2008-07-22 Thread Huuuze
I am using Django 1.0alpha and I'm attempting to modify the add/change behavior of my ModelAdmin. As such, I'm following this example found on the Django wiki: http://code.djangoproject.com/wiki/NewformsHOWTO#Q:HowcanIchangewhereIgetsentaftersavinganewentrytothedatabase Unfortunately, the

Re: Which Postgresql/Psycopg2 version should we use?

2008-07-22 Thread Steve
I ended up rebuilding everything with postgresql 8.29/pyscopg2.07 and everything works fine. Email me if you have questions or a similar problem as I never figured out why it didn't work with postgresql 8.33. I'd like to know what the issue was. For now I'm just going to back away slowly from

Re: Which Postgresql/Psycopg2 version should we use?

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 13:36 -0700, Steve wrote: > I ended up rebuilding everything with postgresql 8.29/pyscopg2.07 and > everything works fine. Email me if you have questions or a similar > problem as I never figured out why it didn't work with postgresql > 8.33. I'd like to know what the issue

importing model from html.py

2008-07-22 Thread Mayank Dhingra
Hi, Was wondering what's wrong with importing a model or a function from a view which further imports a model. Have been trying to tweak a default filter from html.py to use model but unable to do so. error: cannot import name models Thanks

Migrating to newforms-admin and classes already registered error

2008-07-22 Thread Peter Bailey
Hi all. I am attempting to convert an app I am writing to use the nfa. I have looked at all the docs available about this, but must have missed something. I am using: Django version 1.0-alpha-SVN-8053 Anyway, I have changed my urls.py file to be like so: from django.contrib import admin

Which Postgresql/Psycopg2 version should we use?

2008-07-22 Thread Steve
Recently we migrated from a working version of our site with MySQL with the MySIAM engine to Postgresql 8.3.3/Pyscopg2.07. I built/ installed both on the site and after some finagling got our site to connect and ran syncdb successfully. All our unit tests passed, but the site behaves erratically

Re: status of unicode support in 0.96?

2008-07-22 Thread Andrew D. Ball
We're working on testing things out on the trunk now. It's just a case of my being very hesitant to use anything that's not officially a stable release. However, it looks like in this case, using the trunk is the right thing to do. Thanks for all of y'all's help! Peace, Andrew On Mon, Jul

Re: WSGIScriptAlias and change #8015

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 10:58 -0700, Malcolm Tredinnick wrote: > > On Tue, 2008-07-22 at 04:40 -0400, arsyed wrote: > > Hi - With the change in 8015: > > > > http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined > > > > it sounds like I shouldn't

Re: WSGIScriptAlias and change #8015

2008-07-22 Thread Malcolm Tredinnick
On Tue, 2008-07-22 at 04:40 -0400, arsyed wrote: > Hi - With the change in 8015: > > http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined > > it sounds like I shouldn't need to specify the WSGIScriptAlias in the > URLConf file. But this doesn't

Re: Django Newbie

2008-07-22 Thread James Matthews
I would recommend on learning python before looking at django. It would explain why things have to be in your PYTHONPATH and answer many questions Etc.. On Tue, Jul 22, 2008 at 2:01 AM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 22-Jul-08, at 12:36 PM, Sthembile Ngidi wrote: > > > I'm

ANN: Django sprint in Washington DC area, August 1st

2008-07-22 Thread Benjamin Slavin
With 1.0 alpha upon us, I thought it would be a good time for an announcement. On August 1st, just under two weeks from now, we will be hosting a sprint in Washington, DC. The focus will be on Django 1.0 beta 1. This marks the first east-coast Django sprint (I think), so we're trying to bring

Re: similar method for get_or_create()

2008-07-22 Thread pihentagy
Hi! I also have the same issue. I should write: pp, pp_created = WSProductPurchase.objects.get_or_create(purchase=purchase, ws_product=ws_product, defaults=dict(quantity=quantity)) if not pp_created: pp.quantity = quantity pp.save() I suspect

Re: Model Meta verbose_name setter

2008-07-22 Thread [EMAIL PROTECTED]
On 22 juil, 14:38, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Tue, Jul 22, 2008 at 5:17 AM, James PIC <[EMAIL PROTECTED]> wrote: > > I'm trying to use the value of a field of the model for Meta verbose_name. > > Do you mean an instance of the model? Like, if you have an Article > whose title

dynamic template?

2008-07-22 Thread Niels
Hello, Does anyone has an suggestion how te create an fill a 'dynamic template'? Current situation: index.html: {% include 'nav.html' %} {% include 'agenda.html' %} with a view: from django.shortcuts import render_to_response def index(request): return

internal server error with new development version

2008-07-22 Thread ajo11
Hi, After upgrading from development version 7933, I'm getting a 500 Internal Server Error page. This doesn't happen every time. Sometimes it gives the expected response & sometimes it gives a normal 500 page. I think Apache is OK as another simple django project is working fine. This is the

Re: Django on OS X Leopard - apache only forwards to mod_python on localhost

2008-07-22 Thread Mark Phillips
On Jul 22, 2008, at 7:07 AM, Matt wrote: > Apache obviously isn't forwarding the request to the PythonHandler, > but I don't know why. I am not an expert at this but I am willing to share has worked here... When setting up Django, I did not have much luck with the Location directive. I would

Re: django-admin.py not recognized in Windows Vista despite adding it to the PATH

2008-07-22 Thread Reed Bailey
I've seen this issue with path before when using WinOS. _Another_ possibility for an executable not recognized on WinOS is OS Path variable is too long (the colon delimited list has too many characters). The failure is silent: No message that delimited list is too long and no truncation or end of

OR on filter vs. OR on Q objects

2008-07-22 Thread Ales Kozumplik
Hi, I've encountered a similar problems like Julien here: http://groups.google.com/group/django-users/browse_thread/thread/09e6d4f5c4f9cbfc The case I have got is slightly more complex, and what is strange is that it doesn't seem to be fixed by Queryset Refactor branch merge (my django-trunk is

Re: newbie -- hiccups in following tutorial

2008-07-22 Thread Horst Gutmann
svn co http://code.djangoproject.com/svn/django/trunk/ django :-) -- Horst On Tue, Jul 22, 2008 at 2:43 PM, Morgan Packard <[EMAIL PROTECTED]> wrote: > cool. thanks. what's the svn url for the version I want? > > -m- > > On Jul 22, 5:18 am, "Horst Gutmann" <[EMAIL PROTECTED]> wrote: >> This

Re: Path Creation

2008-07-22 Thread Matthias Kestenholz
On Tue, 2008-07-22 at 11:02 +0200, Sthembile Ngidi wrote: > How do u create a path in python? http://www.google.com/search?q=python+create+path Second hit. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Is the same request.method == "POST" and request.POST?

2008-07-22 Thread Juanjo Conti
I have used both ways in my views, now I am wondering know if one is wrong and why. Thanks in advance, -- Juanjo Conti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: newbie -- hiccups in following tutorial

2008-07-22 Thread Morgan Packard
Thanks again. I"m pretty sure that's where my django install came from. I _had_ installed one of the older versions, but had to upgrade in order to follow the tutorial. I need to get on some other work now, will give this another try in a day or two. -Morgan On Jul 22, 8:49 am, "Horst Gutmann"

Re: dynamic template?

2008-07-22 Thread Niels
Tsss...how stupid. Thanks On Jul 22, 2:51 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Hi Niels.  See the documentation for the include tag: > > http://www.djangoproject.com/documentation/templates/#include > > It indicates that "[t]he template name can either be a variable or a > hard-coded

SQL data not loaded in testing suite

2008-07-22 Thread Adrián Ribao
Hello, I'm writing a test suite, and when the database is created, everything seems ok, I can even see the: Installing custom SQL for but the data is not inserted in the db. Is it a bug? Thank you. --~--~-~--~~~---~--~~ You received this message because you

Re: newbie -- hiccups in following tutorial

2008-07-22 Thread Morgan Packard
cool. thanks. what's the svn url for the version I want? -m- On Jul 22, 5:18 am, "Horst Gutmann" <[EMAIL PROTECTED]> wrote: > This tutorial applies to the trunk version of Django and this > particular part requires a very recent checkout (from not older than > the 18th of this month). You can

Re: Model Meta verbose_name setter

2008-07-22 Thread Marty Alchin
On Tue, Jul 22, 2008 at 5:17 AM, James PIC <[EMAIL PROTECTED]> wrote: > I'm trying to use the value of a field of the model for Meta verbose_name. Do you mean an instance of the model? Like, if you have an Article whose title attribute is "Testing" you'd like "Testing" to show up in the admin

Deploying Django on Apache

2008-07-22 Thread Pepsi330ml
This is my file system structure WebApplication -> 0.9 ->lib (log4py) ->src (the Django Code) This is the command i used to run the Django Application from console. $ PYTHONPATH=lib/:src/ DJANGO_SETTINGS_MODULE=settings src/manage.py runserver PYTHONPATN=lib/:src/ The above command is

Re: problem with permalink

2008-07-22 Thread Alex Koshelev
Hi. `permalink` - is a decorator [1], not an 'ordinary' function. So it can be used like this: @permalink def get_url(self): return ('experiment_view', (), {'exp_id': self.id}) [1]: http://www.djangoproject.com/documentation/model-api/#the-permalink-decorator On Jul 22, 1:30 pm, mwebs

Re: Can't Send Password With Test Client

2008-07-22 Thread Russell Keith-Magee
On Tue, Jul 22, 2008 at 5:05 AM, James <[EMAIL PROTECTED]> wrote: > > It appears that the password value isn't printed for security reasons. > The problem remains that the form will not validate. Are you sure you have a test user? Remember, when you run the test suite, you're not using the

Re: Deploying Django on Apache

2008-07-22 Thread Pepsi330ml
YES!!! It worked!! Now onto another problem. Database settings, my original settings is postgresql_psycopg2 Running from command line, the web application can access the database with no problem. Running off apache, i have a interface error complaining the connection is closed. Then i change

Extending Newforms Admin with functionality

2008-07-22 Thread gnijholt
Hello django-users, What is the preferred way of extending the Admin interface with functionality (not just a template override) (using the newforms admin)? I ask because I'm trying to build something simple. I have a model NewsletterSubscriber which has just a name, an active boolean, and an

Re: Deploying Django on Apache

2008-07-22 Thread arsyed
On Tue, Jul 22, 2008 at 5:47 AM, Pepsi330ml <[EMAIL PROTECTED]> wrote: > > like this? > > NameVirtualHost 127.1.1.1 > >... >PythonDebug On > >PythonPath "[/home/Documents/WebApplication/ > 0.1/',#the > main directory for the

Re: Model Meta verbose_name setter

2008-07-22 Thread James PIC
Hi Marty, On Mon, Jul 21, 2008 at 9:18 PM, Marty Alchin <[EMAIL PROTECTED]> wrote: > > On Mon, Jul 21, 2008 at 2:55 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> This is why i need to code a little mechanism to set the verbose_name >> property of Meta subclass of Model. >> I can't get it

Re: Custom validation

2008-07-22 Thread Alex Rades
Well, as i said, overriding save() does not provide the ability to raise an error which is field-specific. What i want to do, was possible with validator_list. I actually don't understand why this functionality has been removed. On Mon, Jul 21, 2008 at 7:59 PM, Jeff FW <[EMAIL PROTECTED]>

Re: newbie -- hiccups in following tutorial

2008-07-22 Thread Horst Gutmann
This tutorial applies to the trunk version of Django and this particular part requires a very recent checkout (from not older than the 18th of this month). You can normally get the version of Django you're using by running `django-admin.py --version` :-) The problem you have seems to be related

newbie -- hiccups in following tutorial

2008-07-22 Thread Morgan Packard
Hello all, I'm going through the tutorial at http://www.djangoproject.com/documentation/tutorial01/, and am having trouble with the second page (http:// www.djangoproject.com/documentation/tutorial01/). The tutorial instructs me to add "admin.site.register(Poll)" to the bottom of models.py.

Assessing Django for our web presence

2008-07-22 Thread Daniele Procida
Hi. I'm the web officer for the medical school of a large British university. We have decided to migrate our website to an Open Source content management and publishing platform, and Django is one of the systems we're investigating (Zope/Plone is another serious candidate). I visited another

Strange Postgresql Connection issue

2008-07-22 Thread madhav
A little bit of background to the problem: I have a page, which will have dynamic right-side bar , dynamic center- pane . Each bar is different from others. Think of it like,right- sidebar is showing my subscribed categories of a news site and center- pane is showing my actual news-posts list in

Re: Django Newbie

2008-07-22 Thread Horst Gutmann
How did you install Django? It seems like Django wasn't installed in your PYTHONPATH. Also what version of Django are you trying to work with? What operating system are you using? Could you please only post complete error messages? :-) -- Horst On Tue, Jul 22, 2008 at 10:39 AM, Amie <[EMAIL

Re: Django Page - Db Connections count

2008-07-22 Thread madhav
I am using the DebugFooterMiddleware, but it still doesn't show how many postgresql connections are used to fetch all the components in a page. What i want is the total number of db connections count. How can I get that? Please forgive me for my ignorance. On Jul 22, 12:30 pm, Eric Abrahamsen

Re: Multiple languages in Admin

2008-07-22 Thread Chris Ovenden
Looks great, thanks! Chris --~--~-~--~~~---~--~~ 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

Re: Django Page - Db Connections count

2008-07-22 Thread Eric Abrahamsen
You could try the debug middleware: http://www.djangosnippets.org/snippets/766/ or the page stats middleware: http://code.djangoproject.com/wiki/PageStatsMiddleware and this article by Simon Willison is a good general resource: http://simonwillison.net/2008/May/22/debugging/ Yours, Eric On

Re: Getting an IndexError when using distinct() and order_by()

2008-07-22 Thread Malcolm Tredinnick
On Mon, 2008-07-21 at 15:57 -0700, Malcolm Tredinnick wrote: > > On Mon, 2008-07-21 at 15:41 -0700, bhunter wrote: > > Ahh, never mind. Looks like it IS a bug, but a very new one: > > > > http://code.djangoproject.com/ticket/7791 > > I haven't had a chance to look at that bug yet, except to

Re: Django Newbie

2008-07-22 Thread Horst Gutmann
Hi :-) What exactly didn't you understand in the tutorial? How far have you come within the tutorial so far? -- Horst On Tue, Jul 22, 2008 at 9:06 AM, Sthembile Ngidi <[EMAIL PROTECTED]> wrote: > > > -- Forwarded message -- > > > Morning, > > I'm relatively new to python and I

Saving tests' output to a file in Windows

2008-07-22 Thread Julien Phalip
Hi, I'm running Django's whole test suite in Windows, from a clean checkout. I get lots of errors and failures, but there's apparently some known issues, as described in [1]. Anyway, I can't really debug these errors because the output doesn't entirely fit in the command window. So I'd like to

Django Page - Db Connections count

2008-07-22 Thread madhav
Guys, I need some middleware or utility to check how many postgresql connections are actually used to generate a particular page in django. Can We get that by any chance? I am in the real pinch, Please help me. --~--~-~--~~~---~--~~ You received this message

Custom permission problem in newforms-admin

2008-07-22 Thread Brandon Taylor
Hi everyone, I'm trying to enforce a customer permission on Add/Update. In my model, I have defined the permission: permissions = ( ('can_approve_stories','Can Approve Stories'), ) in my model.ModelAdmin I have: def change_view(self, request, obj_id):

Re: Saving tests' output to a file in Windows

2008-07-22 Thread Arien
On Mon, Jul 21, 2008 at 12:13 AM, Julien Phalip <[EMAIL PROTECTED]> wrote: > Anyway, I can't really debug these errors because the output doesn't > entirely fit in the command window. So I'd like to save the output in > a file, but it doesn't work. I tried: > > set PYTHONPATH=E:\django >