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/',
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
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
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
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
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
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
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
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
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"
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
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
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
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
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
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
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
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
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
>
> 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
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
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:
>
>
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
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!
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
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
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:/
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
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:
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
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
-
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
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
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:
>
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
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
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
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
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',
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
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
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,
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
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
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
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:
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.
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
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
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:
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
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
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
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
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
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
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 "
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
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
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
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
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
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
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
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
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
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
67 matches
Mail list logo