Unit test problem

2008-06-26 Thread laspal
hi, I am writting unit test for the views. class IndustryTest(unittest.TestCase): def setUp( self): self.client = Client() self.client.post('/ibm/login/', {' usrename' :'admin', 'password' : 'abcd'}) def test_addIndustry( self): url = '/ibm/crm/industries/add/'

Re: Unit test problem

2008-06-26 Thread Malcolm Tredinnick
On Thu, 2008-06-26 at 00:02 -0700, laspal wrote: > hi, > I am writting unit test for the views. > > class IndustryTest(unittest.TestCase): > > def setUp( self): > self.client = Client() > self.client.post('/ibm/login/', {' usrename' :'admin', > 'password' : 'abcd'}) > > >

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

2008-06-26 Thread bruno desthuilliers
On 26 juin, 04:15, Mog <[EMAIL PROTECTED]> wrote: > I'm new to Django and I've been able to get to the end of the Django > tutorial using localhost as my server. for some reason I can't get the > form poll to recognize my choices. Regardless whether I click on the > radio buttons and click vote

Re: Accessing a ManyRelatedManager by introspection for JSON/AJAX ?

2008-06-26 Thread Tim Adler
This is a sad self-reply. I got around this problem by using eval() and accessing the collection that way. Be careful with security though! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Development environment

2008-06-26 Thread bruno desthuilliers
On 25 juin, 23:17, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > Hi, > > I'm currently learning django on Ubuntu, but my background is Windows, > so I'm not a VIM kind of guy. What kind of IDE do you guys use or > recommend? emacs + ecb + python-mode + nxhtml-mode + javascript-mode + css-mode

Re: psycopg2

2008-06-26 Thread Valts Mazurs
Hi, Everything is about buying and selling something. If I work in software development company, use python, postgresql and want to use psycopg2 - nice web page helps in "selling" the idea of using psycpg2 to my boss. Of course, nice website is not the only important thing but it helps a lot. Peop

Unicode issue in Admin

2008-06-26 Thread Lee Hinde
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 django admin. Using revision 7763. Using __unicode__ not __str__ Any pointers would be appreciated. Thanks. - Lee --~--~-~--~~

orm syntax

2008-06-26 Thread Thierry
Is this possible and or is there any way to simulate it? objects.order_by('date').group_by('foreign_key').having('auto_done') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: orm syntax

2008-06-26 Thread Russell Keith-Magee
On Thu, Jun 26, 2008 at 5:44 PM, Thierry <[EMAIL PROTECTED]> wrote: > > Is this possible and or is there any way to simulate it? > > objects.order_by('date').group_by('foreign_key').having('auto_done') Right now, no. However, adding support for aggregation is the subject of a Google Summer of Cod

Re: syncdb custom sql containing a create function (pgsql backend)

2008-06-26 Thread [EMAIL PROTECTED]
Hi Malcolm, thanks for clearing it up. On Jun 26, 2:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-06-25 at 08:49 -0700, [EMAIL PROTECTED] wrote: > > Hi all, > > > on a custom SQL file I have a CREATE FUNCTION statement but > > apparently, when doing syncdb, the statement fa

Re: Creating test database with a complete SQL script

2008-06-26 Thread [EMAIL PROTECTED]
Hi Russ, thanks, that's what I'm using currently. Not optimal but I guess it'll have to do. On Jun 26, 12:42 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Wed, Jun 25, 2008 at 11:54 PM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > I'm working on a projec

Re: Do you code django with Komodo?

2008-06-26 Thread Jörn Paessler
Hi Brian, thanks for your reply. I also appreciate to see interest in a Komodo extension. Since we come from the Zope world, we have years of experience with Python. We also invested a lot of work and energy in the topic IDE for Zope: http://zamasing.com . That's reason, why my head is full

Re: wizard authentication

2008-06-26 Thread Nathaniel Whiteinge
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 track! You need to pass your list of forms to the wizard constructor, as you're doing, as well as pass the reque

