ifequal string with spaces

2006-05-10 Thread tomass
Hi Folks, I'm not sure if this is a bug, but it seems like if I do a test with {% ifequal %} for a string with spaces in it, I get a TemplateSyntaxError: 'ifequal' takes two arguments. Here's my code: {% for tower in towers %} {% ifequal tower.country "United Kingdom" %} document.towers.elements

Re: Django users meetup in Palo Alto on April 27th

2006-05-10 Thread [EMAIL PROTECTED]
Eric, could you be a bit more specific about what kind of "J2EE" the application was originally written in? Was it using Struts, Spring, EJBs (which version), Hibernate, JSF...? Or Just plain old JSPs+Servlets? S. Eric Walstad wrote: > Jacob, > > Thanks very much for organizing, and paying f

Re: MR django_content_type SQL error

2006-05-10 Thread Graham King
I've now updated this on the Wiki. Graham King wrote: > In the RemovingTheMagic wiki page the SQL to upgrade > django_content_type is given as: > > UPDATE django_content_type SET name='group' WHERE model='group'; > UPDATE django_content_type SET name='user' WHERE model='user'; > > Th

Re: No Subclassing in models yet? How would you guys do the following:

2006-05-10 Thread Carlos Yoder
> Okay point taken - I'll stop trying to be 'elegant' and just live with > the problem and deal with managing this with a 'VehicleType' model and > several redundant fields. > > It is slightly anoying though! Annoying? I work on Windows, you insensitive clod! Cheers, -- Carlos Yoder [EMAIL PROTE

TypeError when accessing a many to many field

2006-05-10 Thread Christian Schneider
Hi all,I have the following to models:class Codec(models.Model):    name = models.CharField(maxlength=200)    desc = models.TextField()    type = models.CharField(maxlength=32,choices=CODEC_TYPES, radio_admin=True,default="WM")     def __str__(self):    return self.desc    class Admin:    p

Re: TypeError when accessing a many to many field

2006-05-10 Thread Michael Radziej
Christian Schneider wrote: > I can do Codec.objects.all()[0].format_set.all() but when I do > Format.objects.all()[0].codec.all() I get the following traceback: > File "/usr/lib/python2.3/site-packages/django/db/models/query.py", line > 780, in lookup_inner > raise TypeError, "Cannot resolve

Re: DSN useful for database settings?

2006-05-10 Thread Amit Upadhyay
On 5/10/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: Exactly. That's precisely what I pointed out in the (now closed)ticket for this feature request. Settings files are pure Python for areason -- this sort of flexibility.Let's move onto more pressing improvements to the framework, shall we? It wo

Re: TypeError when accessing a many to many field

2006-05-10 Thread Christian Schneider
On 5/10/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Christian Schneider wrote:> I can do Codec.objects.all()[0].format_set.all() but when I do> Format.objects.all()[0].codec.all() I get the following traceback:>   File "/usr/lib/python2.3/site-packages/django/db/models/query.py", line > 780, in

Re: TypeError when accessing a many to many field

2006-05-10 Thread Michael Radziej
Hi, My problem was a stupid error on my own. You haven't, by chance, created a field named "id" and haven't set primary=True? Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t

sites in django.contrib ?

2006-05-10 Thread Zeuxis
Hi, I wonder what it the purpose of the sites app in django.contrib ? It does not seem to be used that much ... or is it supposed to be a base on which things can be built ? -- Z. --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Question

2006-05-10 Thread PythonistL
Jorge, Thanks a lot for help.It works. L. --~--~-~--~~~---~--~~ 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

adding stored procedures / postgres functions to db?

2006-05-10 Thread mazurin
Hi, I'm trying to implement a complicated sequence of updates inside a form-handling view, and I realized that it might be best to do it inside a Postgresql function. In fact, I've already found sample code for a postgres function that's almost exactly what I need. My question is, how do I

Re: adding stored procedures / postgres functions to db?

2006-05-10 Thread Malcolm Tredinnick
On Wed, 2006-05-10 at 06:20 -0700, mazurin wrote: > > Hi, > > I'm trying to implement a complicated sequence of updates inside a > form-handling view, and I realized that it might be best to do it > inside a Postgresql function. In fact, I've already found sample code > for a postgres function

Re: TypeError when accessing a many to many field

2006-05-10 Thread Christian Schneider
Michael,On 5/10/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Hi,My problem was a stupid error on my own. You haven't, by chance, createda field named "id" and haven't set primary=True?no, unfortunately not.chris --~--~-~--~~~---~--~~ You received this message be

Re: TypeError when accessing a many to many field

2006-05-10 Thread Michael Radziej
Christian Schneider wrote: > Michael, > > On 5/10/06, Michael Radziej <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> My problem was a stupid error on my own. You haven't, by chance, created >> a field named "id" and haven't set primary=True? > > > no, unfortunately not. Since this stuff is tested

