Re: installation issues

2007-07-08 Thread Russell Keith-Magee
On 7/9/07, surfwizz <[EMAIL PROTECTED]> wrote: > > I am having trouble installing Django on Mac OSX 10.4.10. Any help > would be welcome. Thanks! Django works fine on MacOSX - I'm developing on OSX right now. If you want help, you're going to need to ask a specific question. What part of the

Re: newforms-admin: defaults and radio select

2007-07-08 Thread leifbyron
Hi Allen, I'm no Django expert (in fact, I just started learning a month ago), but I'm happy to share what I have discovered so far. >From what I can tell, the only way to override the default widget or field for a model's database field is to subclass the Options class and override the

Re: forms and designers

2007-07-08 Thread John Shaffer
On 7/8/07, James Bennett <[EMAIL PROTECTED]> wrote: > Well, the thing to remember is that you're not just displaying an > empty input element -- it's fairly common, due to the data validation > step, to have to go back and show the form again with values filled > in. Right, so use: It gets

Re: dump an object

2007-07-08 Thread Carl Karsten
Jeremy Dunck wrote: > On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Something between that and the admin look/feel. The goal is to show someone >> what data will be displayed ins a some what sane way during development, and >> make it pretty some other day. > > Maybe you want

Re: forms and designers

2007-07-08 Thread Al Abut
Ok, so here's what I get when I pinged this discussion to the two python guys I work with: basically, you want to be able to redisplay the data the user entered on a form when you return the page with errors. And that the newform shortcuts are the only way to do that. If that's the case, then

Re: How can I achieve this intersection ?

2007-07-08 Thread queezy
Um, I know that you can't make up names and expect them to magically do what you wish. My question was simply how to do the straight Pythonic function in a Django manner. Thanks. - Original Message - From: "SmileyChris" <[EMAIL PROTECTED]> To: "Django users"

Re: forms and designers

2007-07-08 Thread Al Abut
Nathan, thanks for those tips and that looks like a smart way to attach js triggers and classes for css. What about all the other stuff I could do to an html element though, like specify its initial value? Or do I draw the line there as a designer and say that's on the programmer's plate? James,

Re: forms and designers

2007-07-08 Thread James Bennett
On 7/8/07, Al Abut <[EMAIL PROTECTED]> wrote: > Does using a newform shortcut make things that much easier from a > programmatic standpoint? Or to ask the opposite, is using and > elements in a template make things that much harder for > things like data validation? Well, the thing to remember

Re: forms and designers

2007-07-08 Thread Al Abut
> All that the shortcut does is give you less to type. It doesn't affect > validation at all. As long as you have a form element with the same > name, validation will work fine. Ok, thanks John, I'm calling out the developers at work and pointing them to this :)

Re: forms and designers

