Any Django framework command to freeze/wait/notify ?

2011-01-04 Thread vivek_12315
Hi all, This is a common scenario which many of you have faced. Say, I created a simple view file, in which user uploads a file and does some processing at backend and after processing is finished I am rendering a html page with some processed result. My problem is that, there should be some

PostGISAdapter error

2011-01-04 Thread Robinson B. Heath
I am getting the following error when the queryset tries to generate the SQL: "'str' object has no attribute 'ewkb'" Here is what I am doing that causes the problem: shapes = Shape.objects.filter(geom__bboverlaps=bbx) shape_info = shape_info.filter(shape__in=shapes) Models are:

ContentType does not exist when trying to load auth with loaddata

2011-01-04 Thread Eric Chamberlain
Hi, We are trying to migrate databases and we are running into problems. We can dump the data: ./manage.py dumpdata --format=xml --natural --all --traceback auth > auth.xml But when we try and load it, we get an exception: ./manage.py loaddata --database=mysql auth.xmlInstalling xml fixture

Re: cannot login to admin site with superuser

2011-01-04 Thread xpanta
python manage.py shell works normally. It gives me the interactive console On 4 Ιαν, 22:05, Shawn Milochik wrote: > What happens when you try 'manage.py shell'? > > Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Still mystified by mod_wsgi traceback ...

2011-01-04 Thread Karen Tracey
On Mon, Jan 3, 2011 at 4:36 PM, Stephen Waterbury < stephen.c.waterb...@nasa.gov> wrote: > I posted the traceback I'm getting -- http://dpaste.com/293813/ > I'm still completely mystified. The traceback directs me to: > "Edit your MIDDLEWARE_CLASSES setting to insert >

Re: A few beginner questions

2011-01-04 Thread Shawn Milochik
Hi Ondřej. For your question #1, you could create a field in the model itself and then use signals[1] to populate it upon the saving of a "vote" instance. #2: The validation should all be done during form validation[2], prior to save. Using a Form or ModelForm. That way, the user can get

Re: how to raise an error on django admin

2011-01-04 Thread Daniel Carvalho
I think the way to do is: from django.contrib import messages then somewhere... messages.add_message(request, messages.ERROR, "your error message") The message will be displayed in the top of the next admin page On 01/03/2011 09:40 PM, Acorn wrote: > I'd like to know this too. > > On 3

Re: Setup issue

2011-01-04 Thread Mike Ramirez
On Tuesday, January 04, 2011 03:33:17 pm Phil wrote: > Hi Shawn, > > When it wasn't working I tried both from command line and from > interpreter, from command line just says "command not found". No I > wasn't calling the project that, I've tried a few different project > names and none seem to

Re: Redirecting to last view after login.

2011-01-04 Thread keynesiandreamer
Anybody? Bueller? On Jan 2, 8:25 pm, keynesiandreamer wrote: > I have wrestled with this one for a bit and googled and looked through > documentation, so I guess its time to ask. > > I am trying make my app redirect to the last viewed page after logging > in. I am

multiple x__search

2011-01-04 Thread ckohrman
I'm using __search to boolean search for a list of words within two separate lists (requiredTags, preferredTags). Line 10 is the one I have questions about. I want to see if the list of words (requTags) is found among requiredTags or preferredTags. requTags=""

Re: Setup issue

2011-01-04 Thread Phil
Hi Shawn, When it wasn't working I tried both from command line and from interpreter, from command line just says "command not found". No I wasn't calling the project that, I've tried a few different project names and none seem to work. Thanks for advice/ tips. I'll keep posted when I get to the

Re: automated testing: how to generate human-verifiable views?

2011-01-04 Thread Jennifer Bell
OK, to elaborate: I have a open source project with consistent pain points around css and browser testing. Example concrete issues for this project are a) multi-language support, as varying text length will often throw off the aesthetics of the layout, and b) recently, a mysterious failure in

Re: automated testing: how to generate human-verifiable views?

