Permissiond

2008-06-26 Thread [EMAIL PROTECTED]
I don't understand why I keep getting "permission denied" when I try to install Django. Here is what I get when trying to install as the Admin: svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk svn: Can't make directory 'django-trunk': Permission denied I've had the same

Custom field in JSON serializer

2008-06-26 Thread M.Ganesh
Hi All, I picked up this sample code from django documentation: from django.core import serializers data = serializers.serialize('xml', SomeModel.objects.all(), fields=('name','size')) How do I extend this to do the following: data = serializers.serialize('xml', SomeModel.objects.all(),

Re: ImportError: No module named _md5

2008-06-26 Thread Grunev Ivan
Hello You need to install md5 module at first. On Thu, 2008-06-26 at 22:28 -0700, [EMAIL PROTECTED] wrote: > Hello, > > I'm trying to install MySQL-python-1.2.2 and don't know how to resolve > tis error: > > jason-neridas-macbook:~ jasonnerida$ cd /Users/jasonnerida/Downloads/ >

ImportError: No module named _md5

2008-06-26 Thread [EMAIL PROTECTED]
Hello, I'm trying to install MySQL-python-1.2.2 and don't know how to resolve tis error: jason-neridas-macbook:~ jasonnerida$ cd /Users/jasonnerida/Downloads/ MySQL-python-1.2.2 jason-neridas-macbook:MySQL-python-1.2.2 jasonnerida$ python setup.py build Traceback (most recent call last): File

Re: Django Database Relationship Question

2008-06-26 Thread [EMAIL PROTECTED]
You may also be interested in this ticket: http://code.djangoproject.com/ticket/6095 (which will hopefully be hitting relatively soon). On Jun 26, 11:27 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > You'd almost think they were handing out prizes for being quickest on   > the draw :) > > On

Re: Django Database Relationship Question

2008-06-26 Thread Eric Abrahamsen
You'd almost think they were handing out prizes for being quickest on the draw :) On Jun 27, 2008, at 12:18 PM, joshuajonah wrote: > > And this is why the Django community rocks, two examples and a full > explaination with a link in less than 10 minutes, GW guys > > On Jun 26, 11:55 pm,

Re: Django Database Relationship Question

2008-06-26 Thread joshuajonah
And this is why the Django community rocks, two examples and a full explaination with a link in less than 10 minutes, GW guys On Jun 26, 11:55 pm, bhunter <[EMAIL PROTECTED]> wrote: > Hi, sorry for what is probably a trivial question, but I'm new to > Django and a little fuzzy on databases in

Re: Django Database Relationship Question

2008-06-26 Thread Eric Abrahamsen
Hey there, A M2M field creates an intermediary join table which doesn't show up in the admin, or other places. It's basically just a pairing of Journalist ids with Article ids, and the M2M field is a convenience that allows you to ignore this table. If you want to add additional

Re: Django Database Relationship Question

2008-06-26 Thread Julien
Hi, To do that I would use an auxilliary model: class Journalist(models.Model): pass class Article(models.Model): pass class JournalistArticleRelationship(models.Model): journalist = models.ForeignKey(Journalist) article = models.ForeignKey(Article) status = models.Charfield()

Re: Django Database Relationship Question

2008-06-26 Thread joshuajonah
Well you'd want a relational table of author status', some thing like this: class Journalist(models.Model): name = models.Charfield() class Article(models.Model): articles = models.Charfield class State(models.Model): state = models.CharField() class Article_relationship(models.Model):

Django Database Relationship Question

2008-06-26 Thread bhunter
Hi, sorry for what is probably a trivial question, but I'm new to Django and a little fuzzy on databases in general, so I hope someone here can help. Just to keep the motif, I'll frame my question in terms of journalism. I'd like to set up a database with the following relationships: a model

Re: manage.py dumpdata and swap

2008-06-26 Thread Malcolm Tredinnick
On Thu, 2008-06-26 at 19:57 -0700, [EMAIL PROTECTED] wrote: > Hello > > I have a small server, just 5 users and I use the django for data > entry. My server have only 512MB of RAM but it is enough and it work > really well. But whenever I run "manage.py dumpdata xml" --format=xml" > for backup

manage.py dumpdata and swap

2008-06-26 Thread [EMAIL PROTECTED]
Hello I have a small server, just 5 users and I use the django for data entry. My server have only 512MB of RAM but it is enough and it work really well. But whenever I run "manage.py dumpdata xml" --format=xml" for backup purposes it uses all my RAM and start filling the swap space on my

Re: The Lost Fingers

2008-06-26 Thread [EMAIL PROTECTED]
While definitely off-topic, I appreciate the heads up. I live in a world where the framework and the guitarist often intersect. On Jun 26, 9:01 am, Dan <[EMAIL PROTECTED]> wrote: > This isn't related to Django the framework but Django the musician, I > figure you'd find it interesting anyway. >

Problems setting up LDAP backend

2008-06-26 Thread satish
Hi All, I was able to setup review board with the default auth backend. However I am having problem setting it with LDAP. Here is what I did: 1). I added the following to the settings_local.py. Restarted the server "manage.py runserver 0.0.0.0:8000" I made sure all the LDAP props are correct.

