file upload formset

2010-04-16 Thread Alfredo Alessandrini
Hi, I'm trying to upload a file by a formset. model.py: --- class Person(models.Model): user = models.ForeignKey(User) course = models.TextField(blank=True, null=True) project = models.TextField(blank=True, null=True) CV_ENG = models.FileField(upload_to='upload/CV/',

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-16 Thread hcarvalhoalves
Why do you have to "make a choice"? Learn both. They can be useful in many different ways. I learned Rails (and Ruby) before Django, because I saw some material for Ruby that got me interested in hacking on it. Some time later, Rails got really popular. Then lately I learned Python and Django, and

error with forms

2010-04-16 Thread JoJo
Hi all, i have an error here im not sure what it means can anyone help me here is my models.py file## class AddStuffForm(forms.Form): title = forms.CharField(max_length=100) body = forms.CharField(widget = forms.Textarea()) def save(self): new_gossip = Gossip

Re: form won't save my submitted form

2010-04-16 Thread Joanne Culligan
ok but now i am getting more errors such as Traceback: File "c:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "c:\django\gossip2go\..\gossip2go\applications\views.py" in add_gossip

Re: form won't save my submitted form

2010-04-16 Thread JoJo
ok i did that but now i am getting more errors such as Traceback: File "c:\Python26\lib\site-packages\django\core\handlers\base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "c:\django\gossip2go\..\gossip2go\applications\views.py" in

Re: form won't save my submitted form

2010-04-16 Thread ge...@aquarianhouse.com
def save(self): # Better: don't overwrite save method if form.is_valid(): form.save() and you are fine On Apr 17, 12:30 am, JoJo wrote: > Hi all, i have created a site where users can leave messages, and > their opinions on certain topics, i have the form inserting the data, > and

form won't save my submitted form

2010-04-16 Thread JoJo
Hi all, i have created a site where users can leave messages, and their opinions on certain topics, i have the form inserting the data, and i have the data saving but when i refresh the page the data disappears, also when i insert some data into the another text area i am getting an error saying E

Re: PyAmf+Django and foreign keys

2010-04-16 Thread Hviid
Hi try: class Model4(models.Model): model3=ForeignKey(Model3, blank=true, null=true) Regards Martin On 13 Apr., 04:14, Jurassic wrote: > Guys, can you please share your approach to handle complex models > where each model has a ForeignKey to another? I am trying to build a > flex app using Rem

Re: weird import errors in my middleware

2010-04-16 Thread anentropic
Well, it seems pretty clear from a few further tests that you can't import models at all from within a middleware. Would be nice if that limitation was documented On Apr 16, 9:12 pm, anentropic wrote: > if it helps, my exclusive_boolean_fields function looks like: > > def exclusive_boolean_field

Re: how to install django in ubuntu .........

2010-04-16 Thread ChrisR
Download this: http://www.djangoproject.com/download/1.1.1/tarball/ or wget http://www.djangoproject.com/download/1.1.1/tarball/ tar xzvf Django-1.1.1.tar.gz cd Django-1.1.1 sudo python setup.py install -- You received this message because you are subscribed to the Google Groups "Django users"

get_next_by title?

2010-04-16 Thread ChrisR
I know of the get_next_by_FOO for getting the next object by date, but I need a way to get the next object by a title or name on a object_detail page. I've been searching around and can't find anything to help. Any thoughts or suggestions? -- You received this message because you are subscribed

Re: problems with FormWizard

2010-04-16 Thread Massimiliano della Rovere
It seems like a threading problem. In fact if I comment out the two following lines in the apache VirtualHost file WSGIDaemonProcess dashboard.habble.it processes=5 threads=1 display-name=%{GROUP} WSGIProcessGroup dashboard.habble.it I receive no longer the error, but somehow the information about

Re: modelmultiplechoicefield show as null on the template -2

2010-04-16 Thread Tom Evans
On Fri, Apr 16, 2010 at 6:52 PM, Daxal wrote: > Hi, > > None of my other views have RequestContext in them and they are > passing in the same variables. I am one of those programmers that come > in succession trying to figure out what the previous one was trying to > do. and this guy didn't even p

Re: populating manytomany fields on template

2010-04-16 Thread Tom Evans
On Fri, Apr 16, 2010 at 6:46 PM, Daxal wrote: > Thank you for your reply. Helped a lot. > > When issuing the code, I get a error. > > ... Yeah, I was in a rush. Your model should really have a CamelCase name to avoid these sorts of problems.. The basic pattern for using a model form is like this

