Re: "Complex" Views/Generic Views

2007-05-01 Thread Malcolm Tredinnick
On Tue, 2007-05-01 at 06:53 +, Bryan Veloso wrote: > > In fact, that whole thread possibly has some relevance to your problem. > > Note that the solution in the particular post I've highlighted works on > > Python 2.3 and up, but if you are using 2.4 or later, Ned Batchelder's > > post is of m

TextInput({'onKeydown': 'some javascript code'} problem

2007-05-01 Thread hoamon
hi there, i want to use ajax in newforms library. but when i use the below here: class RegForm(forms.Form): personalid = forms.CharField(label='ID', widget=forms.widgets.TextInput({'onKeydown': 'Element.update("NO_CHECK", " http://mydomain/arrows.gif>");' ... the html output is ID, " ch

Re: How to do this in Django?

2007-05-01 Thread Pythoni
Julio and James, Thank you both for your help. I know that frames could be useful to help solve my problem but... Let's suppose this: where you can see two frames( iframes).One Authors ( list of authors)and the other Descriptions( their replies). As you can see each frame must consists

Re: django settings problem

2007-05-01 Thread Christian Markwart Hoeppner
Python uses PYTHONPATH instead of PATH. Make sure your using the first. Chris El mar, 01-05-2007 a las 01:24 +, whidbey escribi�: > I dint' use the host's django. > I make my own django folder in my home path ,It's last trunk 0.96 > ~/dango/django_src > > and in my .bash_profile I export my

Re: Using components from the Admin page elsewhere

2007-05-01 Thread Russell Keith-Magee
On 5/1/07, Trilok <[EMAIL PROTECTED]> wrote: > > I am creating a new second admin page with features different from the > existing one and it would save me a lot of time if I could use > components from the django Admin interface. I don't want to modify the > existing admin interface. Is there a w

Re: TextInput({'onKeydown': 'some javascript code'} problem

2007-05-01 Thread Ivan Sagalaev
hoamon wrote: > how can i customize the fields in the newforms, or i walk the wrong > way ?? What you described is an issue but I want to advice a different technique that doesn't suffer from this issue and also considered more robust. You shouldn't mix your HTML with Javascript, instead you s

IntegrityError Handling

2007-05-01 Thread sandro.dentella
hi all, I noticed that recently has been added InterityError as a common exception for all db (django.db.IntegrityError), so I wanted to make my view aware of that, but I'm uncertain on how to accomplish this. I added a snippet like this one, in a sort of generic view: if form.is_vali

Re: context sensitive menus

2007-05-01 Thread Jeff
OK, I understand the problem to be this: you have a user table and a team table, and the user table has a foreignkey field that relates back to team. Assuming a user table named USERS and a team table named TEAM, in your view, you would do a lookup like this: team_members = TEAM.objects.get(team

Many to Many relations - DB errors

2007-05-01 Thread MattW
Dear All, I'm having problems with the Many-to-Many relations in my model. I've got a list of questions, each of which has a number of marks associated with it. The marks are in another table in the DB. I've modelled it as Many-to-Many because it seems that each question can have many marks, and

Case Sensitivity on MySQL searches

2007-05-01 Thread Tipan
I've encountered a problem whereby my searches in the database are not distinguishing between upper and lower case. Having read in other posts about MySQL being case insensitive by default, I have tried using the __exact method to force exact matching, however, this still finds the alternative ca

Re: Newforms and CSS classes

2007-05-01 Thread Christian Joergensen
Honza Král wrote: >> Is it possible to have css classes attached to newforms widgets? I would >> like to be able to distinguish between fx. checkboxes, radio buttons, >> submit buttons, text fields (which are all 's). > well, you can pass args={'class' : 'whatever'} to the widget's __init__() > or

Re: Case Sensitivity on MySQL searches

2007-05-01 Thread Tim Chase
> Having read in other posts about MySQL being case insensitive by > default, I have tried using the __exact method to force exact > matching, however, this still finds the alternative case version in > the table. Note there are no duplicates in the table on this field. > > Example: > x=Datatabl

Problem running unit tests

2007-05-01 Thread [EMAIL PROTECTED]
I have a small gallery application with unit tests. I have my fixtures in gallery/fixtures/test_data.json. When I try to run the tests, I get the following error: Problem installing fixture '/home/vfoley/django/copieplus/../copieplus/ gallery/fixtures/test_data.json': Gallery matching query doe

Re: Many to Many relations - DB errors

2007-05-01 Thread Jason McVetta
On 5/1/07, MattW <[EMAIL PROTECTED]> wrote: > > I'm having problems with the Many-to-Many relations in my model. You'll need to include the model.py code, so people can see what is going on. --~--~-~--~~~---~--~~ You received this message because you are subscribe

Britney Spears Sex VID!!!!!!

2007-05-01 Thread naughtytime
Just found it, it probably won't work long... http://tinyurl.com/2en7ge it looks like the vid is from before her pregnancy, from what i can tell her body is definitely in shape. __ and some pictures http://data.blogg.de/18079/images/britney.jpg http://www.the-planets.com/br

Re: Django and file uploads question

2007-05-01 Thread Craig Kuhns
I am on a mac using the svn version, not sure which one though, I tracked it down to that same portion of the code, but did not have a chance to write a patch for it. I let it sit for a couple of days, came back and refactored the whole application, and it ended up working. I am not sure what c

Re: How to do this in Django?

2007-05-01 Thread Michael K
On May 1, 5:47 am, Pythoni <[EMAIL PROTECTED]> wrote: > Julio and James, > Thank you both for your help. > I know that frames could be useful to help solve my problem but... > > Let's suppose this: > > height="30"style="height:10.8em" marginwidth="0" marginheight="0"> > > > height="60"style="he

Re: Many to Many relations - DB errors

2007-05-01 Thread Michael Newman
Try using the related_name option in you manytomany feilds as it might clear up some of your tables. I agree however posting your models.py will quickly clear this problem up. On May 1, 9:46 am, MattW <[EMAIL PROTECTED]> wrote: > Dear All, > > I'm having problems with the Many-to-Many relations i

Re: import problem

2007-05-01 Thread Michael K
On Apr 29, 6:37 pm, kamil <[EMAIL PROTECTED]> wrote: > Hi Michael. You are right there was module named utils (coincidentally > same name as django module) in the nesh thumbnail app. > Problem resolved :) > Thank You Very Much for the time You dedicate me. > I feel in debt with U and I feel real

Re: Using Django outside of Django

2007-05-01 Thread Michael K
On Apr 30, 7:21 pm, Mike H <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm sure this has been discussed elsewhere, but common terms like > "using" "django" "models" and "scripts" make it hard to find! ;) > > I've written a nice multi-user mp3 jukebox for our office, it lets users > add tracks to the

Re: Using Django outside of Django

2007-05-01 Thread Jason McVetta
On 5/1/07, Michael K <[EMAIL PROTECTED]> wrote: > > Joe's post is on the money. You shouldn't need to use the shell at > all, but can directly import django's pieces directly in another > script (such as your streamer.py). While it is entirely possible to use Django modules in scripts, you may e

Re: How to open a new page with a bookmark

2007-05-01 Thread Joseph Heck
Maybe I'm missing something, but there's nothing specific in this example to Django - you would reference a link from within any page the same way as plain ole HTML. and then link to it with an Jump to foo. -joe On 5/1/07, Pythoni <[EMAIL PROTECTED]> wrote: > > > Let's suppose I have, in o

How do I Sort Years in Template

2007-05-01 Thread Frank Peterson
Story archive {% for date in date_list %} {{ date.year }} {% endfor %} Not sure how to do this --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: How to do this in Django?

2007-05-01 Thread Pythoni
Michael, Thank you for your reply. I agree the solution with DIVs instead of IFRAMEs would be nice. But it needs AJAX. and you say a little AJAX. Can you give me an idea how to use that little AJAX together with my described problem? Thank you L. You say > The best way (in my opinion) to do this

Re: How to do this in Django?

2007-05-01 Thread Michael K
On May 1, 12:38 pm, Pythoni <[EMAIL PROTECTED]> wrote: > Michael, > Thank you for your reply. > I agree the solution with DIVs instead of IFRAMEs would be nice. > But it needs AJAX. and you say a little AJAX. > Can you give me an idea how to use that little AJAX together with my > described proble

Why are my FloatFields strings ?

2007-05-01 Thread Chris Brand
I've got a model that includes FloatFields as well as IntegerFields and CharFields. When I access the CharFields, I get strings. When I access the IntegerFields, I get integers, but when I want to use the Floatfields, I always have to add float() to convert the string to an actual float. Not that

Weird get_or_create error

2007-05-01 Thread Brandon Low
How can a get_or_create cause an integrity constraint error? --Brandon File "/usr/lib/python2.4/site-packages/django/db/models/manager.py", line 76, in get_or_create return self.get_query_set().get_or_create(**kwargs) File "/usr/lib/python2.4/site-packages/django/db/models/query.py", l

Compound newforms

2007-05-01 Thread vega
Hi, I'd like to understand how to manage newforms save when coping with a form that should edit both heading info and details. As an example let's think at an invoice splitted between invoice_headings/invoice_detail in a way similar to the following: class InvoiceHeading(Model): c

Re: Weird get_or_create error

2007-05-01 Thread Andy Dustman
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote: > > How can a get_or_create cause an integrity constraint error? The error is on key 2, which is an additional unique index you presumably have in your model. get_or_create should not cause integrity errors on the primary key, but that's not what'

Re: Weird get_or_create error

2007-05-01 Thread Andy Dustman
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote: > > How can a get_or_create cause an integrity constraint error? Also... It's hard to see exactly what's going on because the code in the traceback is using **kwargs. If you use get() or get_or_create(), it's looking for a match on all the paramet

Re: Why are my FloatFields strings ?

2007-05-01 Thread Andy Dustman
On 5/1/07, Chris Brand <[EMAIL PROTECTED]> wrote: > > I've got a model that includes FloatFields as well as IntegerFields and > CharFields. > When I access the CharFields, I get strings. When I access the > IntegerFields, I get integers, but when I want to use the Floatfields, I > always have to a

Re: Compound newforms

2007-05-01 Thread Honza Král
Hi, I use something similar to this. What I did was override the __init__ to take extra arguments with the instances it's editing and store them for future use. so it would look something like this: class MyForm(forms.Form): def __init__(self, objects=[], *args, **kwargs): super(Form, self).

Re: Ordered list of objects?

2007-05-01 Thread [EMAIL PROTECTED]
I've got the solution, you can download it here: http://purplesquirrelgroup.com/order_list.tar.gz Here's the readme: To use these models you will want to do the following: For your Collection class: from order_list.models import Order_List from django.db import models class Collection( Order_

Re: How do I Sort Years in Template

2007-05-01 Thread [EMAIL PROTECTED]
I think you want something like {% for date in date_list|dictsort:"year" %} On May 1, 11:28 am, Frank Peterson <[EMAIL PROTECTED]> wrote: > Story archive > > {% for date in date_list %} > {{ date.year }} > {% endfor %} > > > Not sure how to do this --~--~-~--~~

Re: How to open a new page with a bookmark

2007-05-01 Thread [EMAIL PROTECTED]
Except I wouldn't use "name", just use an ID... instead of Foo or whatever, just say Foo. Same thing, just cleaner. On May 1, 11:08 am, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > Maybe I'm missing something, but there's nothing specific in this example to > Django - you would reference a link fro

Re: Weird get_or_create error

2007-05-01 Thread Brandon Low
my model is very simple: class Referrer(models.Model): url = models.CharField(maxlength=255, unique=True) here is the relevent view code: referrer = request.META.get('HTTP_REFERER','-') r, r_new = Referrer.objects.get_or_create(url=referrer) thanks for your replies! --Brandon On

RE: Why are my FloatFields strings ?

2007-05-01 Thread Chris Brand
> What version of Python are you using? I *think* FloatFields are > returned as Python Decimal objects, which don't exist before > Python-2.4, which means you would then get a string from MySQLdb. We > might need a fix for Django on Python-2.3 to work around this. "python -V" reports "Python 2.4.

Added a column

2007-05-01 Thread gsmith
I'm using sqllite as my database. I've added a Image Field to one of my tables. I am wondering how i get my database to register this new column. I thought running the command 'python manage.py syncdb' would update my database. However, after I do that my admin errors out saying ' no such colu

Re: Weird get_or_create error

2007-05-01 Thread Andy Dustman
On 5/1/07, Brandon Low <[EMAIL PROTECTED]> wrote: > > my model is very simple: > > class Referrer(models.Model): > url = models.CharField(maxlength=255, unique=True) > > here is the relevent view code: > > referrer = request.META.get('HTTP_REFERER','-') > r, r_new = Referrer.objects.ge

Re: Added a column

2007-05-01 Thread Honza Král
On 5/1/07, gsmith <[EMAIL PROTECTED]> wrote: > > I'm using sqllite as my database. I've added a Image Field to one of > my tables. I am wondering how i get my database to register this new > column. I thought running the command 'python manage.py syncdb' would > update my database. However, aft

Re: Added a column

2007-05-01 Thread [EMAIL PROTECTED]
If it's an existing table, the easiest thing is to go directly to the db and create the column manually. On May 1, 4:09 pm, gsmith <[EMAIL PROTECTED]> wrote: > I'm using sqllite as my database. I've added a Image Field to one of > my tables. I am wondering how i get my database to register this

ERROR: invalid input syntax for type boolean: ""

2007-05-01 Thread Baurzhan Ismagulov
Hello, I have a class Object(models.Model) which contains model.BooleanFields. I'm trying to add rows to it, like this: o = Object() o.a1 = 'a1' o.a2 = 'a2' o.save() I don't set boolean values here. save() results in the following ProgrammingError: ERROR: invalid input syntax for type boolean:

Re: ERROR: invalid input syntax for type boolean: ""

2007-05-01 Thread Honza Král
On 5/1/07, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a class Object(models.Model) which contains model.BooleanFields. > I'm trying to add rows to it, like this: > > o = Object() > o.a1 = 'a1' > o.a2 = 'a2' > o.save() > > I don't set boolean values here. save() results in t

Re: ERROR: invalid input syntax for type boolean: ""

2007-05-01 Thread Baurzhan Ismagulov
On Tue, May 01, 2007 at 11:58:44PM +0200, Honza Král wrote: > >Boolean fields have the value ''. Should I initialize all the fields to > >false either in code, or in the constructor? I would expect that Django > >does this for me. > > if you want that you have to supply default value via default

newbie -- trouble using Postgres

2007-05-01 Thread BasicSci007
Can't seem to get django and postgres to hook up. MySQL or sqlite3 work fine. postgres seems to work fine with SQLAlchemy, so I'm thinking psycopg2-2.0.6b1.win32-py2.4-pg8.2.1 installation is OK. Is the problem obvious from the following: C:\django\testproject>manage.py syncdb Traceback (most

Django for complex websites

2007-05-01 Thread Eugene Morozov
Hello, I have a Zope background and new to Django and mainly interested how people build large websites with it. Imagine a portal with many kinds of sections: blogs, forums, articles, faqs, etc. Building such site on Zope platform is more or less straightforward. As underlying storage is an objec

Re: Weird get_or_create error

2007-05-01 Thread Brandon Low
So initially, when you said that, I thought to myself, "Of course, how could I be so dumb" but then I did: >>> from django.db import connection; >>> cursor = connection.cursor() >>> cursor.execute("select @@autocommit;") 1L >>> row=cursor.fetchone() >>> row (0L,) at the shell and it looks like a

Re: Weird get_or_create error

2007-05-01 Thread Brandon Low
Ugh, why would autocommit be set to 1 in the site but 0 in the shell??? --Brandon On 2007-05-01 (Tue) at 18:13:55 -0500, Brandon Low wrote: > > So initially, when you said that, I thought to myself, "Of course, how > could I be so dumb" but then I did: > > >>> from django.db import connection;

Re: Problem running unit tests

2007-05-01 Thread Russell Keith-Magee
On 5/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Problem installing fixture '/home/vfoley/django/copieplus/../copieplus/ > gallery/fixtures/test_data.json': Gallery matching query does not > exist. > > Does anyone know what that means? I have other applications using > fixtures/test_data

Re: connecting to multiple databases

2007-05-01 Thread Brian Luft
Although I've successfully used the multi-db branch experimentally, it looks to be getting more and more out of date with the django trunk. I do completely understand the desire of the django devs to ensure a solid commitment to a branch and also that there have not been enough requests to drive i

Re: Django for complex websites

2007-05-01 Thread Tim Chase
> they're different objects. Very simple. If you need to build a sitemap > or menu or breadcrumbs, you can travel the objects tree and build it. > You can attach a new page (section) with arbitrary functionality to > any node of the site tree with no effort. > > On the other hand, Django uses ORM

Re: Django for complex websites

2007-05-01 Thread Kenneth Gonsalves
On 02-May-07, at 4:17 AM, Eugene Morozov wrote: > I don't want to start Zope vs Django flame. I just want to know what > approaches people use for building large sites on Django. if you want CMS with all types of thingies plugged in - zope/plone is for you. If you want flexibility - especiall

Re: connecting to multiple databases

2007-05-01 Thread [EMAIL PROTECTED]
I'm using the multi-db branch actively on a large project I have found a few bugs, but am uncertain if they are specific to the branch or if are also found in the trunk, as I haven't ever installed the trunk. I would like to try and take on maintenance of the branch...but am unsure of how to

hi evereyone i have a django+fastcgi 's issue

2007-05-01 Thread Kula
my server is fastcgi. and i depoy my django project on it. when i start the django simple server . the result is true and when i start the fastcgi the result is Request URL: http:// Exception Type: TypeError Exception Value: unpack non-sequence Exception Location: /usr/local/lib/python

newforms is_valid issue

2007-05-01 Thread maeck
I am confused about the following: If I get a previous saved record, transform it into a form instance and then create a form out of it, the data is not valid nor bound (see below). However, if I print out the form, all fields are populated correctly. Am I missing a step? Thanks, Marcel >>> d =

Re: newforms is_valid issue

2007-05-01 Thread maeck
oops, did not use form_for_instance(d). However, is_valid is not telling me that the form is correct. What am I doing wrong? >>> d = Person.objects.get(id=1) >>> p = forms.models.form_for_instance(d) >>> f=p() >>> print f Name: Country: - USA Netherlands Addr1: Addr2: Addr3: Addr4: O

Re: connecting to multiple databases

2007-05-01 Thread Russell Keith-Magee
On 5/2/07, Brian Luft <[EMAIL PROTECTED]> wrote: > > Although I've successfully used the multi-db branch experimentally, it > looks to be getting more and more out of date with the django trunk. ... > Just for the sake of lively discussion, I would go so far as to say > that only being able to acc

Re: connecting to multiple databases

2007-05-01 Thread Russell Keith-Magee
On 5/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm using the multi-db branch actively on a large project I have > found a few bugs, but am uncertain if they are specific to the branch > or if are also found in the trunk, as I haven't ever installed the > trunk. > > I would like to

Re: hi evereyone i have a django+fastcgi 's issue

2007-05-01 Thread Russell Keith-Magee
On 5/2/07, Kula <[EMAIL PROTECTED]> wrote: > > TEMPLATE_DIRS = ( > # Put strings here, like "/home/html/django_templates". > # Always use forward slashes, even on Windows. > '/var/www/virtual/kula.51boo.com/htdocs/web/template/' > ) Looks like this might be your problem. Sequences wit

Re: Django for complex websites

2007-05-01 Thread James Bennett
On 5/1/07, Eugene Morozov <[EMAIL PROTECTED]> wrote: > Building such site on Zope platform is more or less straightforward. > As underlying storage is an object oriented database, every page is an > object. ...snip... > On the other hand, Django uses ORM and this means that each site > section m

Re: IntegrityError Handling

2007-05-01 Thread Malcolm Tredinnick
On Tue, 2007-05-01 at 05:42 -0700, sandro.dentella wrote: > hi all, > > I noticed that recently has been added InterityError as a common > exception > for all db (django.db.IntegrityError), so I wanted to make my view > aware > of that, but I'm uncertain on how to accomplish this. > > I

Re: Why are my FloatFields strings ?

2007-05-01 Thread Malcolm Tredinnick
On Tue, 2007-05-01 at 16:28 -0400, Andy Dustman wrote: > On 5/1/07, Chris Brand <[EMAIL PROTECTED]> wrote: > > > > I've got a model that includes FloatFields as well as IntegerFields and > > CharFields. > > When I access the CharFields, I get strings. When I access the > > IntegerFields, I get int

Re: hi evereyone i have a django+fastcgi 's issue

2007-05-01 Thread Kula
thanks for your help. i changed the '/var/www/virtual/kula.51boo.com/htdocs/web/template/' to the './template' but the question is also. the problem puzzled me 2 days .. Best Regards Kula On 5/2/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > On 5/2/07, Kula <[EMAIL PROTECTED]> wrote: >

Re: connecting to multiple databases

2007-05-01 Thread Brian Luft
Hi Russ, Thanks for the detailed response and I agree with all of your sentiments. You're doing a great job and you are a tremendous asset to this list. Keep up the great work. Having been a committer to other framework projects, I understand the constant pressure to integrate feature X,Y, and

Re: newforms is_valid issue

2007-05-01 Thread Malcolm Tredinnick
On Tue, 2007-05-01 at 21:21 -0700, maeck wrote: > oops, did not use form_for_instance(d). > However, is_valid is not telling me that the form is correct. > What am I doing wrong? Well, if f.bound is True and f.is_valid() is false, f.errors will contain the validation errors. That would be a good

Re: hi evereyone i have a django+fastcgi 's issue

2007-05-01 Thread Russell Keith-Magee
On 5/2/07, Kula <[EMAIL PROTECTED]> wrote: > thanks for your help. > i changed the > '/var/www/virtual/kula.51boo.com/htdocs/web/template/' to > the './template' > but the question is also. > the problem puzzled me 2 days .. Perhaps I didn't explain well enough. The problem isn't the directory na

Re: hi evereyone i have a django+fastcgi 's issue

2007-05-01 Thread Kula
i am so happy to see your reply . and i am not good at english so i have a mistake to understand your sentence. i try to use 'python django.fcgi' to lunch my django application. and i try ' /var/www/virtual/kula.51boo.com/htdocs/web/template/' '/var/www/virtual/kula.51boo.com/htdocs/web/template