Re: Development environment

2008-06-26 Thread Michael Wieher
I prefer command line, vi its always the same, no matter if you ssh, log on locally, connect via sat-modem On Thu, Jun 26, 2008 at 7:39 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I use kubuntu+kate, and I just use a terminal for running code and > such. > > >

Re: Development environment

2008-06-26 Thread [EMAIL PROTECTED]
I use kubuntu+kate, and I just use a terminal for running code and such. --~--~-~--~~~---~--~~ 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

Re: i18n model - tri-lingual data

2008-06-26 Thread Julien
I reckon your view should check what the language is set in the request (request.LANGUAGE_CODE), and then pull out the right field from the model. On Jun 26, 11:22 pm, pihentagy <[EMAIL PROTECTED]> wrote: > Hi! > > I have a 3-lingual app, and there are some model fields translated, > like this:

Re: Stability of trunk and 1.0 target: experience, testimonials?

2008-06-26 Thread Julien
Hi, As far as I'm concerned, I only use the trunk in all my projects. For more testimonials and advice, check these earlier threads: http://groups.google.com/group/django-users/browse_thread/thread/93ec5b37ef0cf3ab/7d9a1dd11c91c8b0?lnk=gst=trunk+stable#7d9a1dd11c91c8b0

Re: mod_python install

2008-06-26 Thread Julien
Maybe can you try this: http://cavedoni.com/2005/django-osx On Jun 27, 9:00 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm trying to set up Python 2.5.2 and Django onmy Mac osx 10.4.11 > But i'm a complete newbie in thing like this and command line > mastering. > I'm not

Re: site_media paths

2008-06-26 Thread Alex Slesarev
> All my static files (css, js and so forth) live under a folder called > media Rename the directory - mod_python uses 'media' dir from django itself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Problems retrieving array from POST

2008-06-26 Thread Alex Slesarev
> def post_handler(request): >     post_text = request.POST.getlist('data') >     user = User.objects.get(id=2) # for debugging purposes >     for x in range( len(post_text)-1 ): >         name = post_text[x] >         panel = > user.panels_set.get(name__istartswith=name,side="left") >        

mod_python install

2008-06-26 Thread [EMAIL PROTECTED]
Hi there, I'm trying to set up Python 2.5.2 and Django onmy Mac osx 10.4.11 But i'm a complete newbie in thing like this and command line mastering. I'm not feeling really confident a the moment in what i do. I'm following tho django book install on the django project web site. the Python and

Re: Full list of Django features?

2008-06-26 Thread Brian Luft
A lot of that depends on what you would consider a feature vs. what you think a modern web framework should provide by default. Aside from the points listed on the home page, I would suggest going to the documentation page and look down the list of reference topics. Those are all "features" in a

Re: Blank choice for USStateField?