Re: PIL 1.1.6, jpeg decoder error, going insane...

2008-06-26 Thread sparky
Evert, Thank you for your help, I REALLY appreciate anyone giving me their time, like this. I have fixed it. The issue was to do with the library path and the way that Linux (Fedora Core 3) runs and is configured.I've been running a Linux dedicated server for a while but had no previous experienc

Re: Unicode issue in Admin

2008-06-26 Thread Malcolm Tredinnick
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 django admin. > > Using revision 7763. > > Using __unicode__ not __str__ > >

Re: Development environment

2008-06-26 Thread Ian Lawrence
Hi, >> I'm currently learning django on Ubuntu, but my background is Windows, >> so I'm not a VIM kind of guy. What kind of IDE do you guys use or >> recommend? I use eric4 IDE on ubuntu with the Project Django plugin enabled (sudo apt-get install eric4) Ian -- http://ianlawrence.info --~--~--

using only database part of Django

2008-06-26 Thread Peter
Hello. I want to use Django database API without using other parts of Django (views, templates etc). What is the most correct way of doing that? Of course, I can create a new project with an empty template and view, but it will look bad, cause there will be a lot of needless files in my project

Re: Development environment

2008-06-26 Thread Alex Robbins
Hey, my background was in windows too, but... If you are doing work that will ever require you to log in to remote boxes using ssh, you might as well bite the bullet and learn VIM or emacs. (My vote is for vim, but I don't want to start that war.) That way your favorite editor will already live on

default value for filter in admin pages

2008-06-26 Thread lee
Guys, Is there a way of setting the default value for a filter in the admin site? Class Account(models.model): isClosed = models.BooleanField(blank=True) name = models.CharField(core=True, max_length=255,unique=True) class Admin: list_filter = ['isClosed'] On the admin pag

i18n model - tri-lingual data

2008-06-26 Thread pihentagy
Hi! I have a 3-lingual app, and there are some model fields translated, like this: class Category(models.Model) name_hu = models.CharField(_(u'név (magyar)'), max_length=255,) name_en = models.CharField(_(u'név (angol)'), max_length=255) name_de = models.CharField(_(u'név

Re: using only database part of Django

2008-06-26 Thread pihentagy
Then why django? What about sqlalchemy? On Jun 26, 1:13 pm, Peter <[EMAIL PROTECTED]> wrote: > Hello. > > I want to use Django database API without using other parts of Django > (views, templates etc). > > What is the most correct way of doing that? > > Of course, I can create a new project with

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

2008-06-26 Thread Mog
the form's method is post: {{ object.question }} {% if error_message %}{{ error_message }}{% endif %} {% for choice in object.choice_set.all %} {{ choice.choice }} {{ choice.choice }} {% endfor %} On Jun 26, 2:29 am, bruno desthuilliers <[EMAIL PROTECTED]> wrot

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

2008-06-26 Thread Mog
Here is the model.py file: from django.db import models import datetime class Poll(models.Model): question = models.CharField(maxlength = 200) pub_date = models.DateTimeField('date published') def __str__(self): return self.question def was_published_today(self):

Re: views.py: Always a simple return?

2008-06-26 Thread RossGK
On Jun 25, 4:56 pm, "Richard Dahl" <[EMAIL PROTECTED]> wrote: > Generally with HTTP, you would configure your server to continue to respond > to requests;)  Which is exactly what django does anyway. That's my question - rather than one response to a request I'd like to have several responses.

Re: psycopg2

2008-06-26 Thread bobhaugen
A suggestion for those of you who like psycopg2 and want a fancier site to show yr pointy-haired boss: make one. Either on your own, linked to the project site, or contribute to the project site (with the permission of the developer(s)). --~--~-~--~~~---~--~~ You r

Re: using only database part of Django

2008-06-26 Thread Jeff Anderson
Peter wrote: Hello. I want to use Django database API without using other parts of Django (views, templates etc). What is the most correct way of doing that? You still need to create a settings.py, and tell your script where it is. import os os.environ['DJANGO_SETTINGS_MODULE']='mypy

Amisha Patel Maxim Magazine Photo Scans

2008-06-26 Thread ALI RAHMAN
For More Pics, Photos, Movie Etc. Visit On *http://celebmasti.blogspot.com/* --~--~-~--~~~---~--~~ 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

Re: views.py: Always a simple return?

2008-06-26 Thread RossGK
My sense is that comet is tied to the use of iFrames. From my limited knowledge of iFrames, they are falling from favour with less w3c support and are the key to some security exploits. Is that a fair assessment? The extra Orbited server also makes me hesitate... Simplicity and all that. But

How to use dynamic choice in a ChoiceField

2008-06-26 Thread mwebs
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 ChoiceField... something like:

The Lost Fingers

2008-06-26 Thread Dan
This isn't related to Django the framework but Django the musician, I figure you'd find it interesting anyway. I saw in the newspaper this morning that a group from Quebec called The Lost Fingers released an album called Lost in the 80's where they play well known songs in Django Reinhardt style.

Re: Add filters to the Users List/Page in the admin app

2008-06-26 Thread Rajesh Dhawan
Hi Rishabh, On Jun 24, 12:19 am, "Rishabh Manocha" <[EMAIL PROTECTED]> wrote: > Ok, so I need a bit more direction here. I've got newforms-admin setup and > working as far as displaying the various FK relationships a user has on > his/her page. However, I'm still not able to figure out how to dis

Re: psycopg2

2008-06-26 Thread Will
Perhaps there's another problem here. As far as I know, Django doesn't support the pygresql or pg/python drivers. http://python.projects.postgresql.org/ A very trustworthy looking website :) http://www.djangoproject.com/documentation/design_philosophies/ >Loose coupling >A fundamental goal of D

Re: eclipse, your favourite plugins

2008-06-26 Thread bobhaugen
On Jun 25, 11:09 am, Thierry <[EMAIL PROTECTED]> wrote: > Subversive (don't use it actually, becomes to slow for large projects) I've used Subclipse on what I thought were reasonably large projects, with no particular problems. Don't know how big yours are. Biggest I got now is 2.5MB. Have had

using limit_choices_to in foreignKey

2008-06-26 Thread mariu
hello, have the following problem with limit_choices_to: class Actividad(models.Model): nombre=CharField(max_length=50,core=True) Tipo_Anexo=ForeignKey('Tipo_Anexo',edit_inline=models.TABULAR) class Anexo_Contrato(models.Model): nombre=CharField(max_length=50) Ti

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          = forms.ImageField(label='Pict

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 a

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 PayDetailFor

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 = forms.ModelChoic

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 y

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: 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 <[EMAIL

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: 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 specific

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 use

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 tr

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

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 ver

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 nothi

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 Keste

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... a

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 t

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 ex

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 htm

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 thes

Re: base template and views

2008-06-26 Thread Peter Rowell
> Anyone know what I really ought to be doing? What you want is a default context. Look at http://www.djangoproject.com/documentation/templates_python/#playing-with-context-objects Also see http://www.djangoproject.com/documentation/settings/#template-context-processors. Pretty much all of our

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. > > > > [1]:http://www.djangoproject.com/document

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, target_status_

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 c

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... http://www.djangoproject.com/documentation/templates_python/#writing-

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: 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, t

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 Me

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: 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 so

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: 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 djan

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 mo

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 exce

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

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 dj

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: 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$ pyth

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(), empty

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 group,

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 > C

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. No

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 e

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 linebre

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 PictureFor

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: 'PythonHandl

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 n

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: http://pastebin.sfee-hosted

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 = forms.ImageField(label='Picture')

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 l

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 line

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 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: 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: 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/$', billpay.views.DoPayDetail

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 beh

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/' > Loca

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 yo

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 > y

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: 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, becau

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 and

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: 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 when

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 get_object_or

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

  1   2   >