Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread Rishabh Manocha
On Thu, Oct 29, 2009 at 2:47 PM, sridharpandu wrote: > > Hi, > > I ran the syncdb command to create the tables for INSTALLED_APPS. I > get the errors as shown in the output below. Can someone tell me > what's wrong. I am using a laptop that runs Django as well as the > MySQL database . > > srid...

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread Kenneth Gonsalves
On Thursday 29 Oct 2009 12:17:56 pm sridharpandu wrote: > raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb > module: No module named MySQLdb > you need MysSQLdb to connect to the database, either it is not in

Re: Using django form

2009-10-29 Thread Daniel Roseman
On Oct 29, 6:38 am, Denis Bahati wrote: > Hi all, > I've gone through and successfully made the poll application and I've > begun to play around and tried to change a few things. The first thing > I would like to do is have the user vote without login to django admin. ie > creating my own form wh

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread sridharpandu
Thanks. That was quick. I use Ubuntu 9.04 (jaunty). I am unable to figure out the location of MySQLdb. A "WHEREIS MySQLdb" at the command prompt returned MySQLdb: Is there a way to figure out Best regards Sridhar On Oct 29, 12:07 pm, Kenneth Gonsalves wrote: > On Thursday 29 Oct 2009 12:17:56

Re: Sharing data between two Django sites

2009-10-29 Thread Benjamin Wohlwend
Hi, On Oct 27, 11:44 am, Graham Dumpleton wrote: > > One could simply overlay URLs from one instance over another. > > For example, using mod_wsgi you should be able to do: > >   WSGIScriptAlias / /some/path/public/site.wsgi >   WSGIScriptAlias /staff-members /some/path/intranet/site.wsgi/staff

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread Skylar Saveland
If you are not in a virtualenv with -no-site-packages then you should be able to just: sudo aptitude install python-mysqldb sridharpandu wrote: > Thanks. That was quick. I use Ubuntu 9.04 (jaunty). I am unable to > figure out the location of MySQLdb. A "WHEREIS MySQLdb" at the command > prompt

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread sridharpandu
Skylar Thanks. It works. Here is the trace. Should warning on line 2 be ignored? srid...@sridhar:~$ python manage.py syncdb /var/lib/python-support/python2.6/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet Creating table auth_permission C

Re: Using django form

2009-10-29 Thread Denis Bahati
Hi Daniel, Thanks for the document. I real appreciate. I have another question: How can I use my model and ModelForm to create a login screen? On Thu, Oct 29, 2009 at 10:14 AM, Daniel Roseman wrote: > > On Oct 29, 6:38 am, Denis Bahati wrote: > > Hi all, > > I've gone through and successfully

Re: navigation

2009-10-29 Thread elminio
Up Up On Oct 28, 11:42 am, elminio wrote: > Hi, > > I use generic view on updating objects. How to create button with > cancel that will always redirect me to the previous page ? > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribe

how could i specify column by using ManyToManyField ?

2009-10-29 Thread lijihuai
hello, everyone now, in the scene: there are some tables in my database, table novels: id (primary key), name table authors: id (primary key), name table author_novels: id (primary key), novel_id ( references novels(id) )

Re: how could i specify column by using ManyToManyField ?

2009-10-29 Thread Kenneth Gonsalves
On Thursday 29 Oct 2009 3:09:51 pm lijihuai wrote: > class Novel(models.Model): > name = CharField() > > class Author(models.Model): > name = CharField() > novels = models.ManyToManyField(Novel, db_table='author_novels') > > how could i map the columns novel_id and au

Re: Model design

2009-10-29 Thread Caisys
Dear Vinicius, What is the difference between: -- def __unicode__(self): return unicode(self.place)+' - '+self.nome -- and -- def __unicode__(self): return self.place+' - '+self.nome -- because the both seem to work and display the same inf

Is it possible to disable multithread in Django