2007-07-08 Thread Nathan Ostgard
I use jQuery as a base for my JS, so it becomes pretty simple to attach the events. I personally don't like putting JS into the HTML element inline, though, so I'm bias. But I basically just add a script element to my form page: $(function() {

Re: forms and designers

2007-07-08 Thread John Shaffer
On 7/8/07, Al Abut <[EMAIL PROTECTED]> wrote: > Does using a newform shortcut make things that much easier from a > programmatic standpoint? Or to ask the opposite, is using and > elements in a template make things that much harder for > things like data validation? All that the shortcut does

installation issues

2007-07-08 Thread surfwizz
I am having trouble installing Django on Mac OSX 10.4.10. Any help would be welcome. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: forms and designers

2007-07-08 Thread Al Abut
Ix5 - thanks for the link, being able to tack classes into the form elements as they're being autogenerated would help but that method looks like a pretty convoluted way to just tack on some presentation- related info, no? Compared to if that element was plain html, that's the standard I'm

Re: forms and designers

2007-07-08 Thread Al Abut
A reply by John Shaffer posted on django-developers (didn't realize it was for "developing django" not "developing with django"): "We use this in Satchmo: Discounts Discount code {{ form.discount }} {% if form.discount.errors %}*** {{ form.discount.errors|join:", " }}{% endif

Re: Query Object and comparing only partial TimeField Value

2007-07-08 Thread Tim Chase
> What I want to do is get post between 9:00AM-5:00PM on any day. I > just want to compare Hour part of "created_at" field. If the hour is > between 9-5, can be any day, get the matching records. > > Pseudo Django Python Code: > > Post.objects.get( Q(created_at = (9:00AM - 5:00PM))) > > Is

newforms-admin: defaults and radio select

2007-07-08 Thread _
Hi folks, I'm doing my best to convert over to the newforms-admin model. There are three things that used to be model kwargs that I'm having difficulty converting over: default values and radio_admin.. Any tips? Do I have to tie these things into formfield_for_dbfield() in the Options class?

Re: Deleting Object/

2007-07-08 Thread Russell Keith-Magee
On 7/9/07, TheOrb <[EMAIL PROTECTED]> wrote: > > I am new to Django and getting started with the Poll example. > > 1 ) While in the Shell if type "Poll.objects.a() " I get the result > [, ] > > Why am I getting 2 poll objects and what command can I use to > delete one. Well - you are

Re: generate choices list from database

2007-07-08 Thread Russell Keith-Magee
On 7/8/07, Stu <[EMAIL PROTECTED]> wrote: > > In a similar vein to the OP, I'm trying to populate a choices list for > a form (using newforms) from a database: > > nameChoices = Names.objects.filter(initials='AB') > NameSelection.base_fields['names'].widget = >

Query Object and comparing only partial TimeField Value

2007-07-08 Thread johnny
What I want to do is get post between 9:00AM-5:00PM on any day. I just want to compare Hour part of "created_at" field. If the hour is between 9-5, can be any day, get the matching records. Pseudo Django Python Code: Post.objects.get( Q(created_at = (9:00AM - 5:00PM))) Is this possible?

Re: dump an object

2007-07-08 Thread Jeremy Dunck
On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > Something between that and the admin look/feel. The goal is to show someone > what data will be displayed ins a some what sane way during development, and > make it pretty some other day. Maybe you want databrowse?

dump an object

2007-07-08 Thread Carl Karsten
For quickly displaying an object on a page (in particular from a generic view), is there something that is slightly better than {{object}} ? Something between that and the admin look/feel. The goal is to show someone what data will be displayed ins a some what sane way during development, and

Re: Update Admin Screen view

2007-07-08 Thread SmileyChris
On Jul 9, 12:19 pm, Rod <[EMAIL PROTECTED]> wrote: > 1) I can view the Admin screen but I am still unable to view the poll > app. > > I've added a new class (see below) to mysite/polls/models.py but > the Admin screen remains unchanged. > > class Poll(models.Model): > # ... > class

Re: How can I achieve this intersection ?

2007-07-08 Thread SmileyChris
On Jul 9, 5:17 am, queezy <[EMAIL PROTECTED]> wrote: > I would like to do this in Django, using two lists that are QuerySet lists: > > mylist=mylistWHOM.intersection(mylistWHAT) > > When I do it in the Pythonic way above, the django parser complains with: > 'QuerySet' object has no attribute

Update Admin Screen view

2007-07-08 Thread Rod
1) I can view the Admin screen but I am still unable to view the poll app. I've added a new class (see below) to mysite/polls/models.py but the Admin screen remains unchanged. class Poll(models.Model): # ... class Admin: pass 2 ) While in the Shell if type "Poll.objects.a() "

Re: Virtual Hosts, Django, SetEnv and settings.py - random behaviour.

2007-07-08 Thread bluszcz
Strange - only one thing was equal for switched requests - PID. Interpreter, host type, os.environ, hostname etc proper for VirtualHost. Anyway, I switched to FastCgi (stil considering mod_wsgi and scgi) and problem disappeared. Cheers, On 4 Lip, 03:30, Graham Dumpleton <[EMAIL PROTECTED]>

Re: about django-admin settings

2007-07-08 Thread Aidas Bendoraitis
Set the environment variable PYTHONPATH to the parent directory of the mysite. That should help you. Regards, Aidas Bendoraitis aka Archatas On 7/9/07, jujian <[EMAIL PROTECTED]> wrote: > > HELP! > > > > > --~--~-~--~~~---~--~~ You received this message

Re: about django-admin settings

2007-07-08 Thread jujian
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 to [EMAIL PROTECTED] For

Re: Djangonauts at EuroPython?

2007-07-08 Thread Aidas Bendoraitis
I don't participate in the EuroPython this year, but have fun in the capital of my native country :) Regards, Aidas Bendoraitis aka Archatas (from Berlin, Germany) On 7/8/07, Ville Säävuori <[EMAIL PROTECTED]> wrote: > > > Simon Willison is keynoting, and he is an original contributor. > > I

problem with session persistence

2007-07-08 Thread flynnguy
I am building an online test taking type of application and I am having an issue with one of my session variables... The code looks something like this: (A lot removed for brevity) The first time around I do the following to initialize the list: question =

Re: Djangonauts at EuroPython?

2007-07-08 Thread Ville Säävuori
> Simon Willison is keynoting, and he is an original contributor. I was going to mention that besides Simon (but thought it was too obvious :) We had a fun evening with some Danish friends from #django channel today. Hopefully we see more django-people -- including Simon -- tomorrow! :) Yours,

Deleting Object/

2007-07-08 Thread TheOrb
I am new to Django and getting started with the Poll example. 1 ) While in the Shell if type "Poll.objects.a() " I get the result [, ] Why am I getting 2 poll objects and what command can I use to delete one. 2) I can view the Admin screen but I am still unable to view the poll app.

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-08 Thread [EMAIL PROTECTED]
Hello I wrote a test case using mysldb with direct python calls and using the django model classes to insert various sized binary data into a blob field. First I changed the value of max_allowed_packets in my.cnf to prove/disprove that mysqldb/django are using it. Conclusion they do use my.cnf

Parent / Child Categories and QuerySet filters

