Re: Having to rstrip the " [] " from the end of your Key when posted?

2010-05-28 Thread James Bennett
On Fri, May 28, 2010 at 7:41 PM, pyfreak wrote: >  However, I also need to use "key".  But when I'm sending over stuff > from javascript like above, > the key has a "[]" tacked on the end of it, like "stringkey[]" You are most likely running into this, or an issue

Re: Having to rstrip the " [] " from the end of your Key when posted?

2010-05-28 Thread pyfreak
I accept this as normal now. I think, what I'll need to do if I'm against stripping off the two characters, is simply putting the value that serves as the key, directly into the array as the last element. Simple enough. So in views function: It'll look like: request.POST["imthekeyval[]"]

common object

2010-05-28 Thread maintux
hi I'm new in this group and I'm newbie with django. I have this problem: I need to have a socket reference accessible from all views in the application. The concept is similar to the session concept, but if is possible I need to access to the socket without using session. have you idea about

Thread safety with Form Wizard

2010-05-28 Thread Wiiboy
Hi guys, I'm a relative newbie at using Django in an actual production setting. I'm having trouble using the form wizard at the moment, and I noticed that there is one instance of the Wizard class, instantiated in urls.py. Is there anything I should worry about as far as thread safety is

ManyToMany + through model disappear from Admin interface