Re: TypeError when accessing a many to many field

2006-05-10 Thread Christian Schneider
On 5/10/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Since this stuff is tested in the automated test suite, you could tryrunning these. Would be interesting whether they break for you, too.There's a file runtests.py, start this. It will use your settings to access the database server, but create

Re: TypeError when accessing a many to many field

2006-05-10 Thread Michael Radziej
Christian Schneider wrote: > thanks for the hint. Running the tests gives me 17 errors. While most of > them are due to my German localisation, like got "1 Tag" expected "1 day", > there are also errors like the following: > > 'transactions' module: API test failed > =

Re: adding stored procedures / postgres functions to db?

2006-05-10 Thread Adrian Holovaty
On 5/10/06, mazurin <[EMAIL PROTECTED]> wrote: > My question is, how do I add the CREATE FUNCTION statement to > Django's db-creating process? For initial data, I know that I just make > a bunch of .sql files that have the same name as the models, and put > them inside the sql/ directory. Is the

Re: Decoupling fields from forms

2006-05-10 Thread George Sakkis
> I understand that Django maintains two parallel hierarchies of field > classes, one related to models that correspond to table columns and one > that maps these fields to forms so that they can be edited in the admin > interface. This works ok most of the time, but what if one wants to > have an

Which is better: dreamhost or bluehost?

2006-05-10 Thread panta
Hi all, I'm going to setup a (small) site using django and I need to decide on a basic hosting plan. I'm considering both dreamhost and bluehost and I can't quite decide. Do you have any recommendations? Thanks in advance, Marco --~--~-~--~~~---~--~~ You received

Re: Which is better: dreamhost or bluehost?

2006-05-10 Thread Vladimir Pouzanov
Personally I prefer DreamHost because of svn and jabber (very useful stuff for me). On 5/10/06, panta <[EMAIL PROTECTED]> wrote: > > Hi all, > I'm going to setup a (small) site using django and I need to decide on > a basic hosting plan. > I'm considering both dreamhost and bluehost and I can't q

Apache, mod_python, Django question

2006-05-10 Thread Rob Hudson
I recently set up Apache and mod_python to play with Django. My server is also using mod_php all with a MySQL database. I was noticing weird bugginess -- the admin page sometimes would be there, then sometimes give errors, etc. The fine folks on IRC helped me to realize that I need to restart A

Re: No Subclassing in models yet? How would you guys do the following:

2006-05-10 Thread [EMAIL PROTECTED]
Hmm - were you drunk when you posted this? --~--~-~--~~~---~--~~ 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, sen

django / IDE integration

2006-05-10 Thread jelle
Hi group, I just started working on my 1st django app. Since I rely extensively on my IDE (SPE!) I want to make sure these run smoothly together. When executing: from django.conf import global_settings in the shell of my IDE, it wouldnt import right, so I added the following statement to django.c

Re: No Subclassing in models yet? How would you guys do the following:

2006-05-10 Thread Jorge Gajon
He is using a common joke found in the slashdot community. See http://en.wikipedia.org/wiki/Slashdot_culture But then again, this is not slashdot. So yeah, maybe he was drunk. On 5/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hmm - were you drunk when you posted this? > > > > > --~-

Re: Accessing request.user in urls.py

2006-05-10 Thread Mr. P
Actually I had to solve this yesterday and found that there is an easier and cleaner way based around adding a context processor. The simple option is to add "django.core.context_processors.auth" to TEMPLATE_CONTEXT_PROCESSORS in your settings file. This makes 'user' available in all template con

Re: One-to-one not to be used?

2006-05-10 Thread Mr. P
I'd love to know more too and can't find anything relevant in the developer's group. --~--~-~--~~~---~--~~ 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@googlegrou

Comment options not appearing in admin

2006-05-10 Thread Phil Powell
HI all,I'm a relative newbie to django, but so far I'm mightily impressed (particularly with the speed of development).I've just run into my first serious problem when trying to get comments functioning though.  Here's what I've done: added 'django.contrib.comments' to my INSTALLED_APPSrun 'python

Re: Django users meetup in Palo Alto on April 27th

2006-05-10 Thread Eric Walstad
On Wednesday 10 May 2006 02:09, [EMAIL PROTECTED] wrote: > Eric, > > could you be a bit more specific about what kind of "J2EE" the > application was originally written in? > > Was it using Struts, Spring, EJBs (which version), Hibernate, JSF...? > Or Just plain old JSPs+Servlets? > >   S. Hi Sté

Re: Comment options not appearing in admin