2009-10-29 Thread Olli Wang
Hi, I used jump to package a Django application into a WAR file (You can find the instructions here: http://gitorious.org/jump/pages/DjangoWarUsingJump). The created WAR file worked fine on TomCat, but when I extracted the WAR file and uploaded the extracted directory to Google App Engine, it sho

Re: Colored HTTP status codes

2009-10-29 Thread Russell Keith-Magee
On Wed, Oct 28, 2009 at 8:39 AM, HARRY POTTRER wrote: > > I was looking around the trac for the django project and came across > this ticket: > > http://code.djangoproject.com/ticket/6385 > > It seemed like a pretty cool idea, and I hoped it would get to be > added to the 1.2 release. Then I saw

Re: Colored HTTP status codes

2009-10-29 Thread Karen Tracey
On Thu, Oct 29, 2009 at 7:32 AM, Russell Keith-Magee wrote: > > On Wed, Oct 28, 2009 at 8:39 AM, HARRY POTTRER wrote: > > > > I was looking around the trac for the django project and came across > > this ticket: > > > > http://code.djangoproject.com/ticket/6385 > > > > It seemed like a pretty co

multi-table inheritance: getting instances of parent class which are also instances of child class

2009-10-29 Thread James Harrison Fisher
Hi, I'm having some trouble with what I would have thought would be a simple query. Working with the multi-table inheritance examples Django gives: class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Restaurant(Place): s

Re: Colored HTTP status codes

2009-10-29 Thread Russell Keith-Magee
On Thu, Oct 29, 2009 at 7:41 PM, Karen Tracey wrote: > On Thu, Oct 29, 2009 at 7:32 AM, Russell Keith-Magee > wrote: >> >> On Wed, Oct 28, 2009 at 8:39 AM, HARRY POTTRER wrote: >> > >> > I was looking around the trac for the django project and came across >> > this ticket: >> > >> > http://code

Login users

2009-10-29 Thread Denis Bahati
Hi All, Am creating application using django/python, i want to create a login form where by normal users can login through the web and access the system, i have a background with PHP but new to python/django. How can I implement this login? Currently am using the Django Admin page for login the sy

Specifying Django Project/Application Templates

2009-10-29 Thread Johan
Hi. Is there a way to specify custom project (or what I call sites) and application templates. At present the python-admin.py startproject/ startapp uses the default templates that ships with django. I end up either having to create these myself or heavily modify them for my dev structure. It seem

Re: Login users

2009-10-29 Thread Johan
This link (http://docs.djangoproject.com/en/dev/topics/auth/) has helped me a lot. After working through this you will probably have some more questions :) On Oct 29, 2:33 pm, Denis Bahati wrote: > Hi All, > > Am creating application using django/python, i want to create a login form > where by

static list and start server process

2009-10-29 Thread Manuel Ignacio
Hello, i have a menu list stored at my database, i want to obtain it only at start server process, and later when add a menu entry this list should be updated, i have the following considerations: 1. I don't want a database query for every request, because menu entry list would be very low frecue

best approach for using email as username

2009-10-29 Thread Adrián Ribao
Hello, I need to use the email field as the username. I neet these: * Email must be unique * I should authenticate against the email * The admin should work I I should be able to create users with username = email address. I have a custom authentication method but I need more. I need to tell Dj

Re: {% url in templates

2009-10-29 Thread Alex Robbins
Maybe it is just me, but I feel like writing out the view functions like that is a beating. I just name[1] all the urls. Then the url tag is easy. I just do things like {% url home-page %} or {% url blog- index %}. If you set up a generic view in the views and name it, it will work like normal. [

Interrelated form fields

2009-10-29 Thread Julián C . Pérez
Hi all I have a question to make I'm tryng to build a form using the following models: --- in models.py class Client(models.Model): user = models.ForeignKey(User, verbose_name=u'associated user') telephone = models.CharField(u'Telephone number', max_length=33, blank=False, null=False) cla

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread Alex Robbins
The warning on line 2 is because you are using python2.6, default in Ubuntu9.04. You don't need to worry about it. It is just telling the authors of mysqldb that ImmutableSet is going away in newer versions of python. Not something you need to care about. On Oct 29, 3:37 am, sridharpandu wrote:

Re: Specifying Django Project/Application Templates

2009-10-29 Thread Bill Freeman
If I understand your problem correctly, you can already override such templates. If there is a template in your project's template directory with the same name and sub-path as that used by django base code or a system wide installed application, it will be used instead. Perhaps an example. Supp

Internal error on dreamhost when debug=False

2009-10-29 Thread Alessandro Ronchi
I don't know why this site: http://www.portaleaziende-bih.com/ works with debug=True, but If I put debug =False it gives a 500 internal error. I'm using mod_passenger on dreamhost. Logs just says [Thu Oct 29 07:02:38 2009] [error] [client x] Premature end of script headers: internal_error.htm

Re: Colored HTTP status codes

2009-10-29 Thread David De La Harpe Golden
Russell Keith-Magee wrote: > I'm not convinced that a single setting is the right approach for > this. It almost seems like this is something that we should be using > environment variables or a dot file (e.g., a .djangorc with system > wide Django settings) - although this introduces a dependen

Django tagging migration to GAE

2009-10-29 Thread DoubleD
I have a Django app that use a django-tagging. I need to port this application to GAE. So, the main problem is to migrate tagging part. It has a complicated model, that should be rewritten to work with Google store. I think tagging is very popular django app and someone has the same problem before

How to force an INNER JOIN (without raw SQL)?

2009-10-29 Thread Joey Mink
Hi, I'm a newbie integrating Django with a very large, legacy database. I have the following models (showing what I believe to be relevant): class StakeholderType(models.Model): stakeholdertypeid = models.IntegerField(primary_key=True, db_column='stakeholderTypeID') typename = models.Cha

Re: Filtering on model methods

2009-10-29 Thread pbzRPA
Thank you for your help. I guess I will have to create temp table etc and do it that way. It's a pity django does not provide this kind of functionality. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Specifying Django Project/Application Templates

2009-10-29 Thread Johan
The information you provided is very helpful and I have been wondering about overriding templates.However, my question pertain not to templates as in the templating system used in django but rather to the 'template' directories used by django-admin.py when the startproject and startapp commands ar

Re: static list and start server process

2009-10-29 Thread Javier Guerra
On Thu, Oct 29, 2009 at 7:48 AM, Manuel Ignacio wrote: > Hello, i have a menu list stored at my database, i want to obtain it > only at start server process, and later when add a menu > entry this list should be updated, i have the following > considerations: > > 1. I don't want a database query

Re: Filtering on model methods

2009-10-29 Thread Javier Guerra
On Thu, Oct 29, 2009 at 10:18 AM, pbzRPA wrote: > It's a pity django does not provide this kind of > functionality. hum it would be a pretty impressive feat for an ORM to take some arbitrary python code and recompile it to (portable!) SQL to make the DB do the work. -- Javier --~--~--

Re: Interrelated form fields

2009-10-29 Thread bruno desthuilliers
On 29 oct, 14:46, Julián C. Pérez wrote: > Hi all > I have a question to make > I'm tryng to build a form using the following models: > > --- > in models.py > > class Client(models.Model): >    user = models.ForeignKey(User, verbose_name=u'associated user') >    telephone = models.CharField(u'Tel

Re: {% url in templates

2009-10-29 Thread bruno desthuilliers
On 29 oct, 14:40, Alex Robbins wrote: > Maybe it is just me, but I feel like writing out the view functions > like that is a beating. It's not just you !-) yeps, named urls are the RightThing(tm) to do. --~--~-~--~~~---~--~~ You received this message because you

generic views vs writing my own

2009-10-29 Thread Ross
For which cases would a user wish to write their own views rather than using generic views? I'm new to Django and would like to build a page that prompts the user to enter information into a form to sign up for a league. Upon submitting the form, they can see the updated league roster. I'm current

Re: Specifying Django Project/Application Templates

2009-10-29 Thread Mike Ramirez
On Thursday 29 October 2009 09:21:26 Johan wrote: > The information you provided is very helpful and I have been wondering > about overriding templates.However, my question pertain not to > templates as in the templating system used in django but rather to the > 'template' directories used by djang

Trouble accessing session data from a template

2009-10-29 Thread Marco
Hi all, I going a little bit crazy that's why I'm posting here ... I have a view : def index(request): request.session['hello'] = 'world !!!' print "hello!!!" return render_to_response('index.html') in this page index.html I have value : {{ request.session.hello }} But nothing is dis

Re: Interrelated form fields

2009-10-29 Thread Daniel Roseman
On Oct 29, 4:42 pm, bruno desthuilliers wrote: > (FWIW and IIRC, the appropriate english term is 'Customer' - please > someone correct me if I'm wrong) OK... the French word 'client' maps to both 'client' and 'customer'. A lawyer, doctor, accountant etc would have clients; a shop has customers.

Re: Internal error on dreamhost when debug=False

2009-10-29 Thread Preston Holmes
Well you've gotten farther than I have. I can get passenger_wsgi working with hello world, and cherrypy I can get those working with any combination of virtualenv etc But with django I get the not too helpful Premature end of script headers even with apache LogLevel set to debug. -Preston On

Re: {% url in templates

2009-10-29 Thread Umapathy S
On Thu, Oct 29, 2009 at 1:40 PM, Alex Robbins wrote: > > Maybe it is just me, but I feel like writing out the view functions > like that is a beating. I just name[1] all the urls. Then the url tag > is easy. I just do things like {% url home-page %} or {% url blog- > index %}. If you set up a gen

Re: django can't access site-packages when inside fastcgi on dreamhost

2009-10-29 Thread Preston Holmes
On Oct 27, 9:07 pm, Jacob Fenwick wrote: > Wow, big surprise that someone else is having shared hosting issues with > dreamhost eh? > > I'm importing a library I installed in site-packages in a module in a django > app. When I call this django project, it returns with the error: > > ImportError

Inlines and foreign key

2009-10-29 Thread Alessandro Ronchi
I've made a Profile model (Socio) for my users and now I need to be able to edit the users detail in profile model in admin. THe problem is that I can add an Inline only from User to Profile, because User doesn't have a foreign key to profile. It's very odd: I cannot add the inline in the model t

Re: Year/month archive help

2009-10-29 Thread icrismariu
Hmm what i've done so far is: in my view: def arhiva(requesst): arch = Post.objects.dates('data', 'month', order='DESC') archives = {} for i in arch: tp = i.timetuple() year = tp[0] month = tp[1] if year not in archives:

Re: Trouble accessing session data from a template

2009-10-29 Thread Daniel Roseman
On Oct 29, 5:32 pm, Marco wrote: > Hi all, > > I going a little bit crazy that's why I'm posting here ... > > I have a view : > > def index(request): >    request.session['hello'] = 'world !!!' >    print "hello!!!" >    return render_to_response('index.html') > > in this page index.html I have >

Best way to customize create form in admin

2009-10-29 Thread fxvazquez
Hello, I'm starting with the development of a django application for inventory of buildings. Some models have more than a hundred of atributes including relations with other models so in the admin interface I have to use a lot of inlines. Here comes the problem: acording to the admin/change_form.

Re: Versionable Models?

2009-10-29 Thread David
i would not call this a real versioning as this will not keep track of which object has been edited. if you have 10 different ponies and edited pony 3 to 3', you can not tell that 3' was 3 before. neither can you tell which are the current ponies, you will only get the last pony with current_pony.

Django Model inheritance and foreignkeys

2009-10-29 Thread Andew Gee
Hi, I have the following models class Person(models.Model): name = models.CharField(max_length=100) class Employee(Person): job = model.Charfield(max_length=200) class PhoneNumber(models.Model): person = models.ForeignKey(Person) How do I access the PhoneNumbers

Re: Inlines and foreign key

2009-10-29 Thread Matt Schinckel
On Oct 30, 3:53 am, Alessandro Ronchi wrote: > I've made a Profile model (Socio) for my users and now I need to be able to > edit the users detail in profile model in admin. > > THe problem is that I can add an Inline only from User to Profile, because > User doesn't have a foreign key to profile

GROUP results in views.py

2009-10-29 Thread The Danny Bos
Hey there, I've got the below query, generating the below JSON. But I want to group them by "setId", can I do this in my query or in views.py to create a JSON file like the one at the bottom? Regroup in a template would be great, but doesn't work in views ... views.py: items = ItemOwned.objects.f

Re: django can't access site-packages when inside fastcgi on dreamhost

2009-10-29 Thread Jacob Fenwick
On Thu, Oct 29, 2009 at 1:47 PM, Preston Holmes wrote: > > > > On Oct 27, 9:07 pm, Jacob Fenwick wrote: > > Wow, big surprise that someone else is having shared hosting issues with > > dreamhost eh? > > > > I'm importing a library I installed in site-packages in a module in a > django > > app. W

Re: django can't access site-packages when inside fastcgi on dreamhost

2009-10-29 Thread Jacob Fenwick
Wow, I added the lxml library to sys.path in dispatch.fcgi and it worked! Which piece of software do you think needed the path that wasn't able to access it? Thanks for giving me the idea Preston. Jacob On Thu, Oct 29, 2009 at 9:14 PM, Jacob Fenwick wrote: > On Thu, Oct 29, 2009 at 1:47 PM, Pr

Creating something similar to WPMU with django?

2009-10-29 Thread jmat
I have a client that needs to create a way to generate a sub-domain website on the fly, much like you can do with wordpress mu: http://mu.wordpress.org/ I would really like to avoid another wordpress/php project so I'm inquiring here if anyone has any pointers as to how this might be accomplished

Re: GROUP results in views.py

2009-10-29 Thread The Danny Bos
If helpful, here's the table structure. class ItemOwned(models.Model): user = models.ForeignKey(User) item = models.ForeignKey(Item) class Item(models.Model): set = models.ForeignKey(Set) number = models.IntegerField() class Set(models.Model): title = mo

View code to auto-update FileField with pdf

2009-10-29 Thread bweiss
I've set up my app to generate a pdf file based on user selections (following these instructions here: http://www.20seven.org/journal/2008/11/pdf-generation-with-pisa-in-django.html). The code returns " return http.HttpResponse(result.getvalue(), \ mimetype='application/pdf')' prom

Darpa challenge

2009-10-29 Thread Adam Nelson
All, In case people hadn't heard, DARPA just announced what I think is the coolest competition ever: http://networkchallenge.darpa.mil/ On December 5, DARPA will raise 10 red weather balloons somewhere in the US. The first person to get the location of all 10 balloons and submit them will be g

setting up headache migrating to apache

2009-10-29 Thread Mike Dewhirst
I'm trying to replicate my (working ok) winxp testing environment on openSuSE 11.1 with Apache2 as a parallel testing environment. We're nowhere near production at the moment. The problem I'm having on openSuSE when i try /usr/bin/python /srv/www/vhosts/ccm/climate/ccm/tests.py is ... Traceba

Display Certain Fields of the Model Formset As Text

2009-10-29 Thread Anthony Simonelli
Hello, I am using a Model Formset because there are two foreign keys in my Model and it makes it easy to create forms with them preselected from data in my model: class ForecastActualSum(models.Model): sales_rep = models.ForeignKey(SalesrepGrpname) customer = models.ForeignKey(Customer)

Re: Specifying Django Project/Application Templates

2009-10-29 Thread Johan
Good day Thanks for the reply. This is exactly the approach which I am going to take. I have already started my own command. I am hoping to do it in such a fashion that other people can benefit from it. Thanks. On Oct 29, 6:57 pm, Mike Ramirez wrote: > On Thursday 29 October 2009 09:21:26 Joha