When creating your widget, you need to set empty_label = None, this
will supress the '' choice.
Also, I think you want to use forms.ModelMultipleChoiceField in
conjunction with the widget forms.CheckboxSelectMultiple.
On Sep 20, 6:26 pm, "Vance Dubberly" <[EMAIL PROTECTED]> wrote:
> End resu
Assuming you're using Django v1.0 ... you could override the queryset
method in your class that defines the admin properties for your class.
For example:
class MyAdminClass(admin.ModelAdmin):
def queryset(self, request):
# Limit the queryset to some subset based on the value of
reque
Without seeing your settings.py file and urls.py, I can only guess,
but you probably don't have serving static media setup correctly. If
you're running this on the development server, you'll probably see a
404 next to /site_media/header_background.gif in the terminal window.
This means Django can'
I spoke too soon. Re-reading your comment, it does seem to be entirely
a CSS/HTML issue - not Django related. Since the inlined style works,
Django is finding the image.
Sorry about that misleading response.
On Mar 27, 9:07 am, Martin Ostrovsky
wrote:
> Without seeing your settings.py file
You're POSTing the form instance, rather than the postedData.
So:
response = self.client.post('/myApp/post', form)
should be:
response = self.client.post('/myApp/post/', postedData)
More info here:
http://docs.djangoproject.com/en/dev/topics/testing/#making-requests
On Mar 28, 9:14 pm, tsme
You're passing your template variable `classcolors` to the template
filter `random`. Looking at the code for random.py:
File "/usr/lib/python2.5/random.py", line 248, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if
seq is empty
IndexError: string index out of range
Hi,
You can define a custom save_models method in the ModelAdmin class
you're associating with your Post class (i.e. in your admin.py file
for the app in which Post resides). You can then access the user from
the request (request.user).
More info available at:
http://docs.djangoproject.com/en/d
You can limit your search by year, month or day.
See http://docs.djangoproject.com/en/dev/ref/models/querysets/#year
On Nov 20, 1:59 pm, Simon wrote:
> Hi all,
>
> I am sure this must be a real noob question as it's so easy to do in
> SQL.
> I am trying to replicate something like the following
Hi,
(Apologies in advance for the spam)
Our company, repustate.com, just launched our new natural language
processing API. It's totally open & free and is powered by Django. To
kick off our launch, we're having a contest to see who can create the
best mashup using our API and any others on the we
What about checking the raw POST for existence of data? So in your
form, checking self.data.has_key('some_key')
On Nov 8, 9:15 am, "Yo'av Moshe" wrote:
> Hey,
>
> I tried this method with no success.
>
> Adding .clean to my Article's ModelForm and checking it's
> self.instance.tags.all(), gives m
Perhaps somebody could explain exactly what's going on.
I have a form whose labels are translatable strings:
class MyForm(forms.Form):
field1 = forms.CharField(label=_('Label 1'), max_length=20)
I generated the .po files, supplied the translations, generated
the .mo files, added the proper m
I'm trying to run syncdb on a clean database (no other tables etc.) in
postgres. It produces the standard Postgres error:
psycopg2.ProgrammingError: current transaction is aborted, commands
ignored until end of transaction block
Digging a bit deeper, I see the exception is thrown in get_table_li
Hello Django Developers,
We're looking for Django developers to work on various web
applications. You can be located anywhere in the world, but your
English has to be very strong. You should be familiar with the
following:
- source control (svn)
- unit testing with Django
- AJAX
- and of course,
Hello,
Is there an existing method or means in Django to have any exceptions
that are caught emailed automatically? Or does this require a bit of
custom code?
Thanks,
Martin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Hi,
I have a ManyToMany relationship between 2 classes as below:
class Places(meta.Model):
class People(meta.Model):
places = ManyToManyField(Places)
>From command line, everything is OK. But within a view, an instance of
the People class will not have a method get_places_list(). I
Found the problem. Was importing the wrong models class. Was using the
direct path to my models rather than django.models.app_name.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
An out-of-leftfield question, has anybody tried and (successfully) used
Rico (openrico.org) with Django? Or any XML over HTTP for that matter
with Django? Just looking for some code examples.
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are
Hi,
Does the HttpResponse object set its own content-length header ? (e.g.
the size of the template after it has been loaded). If not, how come?
- Martin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django use
I guess the easiest thing to do is just look at the code myself.
For those interested, no it is not set. Other than Content-type, no
headers are set explicitly, which is completely fair.
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
Hey Zak,
Take a look at uploadify (www.uploadify.com). It relies on jQuery, but
it's probably the plugin you've seen around the net, it's quite
popular and easy to setup / modify.
On Nov 10, 3:44 pm, zak wrote:
> All the cool websites have abandoned the HTML input type="file" tag,
> they are usi
I'd rip out the non-db stuff from the form.save() method and put those
in an asynchronous queue. Then you can have another process which
polls the queue and performs these other tasks after the database
save.
So for example, you would do the following:
instance = form.save()
# push your task to t
What are you using for your AMQP? I use celery with RabbitMQ. You have
to start your AMQP service first, then celery.
On Jun 4, 2:17 am, Kenneth Gonsalves wrote:
> hi,
>
> I am trying django-celery, but on running:
>
> python manage.py celeryd -l info
>
> I get this error:
>
> [2011-06-04 01:08:5
Without seeing your model or your data, it's hard to tell what's going
on.
You're overriding the queryset for those two fields. If the instance's
values for those two fields is not in that updated queryset, then your
widgets won't get a default value.
In other words, if the value of "b_name" for
When you create your form, you can specify extra attributes to each
widget of each field. For example:
myfield = forms.CharField(widget=forms.Textarea(attrs={'cols':80,
'rows':80})
So as one of the keys in your attrs argument, you can make it 'class'
and then provide the class name as the value.
What's the value of form.cleaned_data['image']? That IOError is
usually thrown when the contents of what you pass in to open() don't
constitute a valid image.
On Jan 10, 5:26 pm, atcive wrote:
> I have the same problem:/
> Anyone cah help?
--
You received this message because you are subscribed
25 matches
Mail list logo