2006-05-10 Thread Wilson Miner
With comments installed you can use the comments template tags to attach a comment thread to any object in the template. For example, for a hypothetical blog post, the template code to get the list of free comments for the object might look like this: {% load comments %} {% get_free_comment_list

Re: sites in django.contrib ?

2006-05-10 Thread Wilson Miner
It's generally used as a ManyToMany in other apps to assign objects (blog posts, stories, e.g.) to be published to one or more sites at a time. On 5/10/06, Zeuxis <[EMAIL PROTECTED]> wrote: > > Hi, > > I wonder what it the purpose of the sites app in django.contrib ? It > does not > seem

'module' object has no attribute 'urlpatterns'

2006-05-10 Thread [EMAIL PROTECTED]
hi, I am just starting up with django and got stuck in this error when I try to access my app url. the admin url works fine. here is my urls.py: from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: (r'^databaseImport/$', include('epigrassWeb.databaseImport')),

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread Vladimir Pouzanov
epigrassWeb/databaseImport.py should contain: urlpatterns = ( ... module-specific URLs ... ) On 5/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > hi, > > I am just starting up with django and got stuck in this error when I > try to access my app url. the admin url works fine. > > here is

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread Honza Král
the problem is the dollar sign at the end of the expression, get rid of it On 5/10/06, Vladimir Pouzanov <[EMAIL PROTECTED]> wrote: > > epigrassWeb/databaseImport.py should contain: > urlpatterns = ( > ... module-specific URLs ... > ) > > On 5/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread [EMAIL PROTECTED]
nowhere in the documentation is is said to add a urlpatterns variable inside the application main module... The urls should be defined in the urls.py. remember that the url pattern for the admin script works... --~--~-~--~~~---~--~~ You received this message becau

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread [EMAIL PROTECTED]
I tried that and it does not help. --~--~-~--~~~---~--~~ 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

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread James Bennett
On 5/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > nowhere in the documentation is is said to add a urlpatterns variable > inside the application main module... The urls should be defined in the > urls.py. remember that the url pattern for the admin script works... When you do 'include',

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread Vladimir Pouzanov
Here's my urls.py: from django.conf.urls.defaults import * urlpatterns = patterns('', # Admin (r'^admin/', include('django.contrib.admin.urls')), # News (r'^news/', include('cmh.apps.news.urls')), ... apps/news/urls.py: from django.conf.urls.defaults import * urlpatterns = patt

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread [EMAIL PROTECTED]
> When you do 'include', the thing being included must be a valid > URLConf, which means it must generate a 'urlpatterns'. The > documentation does not explicitly state this, I assume because it > hopes that by that point in the documentation it's understood what is > meant by the term "URLConf".

Forms: SelectField with default value

2006-05-10 Thread Juancho
Hello, I am trying to get a SelectField to render with a default value, i.e., a pre-selected choice. With the current SelectField implementation, this is not possible. I see this issue has been addressed before but was closed as "wontfix" with this reason: "This is not in the scope of the form

blank lines for records in admin

2006-05-10 Thread [EMAIL PROTECTED]
Here is the scenario: I create my models, call up the admin interface, insert some records. so far, so good. back to admin man page I click on the database I have just edited to see my records. It then show me a table with as many blank lines as records in my database. The title of this table i

python manage.py sql [myapp] doesn't generate all the needed code ?

2006-05-10 Thread Alex
Hello all, I'm new to Django. :) I'm following the online tutorial. I'm created a application called "browser" and I'm writing my models. And I'm running into a subclassing problem. Here is my code: from django.db import models class BasicContact: contact_name = models.CharField(maxlength=

Re: blank lines for records in admin

2006-05-10 Thread Malcolm Tredinnick
On Wed, 2006-05-10 at 14:25 -0700, [EMAIL PROTECTED] wrote: > Here is the scenario: > > I create my models, call up the admin interface, insert some records. > > so far, so good. > > back to admin man page I click on the database I have just edited to > see my records. > It then show me a table

Re: django / IDE integration

2006-05-10 Thread Luke Plant
On Wednesday 10 May 2006 17:13, jelle wrote: > Am I having a wrong expectation in what extent my IDE can run django, > or am I overlooking something here? You can't create model classes interactively, due to the way the metaclass works. There is a ticket about this: http://code.djangoproject.

Re: python manage.py sql [myapp] doesn't generate all the needed code ?

2006-05-10 Thread Honza Král
subclassing currently does not work, it is still in development On 5/10/06, Alex <[EMAIL PROTECTED]> wrote: > > Hello all, > > I'm new to Django. :) > > I'm following the online tutorial. I'm created a application called > "browser" and I'm writing my models. And I'm running into a subclassing > p

Re: python manage.py sql [myapp] doesn't generate all the needed code ?

2006-05-10 Thread Alexandre CONRAD
Honza Král wrote: > subclassing currently does not work, it is still in development Humm, after some thinking, I'm also subclassing the models.Model. This would generate a all the *Field fields which would be a problem. Then generating the sql syntax for subclasses should then be explicitly g

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-10 Thread Paulo
Can someone point me to a Django list aimed more towards "newbies"? I don't want to bother you all with my mundane, trivial questions but I still would love to jump head first into Django. I just can't get it working right. I have not been able to get past the first step of the tutorial. I am no

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-10 Thread Malcolm Tredinnick
Paulo, On Wed, 2006-05-10 at 14:54 -0700, Paulo wrote: > Can someone point me to a Django list aimed more towards "newbies"? This is it. There is one django-users list. > > I don't want to bother you all with my mundane, trivial questions but > I still would love to jump head first into Django

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-10 Thread Paulo
Got ya. If it helps it is a bare CentOS 4.3 install. I'll keep plugging away then. Thanks again for everyone's help. On 5/10/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Paulo, > > On Wed, 2006-05-10 at 14:54 -0700, Paulo wrote: > > Can someone point me to a Django list aimed more towar

Re: Forms: SelectField with default value

2006-05-10 Thread Ivan Sagalaev
Juancho wrote: >"This is not in the scope of the formfields.py framework. Formfields >just know how to display themselves -- they don't know (or care) about >data. Put this in your business logic." > > This means that SelectField shouldn't care of concept of default data itself. But it surely

Re: 'module' object has no attribute 'urlpatterns'

2006-05-10 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: >Well, I have tried setting urlpatterns in databaseImport.py (copied >from urls.py) but it the error message did not change. > > But why you include this databaseImport.py ??? You should include your applications urls.py where you describe your urls. --~--~-~-

auto_now_add field NULL on update

2006-05-10 Thread Fawad Halim
Hi, I have a model with a field defined as created = models.DateTimeField(auto_now_add = True) Problem is that when an object of this type is updated, the UPDATE query has a clause like "created"=NULL which is violating the NOT NULL constraint on the field. I was under the impression

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-10 Thread Don Arbow
On May 10, 2006, at 3:12 PM, Paulo wrote: >>> I don't want to bother you all with my mundane, trivial questions >>> but >>> I still would love to jump head first into Django. I just can't >>> get it >>> working right. I have not been able to get past the first step of >>> the >>> tutorial.

Manytomany relationship with an intermediary table

2006-05-10 Thread Topdeck
Hi there, I wondering how, with the following models, I would be able to edit Car_Part on the admin page of Car. I want to be able to add many parts to a car, and specify the amount of each part. class Car(models.Model): name = models.Textfield() class Part(models.Model): number = model

Re: Which is better: dreamhost or bluehost?

2006-05-10 Thread Slowness Chen
My site (SeaAboveSkyBelow.org) is running smoothly on Dreamhost. - Original Message - From: "panta" <[EMAIL PROTECTED]> To: "Django users" Sent: Wednesday, May 10, 2006 11:31 PM Subject: Which is better: dreamhost or bluehost? > > Hi all, > I'm going to setup a (small) site using djan

Re: Forms: SelectField with default value

2006-05-10 Thread Jorge Gajon
I'm not sure if you can specify a default to use with the built-in Admin views. However, if you are developing your own views you can set the default data to pass to the FormWrapper with something like this (I'm using this code and it works): def mycustomview(request): manipulator = MyModel.