Re: weird import errors in my middleware

2010-04-16 Thread anentropic
if it helps, my exclusive_boolean_fields function looks like: def exclusive_boolean_fields(model, eb_fields=[], with_fields=[]): setattr(model, '_exclusive_boolean_fields', eb_fields) setattr(model, '_exclusive_boolean_with_fields', with_fields) post_save.connect(exclusive_boolean_hand

weird import errors in my middleware

2010-04-16 Thread anentropic
Hi, I tried to write my first middleware today and seem to have failed horribly. Basically I have made a view decorator almost identical to the csrf ones, that sets a flag on the view function. My middleware then checks this flag and if missing it runs another function (which deletes some session

Re: code repetition in views

2010-04-16 Thread Carl Zmola
On 04/12/2010 12:03 PM, zweb wrote: To Summarize, two options are, 1) Template method pattern which Thierry suggested http://en.wikipedia.org/wiki/Template_method_pattern 2) Django Decorators (there is a third way with middleware) 1) Writing a custom decorator is the easiest way to get

Re: modelmultiplechoicefield show as null on the template -2

2010-04-16 Thread Daxal
Hi, None of my other views have RequestContext in them and they are passing in the same variables. I am one of those programmers that come in succession trying to figure out what the previous one was trying to do. and this guy didn't even put any comments on it. so it takes me a longg time to try

Re: populating manytomany fields on template

2010-04-16 Thread Daxal
Thank you for your reply. Helped a lot. When issuing the code, I get a error. *error* UnboundLocalError at /cm/1/cv/ local variable 'cvdb' referenced before assignment Request Method: GET Request URL:http://lab.cpcstrans.com/cm/1/cv/ Exception Type: UnboundLocalError Except

Re: can't display my the data in my form

2010-04-16 Thread backdoc
> > File "c:\django\gossip2go\applications\models.py" in save > 138. return Snippet.objects.create(title > =self.cleaned_data['title'], > This is the problem. > > Exception Type: NameError at /add_gossip/ > Exception Value: global name 'Snippet' is not defined > This error is telling y

Non-conventional use of django templates.

2010-04-16 Thread Paweł Roman
I'm writing an application which is kind of event handling app, and the important functionality is sending emails. User can create his own email template, and when an event occurs the email is built using this template and sent. An event is nothing but a python dictionary with some values. As you m

Re: how to install django in ubuntu .........

2010-04-16 Thread Vicente Ruiz
It's very simple: $ sudo apt-get install python-django or you can to use Synaptic. Go to System -> Administration -> Synaptic. Look for python-django packet and mark it to install Vicente Ruiz On 15 abr, 15:31, Shawn Milochik wrote: > On Apr 15, 2010, at 9:30 AM, Jagdeep Singh Malhi wrote: > >

Re: How to ordered comments by date ???

2010-04-16 Thread Ariel
Thank you very much for yours answers. On Fri, Apr 16, 2010 at 12:24 PM, Owen Nelson wrote: > The comments are already ordered... by pk I assume, which would mean > they are also ordered by date (unless you're messing with the comment > id's or the dates themselves). > If you simply want to swit

Fun django plugins?

2010-04-16 Thread Alex F
Hi, I just started using Django, and I was wondering if anyone can recommend a good listing of cool django plugins. I've used Ruby on Rails in the past and liked the functionality of add-ons ActiveScaffold and tabnav, so if anyone knows of some django- equivalents, that'd be helpful too. Thanks!

Re: problems with FormWizard

2010-04-16 Thread Massimiliano della Rovere
I am resendin this email with dots instead of tabs in python code to overcome the automatic formatting of gmail sorry for the diuplication ;) My form wizard is initially composed of 2 forms. In form1 the users selects an event he wishes to attend to, enters his name and surname etc and how many

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Carlo Trimarchi
On 16 April 2010 16:05, Owen Nelson wrote: > Opps! Since it's an alias, you need to tell apache what server location > to map. > For example, if you want http://localhost/ to map to your application: > WSGIScriptAlias / /path/to/my/wsgi/my.wsgi > Or if you wanted http://localhost/myapp to map inst

Re: How to ordered comments by date ???

2010-04-16 Thread Owen Nelson
The comments are already ordered... by pk I assume, which would mean they are also ordered by date (unless you're messing with the comment id's or the dates themselves). If you simply want to switch the order from ascending to descending, maybe try the "reversed" parameter for the "for" tag: http:/

problems with FormWizard

2010-04-16 Thread Massimiliano della Rovere
My form wizard is initially composed of 2 forms. In form1 the users selects an event he wishes to attend to, enters his name and surname etc and how many guests he will bring form2 tells how to pay, but it is a template / dummy form, necessary because I do not want the form wizard to end after ju

Re: How to ordered comments by date ???

2010-04-16 Thread Nick Serra
Those *links! Hah. On Apr 16, 12:08 pm, Nick Serra wrote: > You would order them on the model level or on the view level. In the > model, you can set ordering with the Meta class 'ordering' parameter. > In the view, you would just add .order_by() to your query. Check out > these thinks: > > http:

Re: How to ordered comments by date ???

2010-04-16 Thread Nick Serra
You would order them on the model level or on the view level. In the model, you can set ordering with the Meta class 'ordering' parameter. In the view, you would just add .order_by() to your query. Check out these thinks: http://docs.djangoproject.com/en/dev/ref/models/options/#ordering http://do

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Owen Nelson
Opps! Since it's an alias, you need to tell apache what server location to map. For example, if you want http://localhost/ to map to your application: WSGIScriptAlias / /path/to/my/wsgi/my.wsgi Or if you wanted http://localhost/myapp to map instead WSGIScriptAlias /myapp /path/to/my/wsgi/my.wsgi -

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Owen Nelson
The WSGIScriptAlias directive should point directly to the wsgi script -- in your case the line should read: WSGIScriptAlias /home/carlo /home/carlo/mysite/django.wsgi -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Carlo Trimarchi
On 16 April 2010 14:55, Karen Tracey wrote: > mod_python development is moribund, mod_wsgi has an active helpful > maintainer. It's reasonably straightforward to configure mod_wsgi to get > control only for a certain portion of the URL space, getting that config > correct for mod_python/Django is

Re: modelmultiplechoicefield show as null on the template -2

2010-04-16 Thread Tom Evans
On Fri, Apr 16, 2010 at 4:16 PM, Daxal wrote: > Hi, > > I changed it to this. and i am pretty sure this is correct > def cvdetails(request, id): >  if request.method == 'POST': >    f = cvForm(request.POST) >    if form.is_valid(): >      return HttpResponseRedirect('cm/cvdetails.html') >  else: >

Re: populating manytomany fields on template

2010-04-16 Thread Tom Evans
On Fri, Apr 16, 2010 at 4:01 PM, Daxal wrote: > hi anyone know how to populate the manytomany fields in models on the > template? > > *models* > from django.db import models > from django.forms import ModelForm > > class cvdb(models.Model): >  user = models.ForeignKey(User) >  Language = models.Ma

Re: modelmultiplechoicefield show as null on the template -2

2010-04-16 Thread Daxal
Hi, I changed it to this. and i am pretty sure this is correct def cvdetails(request, id): if request.method == 'POST': f = cvForm(request.POST) if form.is_valid(): return HttpResponseRedirect('cm/cvdetails.html') else: f = cvForm() return render_to_response('cm/cvdetails.h

Re: modelmultiplechoicefield show as null on the template -2

2010-04-16 Thread Daniel Roseman
On Apr 16, 3:22 pm, Daxal wrote: > Hey guys, > > I am trying to render a modelmultiplechoicefield on my template and i > cannot seem to figure out how. any help would be appreciated. > > Thanks. > > Here is model: > class cvdb(models.Model): >   user = models.ForeignKey(User) >   Language = models

Re: Problem using django-typogrify and smartypants

2010-04-16 Thread bax...@gretschpages.com
Try swapping the order of smartypants and widont. Also, what exactly is standfirst? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email t

populating manytomany fields on template

2010-04-16 Thread Daxal
hi anyone know how to populate the manytomany fields in models on the template? *models* from django.db import models from django.forms import ModelForm class cvdb(models.Model): user = models.ForeignKey(User) Language = models.ManyToManyField(Language, db_table='cm_cvdb_language',

Re: can't display my the data in my form

2010-04-16 Thread Daniel Roseman
On Apr 16, 3:24 pm, JoJo wrote: > Snippet must be a class, see i'm not sure because i am following an > example from a book online and some of the pages aren't displayed, so > i don't no what is in snippet. You need to learn some Python. You can't use any names that have not either been defined o

How to ordered comments by date ???

2010-04-16 Thread Ariel
Hi everybody: I have a little question that is simple but I haven't found it in the documentation. How could I order the comments by date ??? This is when I show them in the template: {% load comments %} {% get_comment_list for object as comment_list %} {% for comment in comment_list %} {{ comme

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Karen Tracey
On Fri, Apr 16, 2010 at 10:46 AM, Carlo Trimarchi wrote: > On 16 April 2010 14:42, Karen Tracey wrote: > > Why are you trying to use mod_python here instead of mod_wsgi? mod_wsgi > is a > > lot easier to configure properly for this type of setup. > > Not sure. I thought it was the preferred way,

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Tom Evans
On Fri, Apr 16, 2010 at 3:46 PM, Carlo Trimarchi wrote: > On 16 April 2010 14:42, Karen Tracey wrote: >> Why are you trying to use mod_python here instead of mod_wsgi? mod_wsgi is a >> lot easier to configure properly for this type of setup. > > Not sure. I thought it was the preferred way, byt m

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Carlo Trimarchi
On 16 April 2010 14:42, Karen Tracey wrote: > Why are you trying to use mod_python here instead of mod_wsgi? mod_wsgi is a > lot easier to configure properly for this type of setup. Not sure. I thought it was the preferred way, byt maybe I'm wrong. Is there any advantage in using one instead of t

Re: Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Karen Tracey
Why are you trying to use mod_python here instead of mod_wsgi? mod_wsgi is a lot easier to configure properly for this type of setup. Karen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@google

Fwd: Immediate requirement, Sr Python Developer,NY

2010-04-16 Thread Dj Gilcrease
I am forwarding this to the django users list since they keep bugging me to try and find more django developers for them. The job is for Open Crowd (http://www.opencrowd.com/) in NY and I am getting $60/h. Relocation is required. -- Forwarded message -- From: Richard Aldrich Date:

Configure Django with mod_python on Ubuntu server

2010-04-16 Thread Carlo Trimarchi
Hi. I share a server with other people where we usually develop php applications. I like to program in Python and I wanted to start usind Django so today I tried to install and configure it. It seems I succeded, because if I put this in the httpd.conf file it display the "Django is working" page.

Re: can't display my the data in my form

2010-04-16 Thread JoJo
Snippet must be a class, see i'm not sure because i am following an example from a book online and some of the pages aren't displayed, so i don't no what is in snippet. how do i use a ModelForm, i only know how to use a model and form separatly? On Apr 16, 3:15 pm, Daniel Roseman wrote: > On Apr

modelmultiplechoicefield show as null on the template -2

2010-04-16 Thread Daxal
Hey guys, I am trying to render a modelmultiplechoicefield on my template and i cannot seem to figure out how. any help would be appreciated. Thanks. Here is model: class cvdb(models.Model): user = models.ForeignKey(User) Language = models.ManyToManyField(Language, db_table='cm_cvdb_language

Re: can't display my the data in my form

2010-04-16 Thread Daniel Roseman
On Apr 16, 3:08 pm, JoJo wrote: > Hi all, i am new to django, i was following an example online of how > to use forms, the one i am on at the min is a user page, where the > form accepts the submitted data, i have the html page displaying but > when i click submit i get this error > > Environment:

can't display my the data in my form

2010-04-16 Thread JoJo
Hi all, i am new to django, i was following an example online of how to use forms, the one i am on at the min is a user page, where the form accepts the submitted data, i have the html page displaying but when i click submit i get this error Environment: Request Method: POST Request URL: http://l

Multi-tenant app & Dynamic Forms

2010-04-16 Thread RogerM
Good Day, I am very new to Django and I am currently looking at using Django or Rails to replace our old php app. We have a multi client / level app. Example: Site Admin - level one which would have admin/non-admin users Partners - level two which would have admin/non-admin users Company (Which is

Re: Problem with letters like ÄÖÕÜ in django adm in

2010-04-16 Thread Bill Freeman
I like the idea of getting a full stack trace using python 2.5 I don't know what you platform is, but at least on linux (and similar systems) you can easily install multiple versions of python without causing trouble*. You grab the sources, do a make, and then, instead of doing make install, you d

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread Russell Keith-Magee
On Fri, Apr 16, 2010 at 8:40 PM, h-k-ii wrote: > You are correct. > > Based on my experience with natural keys, I would propose improvements > for the documentation [1] - but perhaps these are matters of personal > opinion: We're always open to suggestions on how to improve documentation. The bes

Re: Login problem, django does not remember user

2010-04-16 Thread chris_ingenhaag
Argh yes, of course. Thank you, thats it. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.co

Re: Login problem, django does not remember user

2010-04-16 Thread Tim Shaffer
I suspect you have a clash in names here. You have two methods named "login": 5: from django.contrib.auth import authenticate, login 9: def login(request, template_name='auth/login.html'): So when you call login(request, user) on line 21, it's calling the method you created on line 9, not the log

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread h-k-ii
You are correct. Based on my experience with natural keys, I would propose improvements for the documentation [1] - but perhaps these are matters of personal opinion: 1. mention requirement to use tuple also in serialization section (currently this is only mentioned in deserialization) 2. rename "

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread Russell Keith-Magee
On Fri, Apr 16, 2010 at 5:26 PM, h-k-ii wrote: > I find dumpdata output in XML format quite strange for natural keys. > Each character in a key reference is wrapped in a . > > Is this a bug to be reported or a feature? It certainly doesn't look right; so there is a bug somewhere. However, it mig

Login problem, django does not remember user

2010-04-16 Thread chris_ingenhaag
Hi all, i would like to user a simple captcha during login to a web application. Because of this I wrote my own login view like in the django documentation, in short: form.is_valid() authenticate(username='user', password='pass') login(request, user) For deteil here is the full code of the login

Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread h-k-ii
I find dumpdata output in XML format quite strange for natural keys. Each character in a key reference is wrapped in a . Is this a bug to be reported or a feature? * >python manage.py dumpdata --format xml --natural appname ... Doctype1 ... D o c t y

Re: django-admin.py makemessages is ignoring .txt files

2010-04-16 Thread simonecare...@gmail.com
Hey, thank you for the quick and correct reply. Simone. On 16 Apr, 12:09, Tom Evans wrote: > On Fri, Apr 16, 2010 at 10:52 AM, simonecare...@gmail.com > > > > > > wrote: > > Hi all, > > > I'm noticing a strange problem with gettext makemessages command. > > > When I launch it to generate a .p

Re: Rendering only parts of a template

2010-04-16 Thread Georg Holzmann
Okay, I found now the article by Adrian Holovaty: http://www.holovaty.com/writing/django-two-phased-rendering/ He implemented a {% raw %} template tag and everything between {% raw %} and {% endraw %} won't be rendered ... which is quite nice, so I can render part of my template on the server, and

Re: django-admin.py makemessages is ignoring .txt files

2010-04-16 Thread Tom Evans
On Fri, Apr 16, 2010 at 10:52 AM, simonecare...@gmail.com wrote: > Hi all, > > I'm noticing a strange problem with gettext makemessages command. > > When I launch it to generate a .po file, it seems it completely > ignores i18n strings that are placed in .txt files. > Cannot see any way to get it

django-admin.py makemessages is ignoring .txt files

2010-04-16 Thread simonecare...@gmail.com
Hi all, I'm noticing a strange problem with gettext makemessages command. When I launch it to generate a .po file, it seems it completely ignores i18n strings that are placed in .txt files. Cannot see any way to get it referenced in the .po file. All others strings are correctly pickled. I'm ru

Re: Django 1.2

2010-04-16 Thread Sudhakar
Thanks for your reply I love to work on Multiple Database and Sharding feature using Django 1.2 because of which I'm eagerly waiting for Django latest version release. Currently I'm using Django1.1.1 but could not get up to the mark on MultiDB and Sharding feature to make us in the current version

Re: Problem using django-typogrify and smartypants

2010-04-16 Thread HiddenWolf
All right. I'm now down to one (different) error with smartypants. Environment: Request Method: GET Request URL: http://127.0.0.1:8000/blog/ Django Version: 1.1.1 Python Version: 2.6.4 Installed Applications: ['django.contrib.auth', 'django.contrib.comments', 'django.contrib.contenttypes', 'djang

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-16 Thread Benjamin Reitzammer
Hi everyone, one thing I would take into consideration, when evaluating languages/frameworks is the community. And I cannot stop being amazed at the Python/Django people. I mean just look at this thread: Someone comes in with a (serious) question, that would usually end in flamebait and religious