2011-01-04 Thread Nick Stinemates
Can you elaborate a bit? Are you interested in having the ui render and generate a screen shot for human review? That's how I interpreted your question. If that's the case, look in to generating a screenshot by leveraging a tool that generates a png from HTML. I am eager to hear what others

A few beginner questions

2011-01-04 Thread Ondřej Mirtes
Hello, I am experienced PHP developer (and by PHP I mean advanced programming with MVC frameworks, TDD, ORM libraries, design patterns and such, so no scoffing please :)) and I would like to try something new. I've chosen Python and Django and I am building my bachelor thesis project with it. I

automated testing: how to generate human-verifiable views?

2011-01-04 Thread Jennifer Bell
Hi, I'm trying to figure out the best way of doing something I'd like to partially automate staging testing by generating a sequence of human verifiable views, with the goal of making sure my app views/css/ 3rd-party javascript etc. are drawing the way they ought to in more complicated

Re: Using A Form

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 8:55:50 PM UTC, hank23 wrote: > > I'm in the process of coding a new screen which I want to use a form > on. I'm also currently coding the new form to go with it. The screen > will have a dropdown box, a conditional textbox, and a submit button, > as well as some

Using A Form

2011-01-04 Thread hank23
I'm in the process of coding a new screen which I want to use a form on. I'm also currently coding the new form to go with it. The screen will have a dropdown box, a conditional textbox, and a submit button, as well as some other informational fields and a title on it. Since this is my first

Re: How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-04 Thread Chris Seberino
Nevermind. I figured it out. To only have subdirs by static you need to add a "/" at the end of an Alias line... e.g. Alias /books/ /some/static/dir/ Thanks! cs -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Setup issue

2011-01-04 Thread Shawn Milochik
What actual project name are you using? Have you tried using different project names? If you're literally using "projectname" then you may be using a command-line argument and causing a conflict. Shawn -- You received this message because you are subscribed to the Google Groups "Django

Re: Setup issue

2011-01-04 Thread CG
Are you running "django-admin.py startproject projectname" within the python interpreter? Its supposed to run outside of the interpreter on the command line. On Jan 4, 3:17 pm, Phil wrote: > Hi all, > > I am having a setup issue on my personal laptop, I got through setup > and

Setup issue

2011-01-04 Thread Phil
Hi all, I am having a setup issue on my personal laptop, I got through setup and couple of tutorials on my Mac in work but not having any joy at home. I'm running Ubuntu 10.04 Lucid Lynx. I run "import django" and I don't get any errors back so I thought I was OK, but when I run "django-admin.py

Re: Custom queryset on a ModelForm field

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 7:42:16 PM UTC, mrmclovin wrote: > > Hi, > > I have a 'project' model > > class Project(models.Model): > title = models.CharField(max_length=100) > links = models.ManyToManyField('Link', related_name='link') > > and a 'link' model > > class Link(models.Model): >

Re: form handling in views.py

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 6:31:30 PM UTC, gintare wrote: > > Maybe smbd could give advice how data submitted from custom.html to > views.py are handled further? > > > custom.html with method search1 ## > > > {% if Lp %} > {% for item in Lp %} > > > > >

Re: cannot login to admin site with superuser

2011-01-04 Thread Shawn Milochik
What happens when you try 'manage.py shell'? 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-us...@googlegroups.com. To unsubscribe from this group, send email to

Custom queryset on a ModelForm field

2011-01-04 Thread Simon W
Hi, I have a 'project' model class Project(models.Model): title = models.CharField(max_length=100) links = models.ManyToManyField('Link', related_name='link') and a 'link' model class Link(models.Model): label = models.CharField(max_length=50) url =

Re: cannot login to admin site with superuser

2011-01-04 Thread xpanta
Thanks, These are my only imports: import os.path import logging And this is my INSTALLED_APPS section INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'myproject.main', )

Re: Syntax Error

2011-01-04 Thread hank23
OK. There were some problems with my django installation, due to the OS upgrade on my machine, and things which were missing in at least one environment variable. Since correcting these problems the basic functionality of my tutorial site appears to be working again. Now I appear to have at least

form handling in views.py