2007-07-08 Thread Dan
This question may have been asked a thousand times, but I'm not sure how to use the Parent/Child category database model given here: http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic I have a model Item with category as a ForeignKey. I'd like to loop through all top level

Re: forms and designers

2007-07-08 Thread l5x
Maybe it will be useful: http://groups.google.com/group/django-users/browse_thread/thread/a60038f4d0777391/a94a8e1dff4865db#a94a8e1dff4865db --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

How can I achieve this intersection ?

2007-07-08 Thread queezy
I would like to do this in Django, using two lists that are QuerySet lists: mylist=mylistWHOM.intersection(mylistWHAT) When I do it in the Pythonic way above, the django parser complains with: 'QuerySet' object has no attribute 'intersection' This problem has been dogging me for a few days

Re: psycopg/psycopg2 - error at the loading

2007-07-08 Thread uxmal
On Jul 6, 4:05 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Am Freitag, 6. Juli 2007 15:43 schrieb uxmal: > > > hello, > > I know it isn't directly related to django, but well my django depends > > on it... > > > yesterday I installed postgresql, mxBase, and psycopg 1.1 on openSUSE > >

forms and designers

2007-07-08 Thread Al Abut
I'm a designer new to django and the templating system has been pretty easy to pick up. The area that I have a problem with is the form shortcuts - the auto-generation of html is a big pain and causes me a lot of headaches in terms of being able to manipulate the elements directly, not just in

arrays in templates

2007-07-08 Thread Carl Karsten
I have this working with some extra code in my view, but I would like to know how I could have done it in the template: # view.py from datetime import datetime, date # Week starts on Sunday c=calendar.Calendar(calendar.SUNDAY) # get all the dates that will be displayed, #

Re: Djangonauts at EuroPython?

2007-07-08 Thread Jeremy Dunck
On 7/8/07, Ville Säävuori <[EMAIL PROTECTED]> wrote: > We arrived to Vilnius yesterday and are leaving on Friday evening. If > the weather stays like this, I'm sure some company at the local bars > (after the conference hours) wouldn't hurt =) Simon Willison is keynoting, and he is an original

generate choices list from database

2007-07-08 Thread Stu
In a similar vein to the OP, I'm trying to populate a choices list for a form (using newforms) from a database: nameChoices = Names.objects.filter(initials='AB') NameSelection.base_fields['names'].widget = widgets.Select(choices=nameChoices.Name) However, I am not having much succcess, I get

Re: Database caching, querysets not evaluating?

2007-07-08 Thread Benjamin Slavin
You may want to take a look here: http://groups.google.com/group/django-users/browse_thread/thread/e4e1e0c017655ad/ On 7/8/07, ejot <[EMAIL PROTECTED]> wrote: > > And continuing this monologue :) ... the separate thread ofcourse > didnt quite work as I intended. I see now that a new

Re: function to generate choices list

2007-07-08 Thread Aidas Bendoraitis
I think, the problem would be solved if you assigned a class overriding list instead of a preformed list to the choices. Check XFieldList for a living example: http://www.djangosnippets.org/snippets/51/ Regards, Aidas Bendoraitis aka Archatas On 7/6/07, David Reynolds <[EMAIL PROTECTED]>

Re: How to use Admin modules in my application

2007-07-08 Thread Angela Sutanto
On 7/8/07, Doug B <[EMAIL PROTECTED]> wrote: > As tempting as the pretty admin interface > might be, I think you would be better off rolling your own form and > view for end users. Then you have complete control. Using the > form_for_* functions you could have the whole thing done in a few >

Djangonauts at EuroPython?

2007-07-08 Thread Ville Säävuori
Hello fellow Django-users! Me and my colleague are attending to EuroPython conference (in Vilnius, Lithuania) tomorrow (9.-11.7.) and we were wondering if there are any other Django-users around. It would be great to arrange a Django-meetup or something. We arrived to Vilnius yesterday and are

Re: Django books application i18n

2007-07-08 Thread Gianluca
Thanks...but in my case? I have thought to extends the "change_form.html" generic template. But how can I refer to a field of my data model? ( book name field for example) Thanks. Joseph Heck ha scritto: > I think most everything that you'd like to know is detailed out at >

about django-admin settings

2007-07-08 Thread jujian
I try to use django-admin.py runserver --settings=mysite.settings in Windows shell(cmd.exe) it tells me that : raise EnvironmentError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e) EnvironmentError: Could not import settings

Re: Database caching, querysets not evaluating?

2007-07-08 Thread ejot
And continuing this monologue :) ... the separate thread ofcourse didnt quite work as I intended. I see now that a new connection is created for each thread/polling I create. This brings me back to the original question... how can I force a query to evaluate? Or is there some alternative to

Re: importing users from another db

2007-07-08 Thread ejot
I can answer for the settings part :) Make sure your project is in your PYTHONPATH environment variable and that DJANGO_SETTINGS_MODULE also exists as an environment variable. See http://www.djangoproject.com/documentation/settings/#designating-the-settings On Jul 8, 7:15 am, Carl Karsten