Re: unknown column in field list

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 18:56 -0700, nixon66 wrote: > I have a legacy database that I used inspectdb to create the models. > I cleaned up the models, set primary keys, foriegn keys etc. But when > I tried to create a view I get an "unknown column activity.fp_id_id > in field list". I'm not sure

unknown column in field list

2009-04-11 Thread nixon66
Forgot to add the view I'm using. def country_detail(request, country): c = Country.objects.get(slug=country) lobbyists = Activity.objects.filter(country=c) return render_to_response('country/country_detail.html', {'country':c, 'lobbyists':lobbyists})

Re: unknown column in field list

2009-04-11 Thread nixon66
oh, forgot to add the view I'm using. Here is the view. def country_detail(request, country): c = Country.objects.get(slug=country) lobbyists = Activity.objects.filter(country=c) return render_to_response('country/country_detail.html', {'country':c, 'lobbyists':lobbyists}) On Apr

unknown column in field list

2009-04-11 Thread nixon66
I have a legacy database that I used inspectdb to create the models. I cleaned up the models, set primary keys, foriegn keys etc. But when I tried to create a view I get an "unknown column activity.fp_id_id in field list". I'm not sure why its appending an extra id to the end of a foriegnkey

Re: UnpickleableError when sessions are saved

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 9:45 PM, Iqbal Abdullah wrote: > > Hi guys, > > In one of our views, we're getting the error below: > > Traceback (most recent call last): > File "/usr/lib/python2.5/site-packages/django/core/servers/ > basehttp.py", line 278, in run >self.result

UnpickleableError when sessions are saved