2008-06-26 Thread Nathaniel Whiteinge
On Jun 26, 12:00 pm, Huuuze <[EMAIL PROTECTED]> wrote: > Just out of curiosity, are the Django devs working on a patch?  I > wasn't able to find a ticket for this issue. Little consistency tweaks like this one will become more important once 1.0 lands, imo.

Problems retrieving array from POST

2008-06-26 Thread elspiko
Hi all, I've fairly new to django but i'm loving it! I've got some draggable panels on a site and want to save their positions so when a user logs back in, the panels are in the same place when they last hit the save button. What I'm doing is (using jQuery) retrieving the id's of the panels,

Re: psycopg2

2008-06-26 Thread Russell Keith-Magee
On Thu, Jun 26, 2008 at 10:05 PM, Will <[EMAIL PROTECTED]> wrote: > > Couldn't Django be pluggable with respect to the Database drivers? > There's a DBAPI2 interface spec, therefore it should be possible. Erm... the database backends _are_ pluggable. Hence, the DATABASE_ENGINE setting. If you

Re: Problem logging in to admin using Safari

2008-06-26 Thread Jacob Kaplan-Moss
Hey Pieter -- You may want to experiment with the SESSION_COOKIE_DOMAIN setting (http://www.djangoproject.com/documentation/settings/#session-cookie-domain); it could be that Safari's doing strange things with ".local" session cookies and doing something explicit could help. Worth a shot, at

Re: site_media paths

2008-06-26 Thread alce
Oops, sorry, the line: All my static files (css, js and so forth) live under a folder called main should read All my static files (css, js and so forth) live under a folder called media Thanks On Jun 26, 4:57 pm, alce <[EMAIL PROTECTED]> wrote: > Hi, I've just started playing with Django

site_media paths

2008-06-26 Thread alce
Hi, I've just started playing with Django and I must say I'm impressed. It's easy, it's fast, it's beautiful. I wrote a small app and will be going to production soon. I deployed the site to a staging server and I'm having some trouble serving static files (I keep getting 404's). I realize it's

Re: how to get form fields to show

2008-06-26 Thread Hanne Moa
On Thu, Jun 26, 2008 at 11:07 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > Ok i've got the form fields showing fine. My form action is "." per > the examples in the documentation. The form is submitting and tracing > through the view but i get a "view didn't return an >

Re: ModelChoiceField setting value manually

2008-06-26 Thread Adi
This may sound like a cop out, but why can't you create a gallery object with that default value. Then when you construct your query set, you can create so that that default option is returned. This would enable you to both display the correct option, as well as work during the validatio step.

Re: default value for filter in admin pages

2008-06-26 Thread OliverMarchand
This is just an idea... didn't try this. Could you not use HttpRedirect in your url conf to redirect the standard view of that models admin with the default filter value? This is not the most convenient way, but it should work... On 26 Jun., 14:25, lee <[EMAIL PROTECTED]> wrote: > Guys, > > Is

Re: Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Alfonso
Thanks Karen and Brian for your suggestions. Turned out a combination of the two (got to read those error messages more closely - cough) It was incorrect radio_admin syntax in the 'pluggable' basic blog app - http://code.google.com/p/django-basic-apps/, had to clear pyc's as well. Now got a

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
disregard this last post... i figured it out thanks --~--~-~--~~~---~--~~ 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

Full list of Django features?

2008-06-26 Thread Phillip B Oldham
I'm looking to propose python+django for a new project at work, as I feel it will be a good fit. Generally everything is done in PHP, so its going to be a bit of a change. I've already gathered a list of benefits to using python (fully oo, maintainability across developers, etc), now I just need

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
Ok i've got the form fields showing fine. My form action is "." per the examples in the documentation. The form is submitting and tracing through the view but i get a "view didn't return an HttpResponse.object. here's my view: from forms import * from django.shortcuts import

Re: Stability of trunk and 1.0 target: experience, testimonials?

2008-06-26 Thread Dan
> Hi folks, > > I'm trying to champion Django trunk/1.0 as part of a small project in > a mid-sized city newspaper office. There is some worry about choosing > a framework which does not currently have a stable release. Django has a stable release (0.96), it will have an *API-stable* release

Re: Why I can't include external javascript???

2008-06-26 Thread Karen Tracey
On Thu, Jun 26, 2008 at 4:22 PM, JPC <[EMAIL PROTECTED]> wrote: > > Maybe Im wrong in some stupid thing because Im a Django newbie. > My problem is with external JS file. Im trying to include it in the > usual HTML way > (i.e.

Re: Why I can't include external javascript???

2008-06-26 Thread Michael Wieher
Key Reference: http://www.djangoproject.com/documentation/static_files/ You need 2 in your HTTPD configuration file, one for things that will be processed by Django, one for static files. Thus, you need to actually put your static JS files on a /var/www/static-file/ or some web-served thing

Re: how to get form fields to show

2008-06-26 Thread rskm1
> urlpatterns = patterns('', > (r'/step-1.html', 'billpay.views.DoPayDetailForm'), > ) > > Wouldn't this call the dopaydetailform view if you went to the page / > step-1.html ? At this stage, while you're still learning, I would AVOID making URL mappings that "appear" to be HTML files,

Why I can't include external javascript???

2008-06-26 Thread JPC
Maybe Im wrong in some stupid thing because Im a Django newbie. My problem is with external JS file. Im trying to include it in the usual HTML way (i.e.

Re: Django setup with apache

2008-06-26 Thread phillc
your urls is setup for http://yourdomain.com/login/... not http://yourdomain.com/sommerspil/login On Jun 26, 11:46 am, Peter Rowell <[EMAIL PROTECTED]> wrote: > You didn't share with us the specific error you are getting. > > I strongly recommend a) DEBUG=True in settings.py, and b) checking >

Re: url views problem

2008-06-26 Thread Emil Styrke
This line: query = show.objects.filter(show_feed__contains="http://;) selects all shows that have a feed url(?) containing "http://;. The for loop then loops through these items and passes each one to feedparser. If you want to view only one show you have to change this to use the show ID

Re: problem getting mod_python to serve application..

2008-06-26 Thread phillc
go to a python interpreter import sys sys.path make sure that directory is in there On Jun 26, 2:34 pm, Adi <[EMAIL PROTECTED]> wrote: > I get the following error when I hit my websitehttp://ipaddress/enterathletes/ > > DocumentRoot:   '/var/www/html' > > URI:            '/enterathletes/' >

Re: Problem logging in to admin using Safari

2008-06-26 Thread Emil Styrke
I guess it depends on what you mean by "client related". If Safari is the only browser exhibiting this behavior I think it's safe to assume that the web server is doing OK. This assumption is only strengthened by the fact that only a change of the name the server is accessed through changes the

Re: how to get form fields to show

2008-06-26 Thread Huuuze
> urlpatterns = patterns('', >     (r'/step-1.html', 'billpay.views.DoPayDetailForm'), > ) > > Wouldn't this call the dopaydetailform view if you went to  the page / > step-1.html ? It's close. Re-write it as such: > urlpatterns = patterns('', > (r'^step-1.html/$',

Re: Attachments in Django

2008-06-26 Thread bruno desthuilliers
On 26 juin, 19:45, "Greg Lindstrom" <[EMAIL PROTECTED]> wrote: (snip) > My question deals with handling attachments to the announcements. (snip) > I would like to set things up so we can have downloads (pdf, > Word, etc.) (snip) associated with the announcement. (snip) > Can I, or rather how do

Re: newforms and views.generic.create_update.create_object

2008-06-26 Thread Brian Rosner
On Jun 26, 2008, at 1:23 PM, timc3 wrote: > > Might be a stupid question but how did you apply the patch? Get inside your Django directory and execute:: patch -p0 < the_path.diff That should get it going. Let me know if you have any more questions. Brian Rosner http://oebfare.com

Re: Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Brian Rosner
On Jun 26, 2008, at 10:09 AM, Alfonso wrote: > > TypeError: __init__() got an unexpected keyword argument > 'radio_admin'. > > Where did that come from? Sounds like you may have some lingering .pyc files that might be causing this from newforms-admin if you have switched your copy of Django

Re: newforms and views.generic.create_update.create_object

2008-06-26 Thread timc3
Might be a stupid question but how did you apply the patch? On May 12, 5:06 pm, Wes Winham <[EMAIL PROTECTED]> wrote: > I've been using Brian Rosner's patch from that ticket, and it's been > working great for me. I haven't ran in to any bugs so far and it's cut > my view code down by several

Re: I'm sure this is one of those clueless newbie mistakes

2008-06-26 Thread Colin Bean
For a start, you want your KVM model to subclass models.Model. Colin On Thu, Jun 26, 2008 at 11:59 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Karen; > > On Jun 26, 12:56 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: >> If you post the contents of your cmdb/models.py file on someplace

Validation Problem with ModelChoiceField

2008-06-26 Thread mwebs
Hello, I have a serious validation problem with a form using a ModelSchoiceField. Forms: class MyModelChoiceField(forms.ModelChoiceField): def label_from_instance(self, obj): return "%s" % obj.name class PictureForm(forms.Form): image =

Re: I'm sure this is one of those clueless newbie mistakes

2008-06-26 Thread [EMAIL PROTECTED]
Karen; On Jun 26, 12:56 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > If you post the contents of your cmdb/models.py file on someplace like > dpaste.com someone might be able to help identify what is going on. Thanks for that advice. You can find my models.py at:

User Filtering

2008-06-26 Thread Greg Taylor
I've got a model that represents a boat of rowers which has eight seats (order is important). The easiest way to handle this was a model with eight foreign keys: class Boat(models.Model): seat_1 = models.ForeignKey(User) [...] seat_8 = models.ForeignKey(User) Which is fine and great, but

problem getting mod_python to serve application..

2008-06-26 Thread Adi
I get the following error when I hit my website http://ipaddress/enterathletes/ DocumentRoot: '/var/www/html' URI:'/enterathletes/' Location: '/enterathletes/' Directory: None Filename: '/var/www/html/enterathletes' PathInfo: '/' Phase:

Re: How to use dynamic choice in a ChoiceField

2008-06-26 Thread M.Ganesh
mwebs wrote: > Thanks Nathaniel, > > but where and how do I pass the Queryset? From my view? > I am sorry but I dont understand completly > > class MyModelChoiceField(forms.ModelChoiceField): > def label_from_instance(self, obj): > return "My Object #%i" % obj.id > > > class

Re: Do you code django with Komodo?

2008-06-26 Thread rskm1
On Jun 24, 4:22 pm, Tye <[EMAIL PROTECTED]> wrote: > Semi-off-topic: > Does anybody know how to get notepad to save as UTF-8 by default? It > keeps trying ANSI, and I keep hating. Unlikely; Notepad is REALLY lightweight. Wordpad is MUCH better; it handles files >64K, files with UNIX-style

Re: Blank choice for USStateField?

2008-06-26 Thread Huuuze
You da man. That worked perfectly. Just out of curiosity, are the Django devs working on a patch? I wasn't able to find a ticket for this issue. On Jun 26, 12:46 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > On Jun 26, 8:29 am, Huuuze <[EMAIL PROTECTED]> wrote: > > > How can I add an

Attachments in Django

2008-06-26 Thread Greg Lindstrom
I am just about ready to launch my first Django Website! It for a local gym where my daughter trains and I offered to rewrite their current site because it's out of date (www.sonshineacademy.com). I've set up the database to handle their announcements and I think it's going to work out fine.

Re: How to use dynamic choice in a ChoiceField

2008-06-26 Thread M.Ganesh
mwebs wrote: > Hello, > > I am trying to do something like this > > class PictureForm(forms.Form): > image = forms.ImageField(label='Picture') > gallery= forms.ChoiceField(Gallery.objects.all()) > > this just works fine, but I only want to pass several Galleries to the >

Is it possible to collapse stacked or table inline in newforms-admin?

2008-06-26 Thread AmanKow
I don't want to collapse the individual items, but the whole stack or table. Anyone know how to go about this? Thanks Wayne --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

ModelChoiceField setting value manually

2008-06-26 Thread mwebs
Hello, I try to set data for a ModelChoiceField() manually. This means the data is not in my db, so it s not in a Queryset. my form: class PictureForm(forms.Form): image = forms.ImageField(label='Picture') gallery= MyModelChoiceField(models.Gallery.objects.none(),

Re: I'm sure this is one of those clueless newbie mistakes

2008-06-26 Thread Karen Tracey
On Thu, Jun 26, 2008 at 12:22 PM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > I'm a little stumped right now. > > I'm trying to run syncdb, on a project that I'm really just starting > to work on/build, and I get this error message: > > [EMAIL PROTECTED]:~/NotBackedUp/cmdb-svn/src/cmdb$

Re: Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Karen Tracey
On Thu, Jun 26, 2008 at 12:09 PM, Alfonso <[EMAIL PROTECTED]> wrote: > > Just updated to latest svn checkout of Django and seeing this error > for the first time at root (across the entire site actually)?? > > TypeError: __init__() got an unexpected keyword argument > 'radio_admin'. > > Where did

Re: Blank choice for USStateField?

2008-06-26 Thread Nathaniel Whiteinge
On Jun 26, 8:29 am, Huuuze <[EMAIL PROTECTED]> wrote: > How can I add an empty value as the initial value? At the moment you have do a bit of leg-work for this. Something like the following should work (untested):: from django.contrib.localflavor.us.us_states import STATE_CHOICES from

Timeout for URLField?

2008-06-26 Thread jabbercat
Hello, does somebody know if there is a possibility to specify a timeout for the URLField? I'm just using a URLField, but if the URL is not correct the URLField needs a lot of time to response with an error. Thanks for help --~--~-~--~~~---~--~~ You received this

Stability of trunk and 1.0 target: experience, testimonials?

2008-06-26 Thread J Meier
Hi folks, I'm trying to champion Django trunk/1.0 as part of a small project in a mid-sized city newspaper office. There is some worry about choosing a framework which does not currently have a stable release. I've been addressing these worries with examples of the stability of trunk and the

I'm sure this is one of those clueless newbie mistakes

2008-06-26 Thread [EMAIL PROTECTED]
I'm a little stumped right now. I'm trying to run syncdb, on a project that I'm really just starting to work on/build, and I get this error message: [EMAIL PROTECTED]:~/NotBackedUp/cmdb-svn/src/cmdb$ python manage.py syncdbError: Couldn't install apps, because there were errors in one or more

Re: Unicode issue in Admin

2008-06-26 Thread Lee Hinde
On Jun 26, 4:10 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-06-26 at 01:41 -0700, Lee Hinde wrote: > > Hi; > > > Exhibits are here: > > >http://hinde.net/clients/djangoq/ > > > Summary, I have accented data that displays fine in my sql browser, > > but shows up funky in

Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Alfonso
Just updated to latest svn checkout of Django and seeing this error for the first time at root (across the entire site actually)?? TypeError: __init__() got an unexpected keyword argument 'radio_admin'. Where did that come from? Help appreciated! Alfonso

Re: Group by week

2008-06-26 Thread Chris H.
On Jun 26, 10:44 am, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Chris, I have a utility function that does this for me.  You can call it > from your view, or if you set things up right from your template: Good stuff, Scott. Thanks! Might be worth turning into a proper template tag/filter at

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
> Hey no problem -- great you are learning new skills after that much > time. I did not mean to sound abrasive. I don't think you sounded abrasive @ all... I appreciate the hand up on this stuff. Definitely different (and a hell of a lot better) than programming with MS. here's what i've added

Re: views.py: Always a simple return?

2008-06-26 Thread Norman Harman
RossGK wrote: > > Stuff I think you don't want HTTP. In other words you are wanting (like the Comet folks) HTTP to do things it was not designed to do. In other words you are avoiding its strengths and chasing after its weaknesses. Not sure what your real requirement is but, Look at the

Re: Django setup with apache

2008-06-26 Thread Peter Rowell
You didn't share with us the specific error you are getting. I strongly recommend a) DEBUG=True in settings.py, and b) checking your Apache error_log. If you are getting a generic Apache 404, then the problem will be in the Apache httpd.conf or .htaccess files. If you are getting a Django 404,

Re: Group by week

2008-06-26 Thread Scott Moonen
Chris, I have a utility function that does this for me. You can call it from your view, or if you set things up right from your template: from datetime import date def most_recent_Sunday(dt = None) : if dt is None : dt = date.today() return date.fromordinal(date.toordinal(dt) - (dt.weekday()

Re: base template and views

2008-06-26 Thread Eric Abrahamsen
Probably what you want is to make a custom template tag that does the proper query-to-html business, and then stick that tag in your base template. Might want to look into caching the result, if it doesn't change often...

Group by week

2008-06-26 Thread Chris H.
I have a view which returns a group of upcoming events. I would like to display the events grouped by week: Week of June 22 * Event 1 * Event 2 * Event 3 Week of June 29 * Event 4 * Event 5 * Event 6 I've seen examples for doing this using the ifchanged tag, and I've got that working. But I

Re: Unit test problem

2008-06-26 Thread Norman Harman
Malcolm Tredinnick wrote: > Status code 302 is an HTTP redirect, which is what you would expect to > see, since your view is always returning a HttpResponseRedirect. The > test framework doesn't follow redirects. What about? assertRedirects(response, expected_url, status_code=302,

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
On Thu, 2008-06-26 at 08:19 -0700, Bobby Roberts wrote: > > But you should really start with the tutorial[1] or the Django Book[2]. > > The documentation for Django is really outstanding, you'll progress much > > faster if you do some more reading. > > > >

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
> But you should really start with the tutorial[1] or the Django Book[2]. > The documentation for Django is really outstanding, you'll progress much > faster if you do some more reading. > > [1]:http://www.djangoproject.com/documentation/ > [2]:http://www.djangobook.com/ - Yeah i've got

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
On Thu, 2008-06-26 at 08:10 -0700, Bobby Roberts wrote: > Hey - > > i've only included a single line in my urls file as follows: > > urlpatterns=patterns('django.views.generic.simple', > (r'step-1.html', 'direct_to_template', {'template': > 'step1.html'}), > > > This obviously calls my

base template and views

2008-06-26 Thread moonsand
I have a design issue where i want to have a standard base template display a list of database entries with a count for the most popular entries. If I am using this as the base template this means that I need to pass the list and the calculated count from any view which calls any template which

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
> Do you have an URLconf entry for your DoPaymentDetailForm view? Are you > sure, the view gets called? > Maybe you have an error in your Django Template? How do you access the > fields? (Something like {{ form.your_field }} should work.) > > Matthias My urls.py file only has the call for the

language should be part of the url

2008-06-26 Thread pihentagy
Hi! As I read in http://groups.google.com/group/django-users/browse_thread/thread/f8558f8c4c0de564/28ae8a6ecbb921ff the current language should be part of the URL. Just a little question: how can I achieve that without messing up all my reverse function, and of course links in the template...

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
Hey - i've only included a single line in my urls file as follows: urlpatterns=patterns('django.views.generic.simple', (r'step-1.html', 'direct_to_template', {'template': 'step1.html'}), This obviously calls my html page. how do i call the view? BR On Jun 26, 10:52 am, Matthias

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
On Thu, 2008-06-26 at 08:01 -0700, Bobby Roberts wrote: > Hi Matthias - > > I changed my view name to DoPaymentDetailForm and still no luck. Does > something have to call this view or does Django just do it > automatically? > > I'm not sure what you are talking about. Django does nearly

Django setup with apache

2008-06-26 Thread Gorm
Hi all, I have a weird problem hitting the methods matched through urls.py. My setup works through when I just set it up manually using python manage.py runserver 0.0.0.0:8000 etc, but not when using apache The path to the the application is /home/dradmin/wwwroot/php/drmu/sommerspil I have

Re: how to get form fields to show

2008-06-26 Thread Bobby Roberts
Hi Matthias - I changed my view name to DoPaymentDetailForm and still no luck. Does something have to call this view or does Django just do it automatically? BR On Jun 26, 10:52 am, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > Hi, > > > > On Thu, 2008-06-26 at 07:30 -0700, Bobby Roberts

Re: wizard authentication

2008-06-26 Thread twenger26
That fixed the problem, thanks! On Jun 26, 6:00 am, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > On Jun 25, 12:13 pm, twenger26 <[EMAIL PROTECTED]> wrote: > > > def wrapper_for_wizard(request): > > return AddOrderWizard([OrderForm1, OrderForm2Quote, OrderForm3]) > > You're on the right

Re: Need help with django poll tutorial (poll form doesn't work)

2008-06-26 Thread Mog
Actually I did have spaces. I removed them and BAM... they worked! Thanks for you help. On Jun 26, 9:42 am, phillc <[EMAIL PROTECTED]> wrote: > > > do you have spaces around post? > > i dont even know if that would cause the problem. > > if you ar eusing the dev console, the way to debug is

Re: how to get form fields to show

2008-06-26 Thread Matthias Kestenholz
Hi, On Thu, 2008-06-26 at 07:30 -0700, Bobby Roberts wrote: > hey - > > got a quick question. I think i'm missing part of the puzzle here. > > I have a form set up in a forms.py file. In my template i have it > hand coded instead of using {{form.as_table}} because I want to be > very

Re: How to use dynamic choice in a ChoiceField

2008-06-26 Thread mwebs
Thanks Nathaniel, but where and how do I pass the Queryset? From my view? I am sorry but I dont understand completly class MyModelChoiceField(forms.ModelChoiceField): def label_from_instance(self, obj): return "My Object #%i" % obj.id class PictureForm(forms.Form): image

Re: Need help with django poll tutorial (poll form doesn't work)

2008-06-26 Thread phillc
do you have spaces around post? i dont even know if that would cause the problem. if you ar eusing the dev console, the way to debug is use the print statement so put these someplace and tell us what you get print request.method print request.POST['choice'] On Jun 26, 9:29 am, Mog

Re: views.py: Always a simple return?

2008-06-26 Thread Scott Moonen
Ross, I had one more thought. Are most browsers capable of using persistent HTTP for XMLHttpRequests? If so, and *assuming your main motivation is simply to be more efficient by using a single HTTP connection* for your traffic, then I think you might be able to implicitly exploit persistent HTTP

Re: views.py: Always a simple return?

2008-06-26 Thread Scott Moonen
Ross, it seems to me that there are a number of potential hurdles to holding a connection open for a long period: 1. Some server configurations may require that requests be satisfied within a certain time period or else the connection will be reset. Of course, since the server is under

Re: How to use dynamic choice in a ChoiceField

2008-06-26 Thread Nathaniel Whiteinge
On Jun 26, 7:53 am, mwebs <[EMAIL PROTECTED]> wrote: > gallery = forms.ChoiceField(Gallery.objects.filter( ...)) You want to use a ModelChoiceField [1] instead of a ChoiceField. It takes a QuerySet as an argument:: class PictureForm(forms.Form): ... gallery =

how to get form fields to show

2008-06-26 Thread Bobby Roberts
hey - got a quick question. I think i'm missing part of the puzzle here. I have a form set up in a forms.py file. In my template i have it hand coded instead of using {{form.as_table}} because I want to be very specific on how it looks and operates. I have a view as follows: def

Blank choice for USStateField?

2008-06-26 Thread Huuuze
I'm using a ModelForm to render a model that contains a USStateField. >> state = models.USStateField(blank=True, null=True) Unfortunately, when it renders, the first selection is always "Alabama" rather than "--" or some other defined blank value (i.e., "Please select a state"). How can I

Re: How to use dynamic choice in a ChoiceField

2008-06-26 Thread phillc
model choice field http://www.djangoproject.com/documentation/newforms/#fields-which-handle-relationships On Jun 26, 9:53 am, mwebs <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to do something like this > > class PictureForm(forms.Form): >     image          =

  1   2   >