2010-05-28 Thread onorua
Hello, I have this simple code, which dives me crazy already :( class ActiveInformer(models.Model): informer = models.ForeignKey('Informer', related_name='act_informers') user = models.ForeignKey(User, related_name='informers') class Informer(models.Model): informer_types = (('P',

Having to rstrip the " [] " from the end of your Key when posted?

2010-05-28 Thread pyfreak
I'm having to, in Javascript, create a dictionary ( my_dict = {} ), then put in some Arrays. my_dict["stringkey"] = Array("hey","hey1") my_dict["stringkey1"] = Array("more","stuff") In the views function: for key in request.POST: prop_rec = request.POST.getlist(key) The

Getting brackets at the end of your Keys?

2010-05-28 Thread steve
I'm having to, in Javascript, create a dictionary ( my_dict = {} ), then put in some Arrays. my_dict["stringkey"] = Array("hey","hey1") my_dict["stringkey1"] = Array("more","stuff") In the views function: for key in request.POST: prop_rec = request.POST.getlist(key) The

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-28 Thread Graham Dumpleton
In '/home/seb/MAIN/seoconquer', can you do: ls -las ls -las mvc and post the output. If you are concerned about revealing details send it to my email direct. Graham On May 29, 7:19 am, Chris Seberino wrote: > On May 27, 6:56 pm, Graham Dumpleton

Re: BaseGenericInlineFormSet failing on Save As New in admin

2010-05-28 Thread Stephen Sundell
Added this for my GenericInlineFormSet and things seem to work correctly now: class MyGenericInlineFormSet(BaseGenericInlineFormSet): def __init__(self,*args,**kwargs): self.save_as_new = kwargs.get('save_as_new',False)

How do you handle broken tests from plug-ins?

2010-05-28 Thread Brian McKeever
I'm using Django-registration and Django-invitation. They both work on my website, but they both come with tests that fail. I don't think the tests are failing because the plug-ins don't work. I think they're failing due to different testing environments. Django- registration in particular gives

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-28 Thread Chris Seberino
On May 27, 6:56 pm, Graham Dumpleton wrote: > You also need to add '/home/seb/MAIN/seoconquer'. Read: > >  http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html I tried both versions of the wsgi script on your blog. And I still get this same

Trouble with comment moderation

2010-05-28 Thread bax...@gretschpages.com
I have a very simple blog app and am trying to enable moderation on the entries. I'm following the docs, but nothing seems to be happening: The code: http://dpaste.com/200509/ Which would lead me to entries > 14 days old would be closed for commenting. Not so. And no matter what I do, all

Re: runtests.py fails with ImportError: No module named messages

2010-05-28 Thread Filip Gruszczyński
That seems reasonable. So if I want to run tests on local django workspace and have older django installed (in daily work I use 1.1.1) I need to simply have this django workspace added to PYTHONPATH? Won't this mess with my default django installation? On May 27, 2010 4:03 PM, "Karen Tracey"

delete file or image after deleting model item

2010-05-28 Thread ev
There are ImageField and FileField in a model. When model item removed, image and file stay. Is it normal behavior? Is there a way to remove image and file automatically? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Content Types and Filtering Generic Relationships

2010-05-28 Thread Stephen Sundell
Have you checked out http://code.google.com/p/django-tagging/ ? On May 28, 12:54 pm, Streamweaver wrote: > Still hoping someone has some insight here.  I've been plugging away > at it and am still not finding an answer I can live with as an > engineer. > > Currently I'm

Re: Content Types and Filtering Generic Relationships

2010-05-28 Thread Streamweaver
Still hoping someone has some insight here. I've been plugging away at it and am still not finding an answer I can live with as an engineer. Currently I'm cheating a bit to filter down by only published objects in my view like so tag = get_object_or_404(Tag, slug=slug) contentitems =

BaseGenericInlineFormSet failing on Save As New in admin

2010-05-28 Thread Stephen Sundell
I'm using an InlineAdmin that is a generic relation, similar to django tagging, with one of my model admins. The problem is on a save as new, if the original object has tags, then the initial form count, gotten from the management form, isn't zero, even though the new object will have zero tags,

Create Dynamic data with mongokit

2010-05-28 Thread Marcos Daniel Petry
I need to create a project that creates dynamic forms, which I keep in a relational database structure and use the form MongoDB to persist the data, keeping in different collections each form. Am I creating this dynamic class that way [1], but I'm having some trouble returning the seguitne error

Re: makeing a foreign key optional

2010-05-28 Thread bastir
Hey Shawn, I have deleted the whole DB just to be sure. It must be sth else. I'm using the grapelli admin interface. An SQL insert query with NULL as foreign key is working. So it must be sth abouth the django validation stuff. thx, Sebastian On 28 Mai, 18:18, Shawn Milochik

Re: makeing a foreign key optional

2010-05-28 Thread bastir
Hey Shawn, I have deleted the whole DB just to be sure. It must be sth else. I'm using the grapelli admin interface. An SQL insert query with NULL as foreign key is working. So it must be sth abouth the django validation stuff. thx, Sebastian On 28 Mai, 18:18, Shawn Milochik

Admin: issues in saving an object in popup

2010-05-28 Thread donato.gr
In the Admin application I can create related objects 'on the fly' in a popup (e.g. when changing a User I can create Groups by pressing the green 'plus' next to the Group list): this is done adding '_popup=1' to the url used in the popup (e.g. "/admin/auth/group/add/?_popup=1"). The 'Save' button

Re: Newbie having problems with django project tutorial setup - errors with psycopg2

2010-05-28 Thread Cyndi Bussey
When I do import from Python, it can't find it either. I need Postgresql for a job. I saw a post somewhere else that says maybe my Python path is not complete, so I will look at that when I get home. Thanks for the reply! Cyndi www.mysticbostons.com On Fri, May 28, 2010 at 12:22 PM, Shawn

Re: Newbie having problems with django project tutorial setup - errors with psycopg2

2010-05-28 Thread Shawn Milochik
If you're in a terrible rush, you could switch to sqlite3 during development until you're ready to go to production. It sounds like either psycopg2 didn't install properly, or your Django instance is running under a different version or installation of Python than the one where you installed

Re: makeing a foreign key optional

2010-05-28 Thread Shawn Milochik
Had you already run syncdb when you made the field optional? If so, you need to use a migration tool -- syncdb doesn't change existing tables, only creates new ones. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

makeing a foreign key optional

2010-05-28 Thread bastir
Hey, i want to have an optional foreign key in my model. I tried sth like this: person= models.ForeignKey('Person', related_name="kontakt",blank=True,null=True) If I try to add a new object in the admin interface it is always complaining that i have no value selected in the person field.

Re: android app for the documentation site

2010-05-28 Thread Masklinn
On 2010-05-28, at 17:31 , jaymzcd wrote: > > Hi All, > > I thought some of you with android phones might be interested, I > knocked up a quick app to make browsing the doc site a bit easier for > me. It's in the marketplace for download. It's got some quick links to > topics I tend to lookup a

android app for the documentation site

2010-05-28 Thread jaymzcd
Hi All, I thought some of you with android phones might be interested, I knocked up a quick app to make browsing the doc site a bit easier for me. It's in the marketplace for download. It's got some quick links to topics I tend to lookup a lot. I was thinking of adding in custom bookmarks and

Re: Creating a custom view in Django admin,

2010-05-28 Thread Dexter
Thank you chr, I've never experimented with managers, but it's quite useful. I guess a custom manager is also the only way to have a foreignkey to a user in a specific group. But although I'm a bit further, I still don't know the answer to my million-dollar question. Is it possible to have an

Re: best approach to solve statistical problem

2010-05-28 Thread backdoc
I'm benefiting a great deal from all other aspects of Django. So, I'm not concerned about having to use SQL to get the job done. However, I really want to do it the way the Django developers intended it to be done, which may be to use raw SQL. The only thing I don't like about addressing the

Re: best approach to solve statistical problem

2010-05-28 Thread backdoc
That sounds interesting. As I am new to Django, I never really gave putting the logic in the model, although I did happen to read a little about model methods yesterday. Would you mind making some of your code available? I'd be interested in seeing your approach. Darren On Fri, May 28, 2010

load model anywhere

2010-05-28 Thread Josueh Machado
hi, sou do brasil, como faço para o Django carregar os Models de qualquer arquivo? exemplo: carregar do arquivo usuario.py e não do models.py alguém pode me ajudar?? (eu lei ingles, mas não sei escrever alguem aí lê portugues?) obrigado! -- You received this message because you are

piston and related models

2010-05-28 Thread Alexandre González
Hi! I don't know how to make django-piston save my related objects. This is my handler file: from piston.handler import BaseHandler, AnonymousBaseHandler from piston.utils import rc, require_mime, require_extended from test.networking.models import NetworkingProfile class

Re: Installation problem (version 1.2.1)

2010-05-28 Thread Alex Robbins
I think Daniel might mean you can also use the __file__ attribute, as in: >>> import django >>> django.__file__ Hope that helps, Alex On May 28, 4:07 am, Daniel Roseman wrote: > On May 28, 9:56 am, Derek wrote: > > > > > I have just upgraded my

Re: Fetch DoesNotExist from get_object_for_this_type

2010-05-28 Thread Dirk Eschler
Am Freitag 28 Mai 2010, 14:43:21 schrieb Daniel Roseman: > On May 28, 1:33 pm, Dirk Eschler wrote: > > how to fetch the DoesNotExist exception generated by > > get_object_for_this_type? Being generic i can't use the actual model. [...] > The DoesNotExist exceptions for each

Re: Fetch DoesNotExist from get_object_for_this_type

2010-05-28 Thread Daniel Roseman
On May 28, 1:33 pm, Dirk Eschler wrote: > Hello, > > how to fetch the DoesNotExist exception generated by get_object_for_this_type? > Being generic i can't use the actual model. > > I tried something like that, but i doesn't seem to work, the original > exception is still

Fetch DoesNotExist from get_object_for_this_type

2010-05-28 Thread Dirk Eschler
Hello, how to fetch the DoesNotExist exception generated by get_object_for_this_type? Being generic i can't use the actual model. I tried something like that, but i doesn't seem to work, the original exception is still raised. from django.contrib.contenttypes.models import ContentType from

Re: problems with authentication of test client

2010-05-28 Thread Karen Tracey
On Fri, May 28, 2010 at 5:42 AM, irum wrote: > I have also tried after updating my django-trunk but the problem > persisits. Should I downgrade to Python 2.6.4 to fix this? > The problem you reference has been fixed in 1.2.x (and also 1.1.2), so if updating to current

Re: admin: add save -> error

2010-05-28 Thread Karen Tracey
On Fri, May 28, 2010 at 2:33 AM, Philipp wrote: > Thanks a lot Karen, I did google and found some more info here: > > http://trac.turbogears.org/ticket/2133#comment:11 > > just as a note, this is an issue on Django Developer Kit 1.2.1 > > FYI this has now been fixed in

Re: Looking for a good CRUD example

2010-05-28 Thread Richard Shebora
Try... http://alpha.djangogenerator.com It will generate a substantial amount of boilerplate code for you. Including templates and various views for listing, editing and viewing models, and admin access with admin documentation setup too. It is helping me greatly with folder layout and basic

Re: db problems after upgrading

2010-05-28 Thread Erik Romijn
Hi, darren wrote: > I upgraded django version from (not exactly sure) about 1.0 to 1.2. > After doing so, if I run manage.py syncdb, I get messages saying I > need to add unique constraints. I added "unique=True" to the columns > in the model that were indicated. However, I continue to get the

Re: Annotating a queryset without aggregation

2010-05-28 Thread Tom Evans
Django 1.2 is more than happy to filter on aggregates and annotations, see: http://docs.djangoproject.com/en/1.2/topics/db/aggregation/#aggregations-and-other-queryset-clauses My problem is that I can't see how to specify this additional computed field as an annotation, and can only coerce it in

Re: best approach to solve statistical problem

2010-05-28 Thread Euan Goddard
Darren, This seems like quite a complex problem and I'm not sure whether the Django ORM would be up to it. I've had a lot of trouble when using multiple annotations on Querysets when JOINs are involved as Django does the wrong thing. Have you considered using a schemaless DB like MongoDB for

Re: Annotating a queryset without aggregation

2010-05-28 Thread Euan Goddard
Hi Tom, Whilst Django annotation is great, it is rather simplistic in nature and can only do very basic Count, Sum, Avg, etc. which do not allow any filtering (i.e. a WHERE clause in the SQL). Unless there are major differences in 1.2 (which I haven't seen) then you won't be able to do what you

Re: problems with authentication of test client

2010-05-28 Thread irum
'c' is written here by mistake, I was trying different things by and commented out the wrong statement while pasting. It was, r = self.client.post('/createauction/', post_data) Also, could the problem be with my Python version 2.6.5 and Django 1.1.1 as stated in this thread:

Annotating a queryset without aggregation

2010-05-28 Thread Tom Evans
Hi all I want to annotate a qs with a computed field from one of its current fields, and then filter on the annotated field. I cannot work out how I'm supposed to do this in the ORM (or even if I can). Basically, I have a model with a username field, that in this case contains an email address.

Re: password reset getting error - 'function' object is not iterable

2010-05-28 Thread Nuno Maltez
At a first glance it looks like a problem with your urls. Could you show us your custom template and url definitions from urls.py? Nuno On Thu, May 27, 2010 at 7:10 PM, Pankaj Singh < singh.pankaj.iitkg...@gmail.com> wrote: > > > > > Exception Value: > > 'function' object is not iterable > > >

Re: problems with authentication of test client

2010-05-28 Thread Daniel Roseman
On May 28, 9:23 am, irum wrote: > import unittest > from django.test.client import Client > from django.test import Client, TestCase > from django.contrib.auth import authenticate > from django.contrib.auth.models import * > from django.core import mail > import datetime

Re: Installation problem (version 1.2.1)

2010-05-28 Thread Daniel Roseman
On May 28, 9:56 am, Derek wrote: > I have just upgraded my version of Ubuntu, which then also installed > Python 2.6.  I thought this was a good opportunity to upgrade to > Django 1.2.  I removed all traces of Django 1.1.1 that I could find, > along with extra

Installation problem (version 1.2.1)

2010-05-28 Thread Derek
I have just upgraded my version of Ubuntu, which then also installed Python 2.6. I thought this was a good opportunity to upgrade to Django 1.2. I removed all traces of Django 1.1.1 that I could find, along with extra plugins/modules/apps etc, and ran the install for Django 1.2.1, checking that

problems with authentication of test client

2010-05-28 Thread irum
Hi, I am trying to test my pages that need authentication. But, I am not able to test views that need authentication. I have tried following threads about logging in test client in this group and django documentation, but still cant figure out. This my view I am trying to test: def

Re: rendering to template help

2010-05-28 Thread Daniel Roseman
On May 27, 3:10 pm, Pirate Pete wrote: > hello again, > > i am trying to get a single entry from my db and then annotate the > count and rating to it like we established above > > however it doesn't seem to be returning anything: > videos = >

Re: admin: add save -> error

2010-05-28 Thread Philipp
Thanks a lot Karen, I did google and found some more info here: http://trac.turbogears.org/ticket/2133#comment:11 just as a note, this is an issue on Django Developer Kit 1.2.1 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: admin: add save -> error

2010-05-28 Thread Karen Tracey
On Fri, May 28, 2010 at 2:11 AM, Karen Tracey wrote: > Workarounds for you prior to getting a fix into Django would be to get rid > of the standalone hashlib that's apparently installed, or use a more recent > level of Python. > ...or use an older (e.g. 1.1.2) level of

Re: admin: add save -> error

2010-05-28 Thread Karen Tracey
On Thu, May 27, 2010 at 7:13 PM, Philipp wrote: > Hello Django Users > > I'm a beginner going through the tutorial. I do have a problem using > the admin interface. > I can't add new records. Save results in: http://dpaste.de/UoBH/ > If I'm using the shell, everything