2011-01-04 Thread gintare
Maybe smbd could give advice how data submitted from custom.html to views.py are handled further? custom.html with method search1 ## {% if Lp %} {% for item in Lp %} {{item.Word}} {{item.dateWord}} {% endfor %} {% endif %}

Re: Syntax Error

2011-01-04 Thread cewing
Is it possible that the problem is not in this urls.py, but rather in 'polls.urls'? I'd check line 20 there, just to see if there's an obvious python syntax error. HTH c On Jan 4, 8:08 am, hank23 wrote: > After removing the commented code, saving urls.py, restarting the

Re: How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-04 Thread Chris Seberino
On Jan 4, 2:48 am, Graham Dumpleton wrote: > If using Apache/mod_wsgi it is quite simple, and wouldn't even need URL > rewriting as suggested by others. > > So, what are you hosting it with. Yes I am using mod_wsgi. The following line sends all URLs to WSGI script

Re: cannot login to admin site with superuser

2011-01-04 Thread Shawn Milochik
On Jan 4, 2011, at 4:15 AM, xpanta wrote: > is there any hope for me? Does your settings.py file do any imports? If there is a problem with an import you'll have a major disaster and the cause may not be obvious from the error message. Shawn -- You received this message because you are

Re: build application from admin code

2011-01-04 Thread Shawn Milochik
Now that you're luxuriating in the "done for you" aspect of Django, check out the ModelForm object. It gives you the goodness you seek. I don't think that setting up your URL system the way you describe is a good idea. It's a complete security failure, so you'd have to handle permissions

Re: Changing a constraint with live data

2011-01-04 Thread Shawn Milochik
You could do this with South in multiple steps. 1. South schema migration: Add the new field for the proper foreign key, but don't make the field required. 2. South data migration: Create a migration that appropriately populates the new field based on whatever rules you have. 3.

Re: Syntax Error

2011-01-04 Thread hank23
After removing the commented code, saving urls.py, restarting the server and then requesting the sites admin page now I get the admin login screen. But after I type in my username and pw then it again gives me the following screen: TemplateSyntaxError at /admin/ Caught SyntaxError while

Re: Syntax Error

2011-01-04 Thread Piotr Zalewa
what happens if you'remove the commented lines? On 01/04/11 15:22, hank23 wrote: > Can someone explain to me what the following error is trying to tell > me: > > SyntaxError at /polls/1 > invalid syntax (urls.py, line 20)Request Method: GET > Request URL: http://127.0.0.1:8000/polls/1 > Django

Syntax Error

2011-01-04 Thread hank23
Can someone explain to me what the following error is trying to tell me: SyntaxError at /polls/1 invalid syntax (urls.py, line 20)Request Method: GET Request URL: http://127.0.0.1:8000/polls/1 Django Version: 1.2.3 Exception Type: SyntaxError Exception Value: invalid syntax (urls.py, line 20)

Re: ImportError cannot import name DetailView

2011-01-04 Thread Anthony Pearce
That could be it. I downloaded the latest official version, 1.2.4. I totally overlooked that comment at the top. On Jan 5, 12:13 am, Daniel Roseman wrote: > On Tuesday, January 4, 2011 3:07:58 PM UTC, Anthony Pearce wrote: > > > While completing "Writing your first Django

Re: ImportError cannot import name DetailView

2011-01-04 Thread Daniel Roseman
On Tuesday, January 4, 2011 3:07:58 PM UTC, Anthony Pearce wrote: > > While completing "Writing your first Django app, part 4", I ran into > an error. I have almost completed the online tutorial, but using the > code verbatum, I get this error. I even went as far as to cut and > paste the code,

ImportError cannot import name DetailView

2011-01-04 Thread Anthony Pearce
While completing "Writing your first Django app, part 4", I ran into an error. I have almost completed the online tutorial, but using the code verbatum, I get this error. I even went as far as to cut and paste the code, rather than typing it as I usually do, just in case I made a simple error I

MVC (mtv!) schema...