2009-04-11 Thread Iqbal Abdullah
Hi guys, In one of our views, we're getting the error below: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 17:40 -0700, adelein wrote: > Hi Zain, > > The thing is that I was able to access the main page before I changed > the urls.py file, so I think that means that the port isnt being > blocked. Something to do with the urls.py file is messed up : ( Then go back and try things

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Hi Zain, The thing is that I was able to access the main page before I changed the urls.py file, so I think that means that the port isnt being blocked. Something to do with the urls.py file is messed up : ( Thanks On Apr 11, 5:35 pm, Zain Memon wrote: > Since no messages

Re: Admin in frontend

2009-04-11 Thread Marcello Parra
OK Malcom Thanks again... I will play some more with it. Marcello On 4/11/09, Malcolm Tredinnick wrote: > > On Sat, 2009-04-11 at 21:10 -0300, Marcello Parra wrote: >> Hello Malcom, >> >> Thanks for your help... >> I think of a frontend as the user part of the

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Zain Memon
Since no messages are shown in the log, the connection is most likely being blocked somewhere upstream. Check that you've allowed port 8001 through any firewalls or routers you have set up. Zain On Sat, Apr 11, 2009 at 5:23 PM, adelein wrote: > > This is the server output: >

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
This is the server output: [r...@bellatrix djangoblog]# python manage.py runserver 93.186.171.54:8001 Validating models... 0 errors found Django version 1.1 beta 1 SVN-10504, using settings 'djangoblog.settings' Development server is running at http://93.186.171.54:8001/ Quit the server with

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Yes, and I see no errors there. Still the admin page does not load at all. I cant find any similar problems through google. On Apr 11, 5:17 pm, Malcolm Tredinnick wrote: > On Sat, 2009-04-11 at 17:09 -0700, adelein wrote: > > > Hi, > > > Sorry, I meant to say urls.py

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 17:09 -0700, adelein wrote: > > Hi, > > Sorry, I meant to say urls.py of course. So, given I did put the code > in the right file, the problem still remains. If you're following the tutorial, then you will be running the development server. So all "server log" style

Re: Admin in frontend

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 21:10 -0300, Marcello Parra wrote: > Hello Malcom, > > Thanks for your help... > I think of a frontend as the user part of the site... where I will > provide users pages with proper layout and the admin site, is the one > provided by django admin where I would manage some

Re: Admin in frontend

2009-04-11 Thread Marcello Parra
Hello Malcom, Thanks for your help... I think of a frontend as the user part of the site... where I will provide users pages with proper layout and the admin site, is the one provided by django admin where I would manage some tables, with default django layout... You must consider that I very

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Hi, Sorry, I meant to say urls.py of course. So, given I did put the code in the right file, the problem still remains. -Adelein On Apr 11, 1:58 pm, Daniel Roseman wrote: > On Apr 11, 8:42 pm, adelein wrote: > > > > > Hi, > > >

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 7:24 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sat, 2009-04-11 at 19:23 -0400, Alex Gaynor wrote: > [...] > > > > > > Even if your application is exclusively for your own usage, it's not > > uncommon for the pointy haired boss to come in with

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 19:23 -0400, Alex Gaynor wrote: [...] > > > Even if your application is exclusively for your own usage, it's not > uncommon for the pointy haired boss to come in with requests to change > a URL hierarchy, and there's no reason to create more work for > yourself.

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 7:21 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sat, 2009-04-11 at 17:49 -0500, James Bennett wrote: > > On Sat, Apr 11, 2009 at 5:13 PM, codecowboy wrote: > > > I've followed some examples from around the Django community and

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 17:49 -0500, James Bennett wrote: > On Sat, Apr 11, 2009 at 5:13 PM, codecowboy wrote: > > I've followed some examples from around the Django community and that > > is why I use the reverse() method at all. What is the point of using > > the reverse()

Re: Template filter with plural tag [Solved]

2009-04-11 Thread Kless
Thanks! It works as charm. On 11 abr, 22:54, Malcolm Tredinnick wrote: > Indeed, this is possible. You need to use a number for the counting > portion of the blocktrans-plural combination, so that gettext can use > the number to determine the plural form. The trick is

Re: how to use email instead of username for user authentication?

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 07:52 -0700, pkenjora wrote: > Malcom, Well, I'm not "Malcom" (sic), but I'll reply anyway. >Google, FaceBook, and LinkedIn have been using email authentication > for how long now? With the default constraints you've put on Django a > developer would have to "work

Re: Template filter with plural tag

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 12:40 -0700, Kless wrote: > I would to pluralize into a translation block [1] but I also want to > apply the 'apnumber' template filter [2] > --- > {% load humanize %} > {% load i18n %} > > {% blocktrans count list|apnumber as number %} > There is {{ number }}

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread James Bennett
On Sat, Apr 11, 2009 at 5:13 PM, codecowboy wrote: > I've followed some examples from around the Django community and that > is why I use the reverse() method at all.  What is the point of using > the reverse() method? Well, there's a problem you'll run into fairly often.

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Mike Ramirez
On Saturday 11 April 2009 03:13:18 pm codecowboy wrote: > What is the point of using the reverse() method? > I'm answering this because I want to make sure that my idea of it is the same as the rest of the community and would definately like feedback on it. Using this example: urlpatterns =

Re: Admin in frontend

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 11:51 -0300, Marcello Parra wrote: > Hello, > > I'm planning a site with django. > It need to have some functionalities that are very similar to Django's > admin (like CRUD in some tables, with validations, etc...). But I > would not like to have two sections (frontend and

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread codecowboy
I've followed some examples from around the Django community and that is why I use the reverse() method at all. What is the point of using the reverse() method? On Apr 11, 5:03 pm, Daniel Roseman wrote: > On Apr 11, 7:57 pm, codecowboy

Re: Port in use Error

2009-04-11 Thread rajeev
Hi, I'm in the exact same situation " Validating models... 0 errors found Django version 1.0.2 final, using settings 'mylu.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Error: That port is already in use. " but the solution above doesn't

Re: Cannot call a custom model method in my view

2009-04-11 Thread codecowboy
Thank you Daniel. I got it working. That link that you gave me helped me to figure it out. I'm curious though, is there ever a reason in Django to define a method in a model class or would I always use a custom manager method? I'm going to post my code here for anyone who has the same

Re: Tutorial - include question

2009-04-11 Thread Johann Spies
2009/4/11 Alex Gaynor : > mysite/urls.py needs to have the full urlpatterns = thing like the > polls/urls.py has so it would look like: > > from django.conf.urls.defaults import * > > admin.autodiscover() > > urlpatterns = patterns('', > (r'^polls/',

Re: how to use email instead of username for user authentication?

2009-04-11 Thread Karen Tracey
On Sat, Apr 11, 2009 at 10:52 AM, pkenjora wrote: > > You are correct, username authentication has always been around. > However, the explicit banning and obfuscating of email authentication > in the default module has not. That is the part that worries me, that > is where

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Daniel Roseman
On Apr 11, 7:57 pm, codecowboy wrote: > Every time that a load a form on my site, I see the following errors. > If I reload the page, they go away and everything works just fine. > Does anyone know why?  Thank you in advance. > > TemplateSyntaxError at /eaccounts/register/ >

Re: Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread Daniel Roseman
On Apr 11, 8:42 pm, adelein wrote: > Hi, > > Myhttp://localhost:8000/adminpage is hanging in the django server > and I get "Error 320 (net::ERR_INVALID_RESPONSE): Unknown error." > after a while. > > I am running on fedora 7. > > I am following the django tutorial and I am

Re: Cannot call a custom model method in my view

2009-04-11 Thread Daniel Roseman
On Apr 11, 9:25 pm, codecowboy wrote: > I've read some other posts regarding this issue as well as the > following article:http://www.b-list.org/weblog/2007/nov/03/working-models/. > I cannot seem to get this thing to work.  Thank you in advance for any > help.  Here is my

Re: Tutorial - include question

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 4:16 PM, Johann Spies wrote: > > Working through the tutorial everything went well until I came to the > section "Decoupling the URLconfs" where > the "include" option for urls in a subdirectory is not working as > advertised. > > What did I do

Tutorial - include question

2009-04-11 Thread Johann Spies
Working through the tutorial everything went well until I came to the section "Decoupling the URLconfs" where the "include" option for urls in a subdirectory is not working as advertised. What did I do wrong? In mysite/urls.py I have: == from

Django admin page hangs in django server - where is web server error log?

2009-04-11 Thread adelein
Hi, My http://localhost:8000/admin page is hanging in the django server and I get "Error 320 (net::ERR_INVALID_RESPONSE): Unknown error." after a while. I am running on fedora 7. I am following the django tutorial and I am using the latest svn django version. After I set this in the

Cannot call a custom model method in my view

2009-04-11 Thread codecowboy
I've read some other posts regarding this issue as well as the following article: http://www.b-list.org/weblog/2007/nov/03/working-models/. I cannot seem to get this thing to work. Thank you in advance for any help. Here is my code. -- view -- from django.db.models import

Re: Admin Inlines astray

2009-04-11 Thread Andy Wilson
fixed after trying all sorts of approaches I finally got it to work by chmod'ing o+r to the files under the django/contrib/admin directory. Most of them already had read permissions but I could see that a few didn't. a On Sat, 2009-04-11 at 19:58 +0100, Andy Wilson wrote: > ps. I used the

Template filter with plural tag

2009-04-11 Thread Kless
I would to pluralize into a translation block [1] but I also want to apply the 'apnumber' template filter [2] --- {% load humanize %} {% load i18n %} {% blocktrans count list|apnumber as number %} There is {{ number }} object. {% plural %} There are {{ number }} objects. {% endblocktrans

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-11 Thread George
There is an explanation below, having to do with management dependencies and dates the versions and packages became available. But for the record, the solution is to install the py-sqlite3 package in addition to py-djangoi (with sqlite enabled). --George On Sat 11 Apr 2009 at 08:25:04 PM +0200,

Re: Generic relations swamp

2009-04-11 Thread zayatzz
I realise im kind of spamming here, but does nobody really has encountered similar problem? Alan. On Apr 11, 12:07 am, zayatzz wrote: > Ok, I did some search on web and i took closer look at the > errormessage. : > > Request information > GET > > No GET data > POST >

Re: Multiple sites, single application in Django

2009-04-11 Thread creecode
Hello Russell, I can't say this is best practice but my approach to a similar goal has been to create projects for each website. These projects/websites are unrelated to each other as far as content goes but all install a common set of apps, some off the shelf, some custom. I have sites

Re: Admin Inlines astray

2009-04-11 Thread Andy Wilson
ps. I used the 'song' and 'recording' models as an example, in fact I have several apps that use inlines, and on the one installation they are missing in every case. No errors are thrown and I can see nothing relevant in the logs. On Sat, 2009-04-11 at 19:50 +0100, Andy Wilson wrote: > has

every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread codecowboy
Every time that a load a form on my site, I see the following errors. If I reload the page, they go away and everything works just fine. Does anyone know why? Thank you in advance. TemplateSyntaxError at /eaccounts/register/ Caught an exception while rendering: Tried edit in module

Admin Inlines astray

2009-04-11 Thread Andy Wilson
has anyone any idea why the inlines might go missing? I have a model 'song' and a model 'recording'. I've created a recordingInline class, and in the modelAdmin I set: inlines = [recordingInline] this all works fine on my Ubuntu installation running python 2.5.2 and django 1.0.2, but on another

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-11 Thread George
Hi Karen, On Apr 8, 2:33 am, Karen Tracey wrote: > On Tue, Apr 7, 2009 at 8:39 PM, George wrote: > > > I'm pretty sure this shouldn't happen; but the error is no doubt my > > fault. Maybe something about the doc doesn't apply to my system? I > > have

Fewer columns in admin popups

2009-04-11 Thread Dave Benjamin
Hello, In the Django admin site, I find myself going back and forth between adding more columns to list_display to enhance the list view and then removing them when I realize that they make the list view too big for the popup version displayed when clicking on the add button or the raw_id_fields

Re: Generic relations and unit tests.

2009-04-11 Thread Stavros
I agree with you on this, but it is often impractical due to the volume of the data required. I have this data already in my database, I shouldn't have to spend a few days moving it to the tests file... Fixtures are a quick way to import your data to the test DB without having to recreate

Re: Registration form and Profile form is not saving

2009-04-11 Thread Daniel Roseman
On Apr 11, 3:55 pm, Praveen wrote: > Hi all, i am really fed up and have tried number of way. Please read > my last line which really describe where i am facing problem. > First Attempt. > Problem:Data is saving for register and contact but for profile i get >

Multiple sites, single application in Django

2009-04-11 Thread Russell McConnachie
Hello, I am new to Django, I've been reading over the Django "Sites" Model framework but I still have not come up with a creative way to design a site which hosts multiple sites - providing different html layouts, style sheets. I am looking for someone to kind of explain to me some best

Registration form and Profile form is not saving

2009-04-11 Thread Praveen
Hi all, i am really fed up and have tried number of way. Please read my last line which really describe where i am facing problem. First Attempt. models.py - class UserProfile(models.Model): user = models.ForeignKey(User, unique=True, verbose_name=_ ('user')) gender =

Re: how to use email instead of username for user authentication?

2009-04-11 Thread pkenjora
Malcom, Google, FaceBook, and LinkedIn have been using email authentication for how long now? With the default constraints you've put on Django a developer would have to "work around" the out of the box code to make the project behave like the big 3 names on the web. In this light it sounds

Admin in frontend

2009-04-11 Thread Marcello Parra
Hello, I'm planning a site with django. It need to have some functionalities that are very similar to Django's admin (like CRUD in some tables, with validations, etc...). But I would not like to have two sections (frontend and admin) in it So, my question is: is there a way to use already

[ANN] Falcon - powering innovation

2009-04-11 Thread Kless
If anybody is interesed in new technologies, you'll love this new language called Falcon [1], which has been open sourced ago little time. Falcon is a scripting engine ready to empower mission-critical multithreaded applications. It provides six integrated programming paradigms: procedural,

Schema-less models

2009-04-11 Thread Dmitry Kuchin
In the project I'm working on it makes a lot of sense to store pretty much everything in 1-2 models, as there are a lot of common operations being done on any object or property - moderation, versioning, etc. I wanted to have something similar to this approach:

Re: Default mimetype

2009-04-11 Thread Malcolm Tredinnick
On Fri, 2009-04-10 at 23:40 -0700, Roman Timushev wrote: > Hello, > > My application serves content with different mimetypes: 'application/ > xhtml+xml', 'application/xml', 'application/json'. Specifying mimetype > for every view is not DRY. Is it possible to define default mimetype > for url

Re: Easy way to create pretty pages with nav?

2009-04-11 Thread Konrad Martin
Hi I think a 'problem' of Django is that it is produced by programmers and doesn`t mention that programming is the minor important part of a successfull site. Far more important is content and the visual way content is presented in a brain catching way to the customer. Both isn`t comprised in

Re: Foreign Key query question

2009-04-11 Thread nikita kozlovsky
On Apr 11, 12:32 pm, Malcolm Tredinnick wrote: > That's definitely a small bug, then. I've opened ticket #10790 so that > it gets fixed eventually. Since it's not a functionality bug (the answer > is still correct), it will be fixed after 1.1 now, but we will fix it.

Re: Default mimetype

2009-04-11 Thread Alex Koshelev
There is no such capabilities. Write your own set of decorators that will be path response object with needed mimetype - almost DRY solution. On Sat, Apr 11, 2009 at 10:40 AM, Roman Timushev wrote: > > Hello, > > My application serves content with different mimetypes:

Re: Modifying the User model

2009-04-11 Thread Davide
That's the workaround we were about to implement. But what I was searching for, was a more consistent way to modify the **model** itself (which will be reflected into the database structure and consequently in the forms), not the way Django handles the forms. I think Django choice isn't so silly,

Default mimetype

2009-04-11 Thread Roman Timushev
Hello, My application serves content with different mimetypes: 'application/ xhtml+xml', 'application/xml', 'application/json'. Specifying mimetype for every view is not DRY. Is it possible to define default mimetype for url groups? Roman --~--~-~--~~~---~--~~

Re: Foreign Key query question

2009-04-11 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 01:02 -0700, nikita kozlovsky wrote: > On Apr 11, 3:11 am, Malcolm Tredinnick > wrote: > > > > Django's SQL is going exactly what you suspect and not using any outer > > join here. Using a simplified version of the original two models: > > > >

Re: How to keep the translations for the templates from different applications separately?

2009-04-11 Thread Valery
for those who is interested, the issue is solved: http://groups.google.com/group/pinax-users/browse_thread/thread/58d45dab96840ee5/0f62760ab5223b2e regards valery On Apr 7, 8:27 pm, Valery wrote: > Hi > > no answers... does it mean that it is impossible in Django to

Re: Foreign Key query question

2009-04-11 Thread nikita kozlovsky
On Apr 11, 3:11 am, Malcolm Tredinnick wrote: > Django's SQL is going exactly what you suspect and not using any outer > join here. Using a simplified version of the original two models: > >         class Student(models.Model): >            ... > >         class

Re: SQL Between query in sqlite3

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 2:44 AM, Kenneth Gonsalves wrote: > > On Saturday 11 April 2009 11:16:52 Nalini wrote: > > select * from Table where dates BETWEEN '2009-01-01' AND '2009-01-31' > > Can any one help me? > > Model.objects.filter(mydate__gte='2009-01-01' >

Re: SQL Between query in sqlite3

2009-04-11 Thread Kenneth Gonsalves
On Saturday 11 April 2009 11:16:52 Nalini wrote: > select * from Table where dates BETWEEN '2009-01-01' AND  '2009-01-31' >  Can any one help me? Model.objects.filter(mydate__gte='2009-01-01' ).filter(mydate__lte='2009-01-31') -- regards kg http://lawgon.livejournal.com

SQL Between query in sqlite3

2009-04-11 Thread Nalini
Hi, I am using django, python and sqlite3 for my web page. I want the datas from the database between two dates. how do i handle it in django. i want the query for this select * from Table where dates BETWEEN '2009-01-01' AND '2009-01-31' Can any one help me?

Re: Dereferencing One-to-Many Relationships in Templates

2009-04-11 Thread Anthony
Ahh...never mind! I tried doing a {% for S.M %} that didn't work, but {% for S.M.all %} did thanks for being my sounding board... On Apr 10, 10:38 pm, Anthony wrote: > Hello, > > I'm passing queryset 'S' to a template.  S has several attributes, M, > N and O. > > M has