Re: Forms: SelectField with default value

2006-05-10 Thread Don Arbow
On May 10, 2006, at 1:46 PM, Juancho wrote: > > Hello, > > I am trying to get a SelectField to render with a default value, i.e., > a pre-selected choice. > > With the current SelectField implementation, this is not possible. I > see this issue has been addressed before but was closed as "wontf

Re: adding stored procedures / postgres functions to db?

2006-05-10 Thread mazurin
Malcolm and Adrian, Thanks so much for your quick replies! I thought of that, but I didn't know if it was the Djangoic way of doing it. Follow up question -- are _all_ the files in the sql/ directory executed, or just those that have the same names as the models? mikah -- --~--~-

Re: Forms: SelectField with default value

2006-05-10 Thread Juancho
Thanks everyone for the replies ... in short, I was retarded. yeah, i just needed to do new_data['my_select_field'] = '3' before rendering and then i could select the request i want programatically. Thanks so much for the helpful responses :) j --~--~-~--~~~---~-

Re: adding stored procedures / postgres functions to db?

2006-05-10 Thread Malcolm Tredinnick
Hi Mikah, On Wed, 2006-05-10 at 23:29 -0700, mazurin wrote: > Malcolm and Adrian, > > Thanks so much for your quick replies! I thought of that, but I > didn't know if it was the Djangoic way of doing it. You're welcome. :-) > Follow up question -- are _all_ the files in the sql/ directory