2011-01-04 Thread marco
hi! i'm reading the djangobook, and it ocurred to me this drawing, to graphic the mtv concept. hope you like it, and you are free to use it! http://marcobernich.blogspot.com/2011/01/mvc.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To

build application from admin code

2011-01-04 Thread Santiago Caracol
Hello, I just started using Django and I am still "marvelling at all the code I didn't have to write". I wonder if this code, the admin interface, could be used for the application itself. I would like to do something like this: Each user of my application gets his very own predefined objects of

Re: Django dev server issue

2011-01-04 Thread Brian Bouterse
It sounds like it wasn't able to be reproduced with pdb. I think that should be looked into further. Brian On Tue, Jan 4, 2011 at 6:57 AM, daniels wrote: > Ok, so i used pdb and did a line by line pass, but i didn't get anything. > All data seems to be normal. I even

Serialize in django witha query set that contains defer

2011-01-04 Thread jorge
Hi, i have i little problem, and that is how can serialize a django query with defer ? I have this model : class Evento(models.Model): nome=models.CharField(max_length=100) descricao=models.CharField(max_length=200,null=True) data_inicio= models.DateTimeField()

Re: models queryset and permissions

2011-01-04 Thread MarcoS
The ModelMultipleChoicheField will return Esame objects -- 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

models queryset and permissions

2011-01-04 Thread MarcoS
Hi people, probably I'm making a mountain out of a molehill but I can't figure how to solve this problem; I've a form with a ModelMultipleChoiceField. The queryset will contains all models for which the user has a particular permission (django.contrib.auth.models.Permission) (can_add). This is

Re: Django dev server issue

2011-01-04 Thread daniels
Ok, so i used pdb and did a line by line pass, but i didn't get anything. All data seems to be normal. I even edited socket.py and did a print on data to see what's going on and everything seems normal.. :( so i'm left with no idea I guess i'll have to get used with this hangs. -- You received

Re: Changing a constraint with live data

2011-01-04 Thread Thomas Guettler
I use south for migrations. I have done something like this with south, but with postgres not mysql. I don't know if mysql supports deferrable foreign key constraints. Thomas Sithembewena Lloyd Dube wrote: > Hi everyone, > > Happy 2011. > > I am having an interesting problem where I need to

Re: Problem with models

2011-01-04 Thread Quetzacotl
I have added related_name to text1 and text2, so at least syncdb worked, but how can I now make this query. In manager: self.compare_set.filter(~Q(Q(compare__user=request.user)(Q(compare__text1__id=id)| Q(compare__text2__id=id.all() this doesn't work -- You received this message because

Problem with models

2011-01-04 Thread Quetzacotl
I have model of text, like that: class Text(models.Model): text = models.CharField() user = models.ForeignKey(User) #author And i need to compare two of texts, so i need table like this: class Compare(models.Model): text1 = models.ForeignKey(Text) text2 =

Changing a constraint with live data

2011-01-04 Thread Sithembewena Lloyd Dube
Hi everyone, Happy 2011. I am having an interesting problem where I need to change the foreign key on a model (A) to reference a different model. problem is, the table for A is populated with records and MySQL does not seem able to drop it. I ran manage.py sql and would like to drop the existing

Re: Contact form doesn't see user as logged in

2011-01-04 Thread Catalyst
Thank you, this worked. I appreciate the fast response Łukasz. On Jan 3, 11:38 pm, Łukasz Rekucki wrote: > On 4 January 2011 02:27, Catalyst wrote: > > >  I am having trouble with a contact form on my site. Whenever I hit > > the page, it doesn't see

Re: cannot login to admin site with superuser

2011-01-04 Thread xpanta
is there any hope for me? -- 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.com. For more

Re: How configure Django to handle /books URL and yet allow access to PDFs/images in subdirs of /books?

2011-01-04 Thread Graham Dumpleton
On Tuesday, January 4, 2011 2:54:25 PM UTC+11, Chris Seberino wrote: > > How configure Django to handle /books URL and yet allow access to PDFs > and images in subdirs of /books? > > Specifically, I want /books to be a dynamic page with lots of links to > PDFs and images of book covers