I want to use choices in Django to save common-use choices for the
purpose of convenience.
But at the same time, I want the user to fill their own choices when
their choices are not in the select box.
It seems that it will limit choices to the choices given once using
choice in Django.
?_?
So how
On Thu, May 28, 2009 at 11:36:10PM -0500, Alex Gaynor wrote:
> Loops put some vary helpful variables in the context, so you can do
> something like:
>
> {% for pp in object.photoperson_set.all %}{{pp.person}}{% if not forloop.last %},
> {% endif %} {% endfor %}
Thanks. Looks like just what I was
On Thu, May 28, 2009 at 11:33 PM, Brian May
wrote:
>
> Hello,
>
> Simple question, can I make the following list comma seperated without
> inventing my own custom tag type?
>
> {% for pp in object.photoperson_set.all %}{{pp.person}} {% endfor %}
>
> I don't want a comma before the first item or af
Hello,
Simple question, can I make the following list comma seperated without
inventing my own custom tag type?
{% for pp in object.photoperson_set.all %}{{pp.person}} {% endfor %}
I don't want a comma before the first item or after the last item.
I have a number of these lists, for different
Finally a reason to upgrade, then.
Thanks,
Rodrigo
On May 28, 11:54 pm, Alex Gaynor wrote:
> On Thu, May 28, 2009 at 10:53 PM, Roberto Cea wrote:
>
> > I see. I take it this only works in 2.6?
>
> > Thanks,
>
> > Rodrigo
>
> > On May 28, 11:48 pm, Karen Tracey wrote:
> > > On Thu, May 28, 20
is there a way to set django so that it will show image placeholders
for missing images?
--~--~-~--~~~---~--~~
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@googlegr
On Thu, May 28, 2009 at 10:53 PM, Roberto Cea wrote:
>
> I see. I take it this only works in 2.6?
>
> Thanks,
>
> Rodrigo
>
> On May 28, 11:48 pm, Karen Tracey wrote:
> > On Thu, May 28, 2009 at 11:29 PM, Roberto Cea
> wrote:
> >
> > > I'm just coming off of a Unicode bug hunting expedition, ad
I see. I take it this only works in 2.6?
Thanks,
Rodrigo
On May 28, 11:48 pm, Karen Tracey wrote:
> On Thu, May 28, 2009 at 11:29 PM, Roberto Cea wrote:
>
> > I'm just coming off of a Unicode bug hunting expedition, adding a ton
> > of "u"s before quotation marks.
> > Is there a way to tell D
On Thu, May 28, 2009 at 11:29 PM, Roberto Cea wrote:
>
> I'm just coming off of a Unicode bug hunting expedition, adding a ton
> of "u"s before quotation marks.
> Is there a way to tell Django (or Python): "Assume all my strings are
> unicode, ok?"
If you're using Python 2.6:
Python 2.6 (r26:6
I just made a post to this thread that seems to have disappeared. Let
me quickly reiterate it now -- if it ends up doubling up, apologies.
I have a process that runs outside of the webserver to import data on
the filesystem into the database. I already had a system in place to
track individual
Hi. I have a web application that requires files on disk to be
analyzed and imported into the database continually. I spent the last
couple days parallelizing the import routine. At first, I'd
periodically lose my connection to MySQL:
Traceback (most recent call last):
File "/Users
I'm just coming off of a Unicode bug hunting expedition, adding a ton
of "u"s before quotation marks.
Is there a way to tell Django (or Python): "Assume all my strings are
unicode, ok?"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
>
> > Then try calingl the wkt methond on the Envelope object to get a proper
> > string repr of the polygon.
> >
>
What is even more amazing is how many typos are in that sentence. I should
make my default font bigger so I notice them better.
Glad it works,
Ariel.
--~--~-~--~~-
2009/5/29 Graham Dumpleton :
>
>
>
> On May 28, 10:16 pm, luper rouch wrote:
>> By default, dates are formated in English (things like .strftime("%A")
>> return days names in English).
>>
>> I tried to put locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') in the
>> settings file and it works well o
On May 28, 10:16 pm, luper rouch wrote:
> By default, dates are formated in English (things like .strftime("%A")
> return days names in English).
>
> I tried to put locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') in the
> settings file and it works well on the development server. The problem
>
> File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
> postgresql_psycopg2/base.py", line 84, in _cursor
> self.connection = Database.connect(conn_string, **self.options)
> psycopg2.OperationalError: FATAL: Ident authentication failed for
> user "djangouser"
Sounds like your
On May 28, 11:56 pm, Damien MATHIEU <4...@dmathieu.com> wrote:
> Hi,
>
> Using the internal web server, I correctly load every language string
> located in application_path/locale/language/LC_MESSAGES/django.mo
> But whenever I use Apache, they don't appear to be loaded anymore.
>
> However it a
OMG wow that worked. Thanks a ton.
On May 28, 6:44 pm, Ariel Nunez wrote:
> > >>> from django.contrib.gis.gdal.envelope import Envelope
>
> >>> W = 39.9; N = -82.9; E=40.4; S=-82.2
>
> >>> bounds = Envelope((N, W, S, E, ))
>
> > >>> Base.objects.filter(location__intersects=bounds.wkt)
>
> Then
I have a model with an IPAddressField (1) and some views that have to
write to that field every time they save (2) ... Wouldn't it be nice
if I could just specify auto_now=True or auto_now_add=True in the
model and let Django take care of that for me, the same as I can for
date fields?
I've only
Dear all,
Is it possible to select the template to be applied to an admin form
based on the logged user?
In particular, I've two cases:
- if super user, a certain template should be used
- if not a super user, but the owner of the data, then another
template should be used
- if not a super user,
>
> >>> from django.contrib.gis.gdal.envelope import Envelope
>
>>> W = 39.9; N = -82.9; E=40.4; S=-82.2
>
>>> bounds = Envelope((N, W, S, E, ))
> >>> Base.objects.filter(location__intersects=bounds.wkt)
>
Then try calingl the wkt methond on the Envelope object to get a proper
string repr of the
I'm new in django and just installed django 1.0.2. Everything works
fine until i use the following command in the terminal
r...@tafin-desktop:/home/tafin/mysite# python manage.py syncdb
The following error occurred
Traceback (most recent call last):
File "manage.py", line 11, in
execute_
Hello,
I would like to create a list filter in my site just like the one in
the admin app. If I am correct I can do by adding a paramter to my
url.
In my view I can capture the parameter with request.GET.get
('category', '') and filter my object_list. Everything works just fine
but it doesn't fe
Consider the following: I have two Person records (Person A and
Person B). A Person can have many Books. As such, Person A has one
Book and Person B has 4 Books (Book has a foreign key relationship to
Person). For the sake of clarity, here are my models:
class Person(models.Model):
name = m
On May 28, 5:52 pm, Ariel Nunez wrote:
> On Thu, May 28, 2009 at 4:12 PM, nbv4 wrote:
>
> > I have this model:
> >
> > from django.contrib.gis.db import models
>
> > class Base(models.Model):
> > identifier = models.CharField(max_length=8,
> > primary_k
On Thu, May 28, 2009 at 4:12 PM, nbv4 wrote:
>
> I have this model:
>
> from django.contrib.gis.db import models
>
> class Base(models.Model):
>identifier = models.CharField(max_length=8,
> primary_key=True)
>local = models.CharF
On Thu, May 28, 2009 14:31, Eric Abrahamsen wrote:
>
> The default comment form does not include a next parameter, so if you
> don't override the builtin comment templates you won't get any next
> parameters in the forms. The most sure way of doing this is using a
> custom comment form with a ne
I have this model:
from django.contrib.gis.db import models
class Base(models.Model):
identifier = models.CharField(max_length=8,
primary_key=True)
local = models.CharField(max_length=8)
iata= models.Cha
Hi,
I'm building an app where each subscriber would have their own sub
domain name, and database, but would like to run a single Django
instance for all of them. I've seen a lot of info that points that
this is not supported by Django right now, or that it is not easy to
do it at least. I don't w
I did supply a file, just NOT a PDF format file which causes
ValidationError to be raised (yea, probably want to make sure that
wasn't the problem :-{}) When I don't supply a filename, I do get the
correct error message back in form.errors.
But you could be correct about the FileField's clean me
my guess is that the validation fails before reaching the
clean_PDF_File method, that is it fails at the FileField's clean
method. Perhaps, you haven't supplied a file. :)
On May 28, 3:02 pm, Adam Stein wrote:
> Running Django v1.0.2.
>
> I have a form with a file field. The file needs to be in
You can do validation inside the template to check the data
and raise errors accordingly. You can also check the data
so you should be able to check if instance.property.id is
a valid value and then only use it, if it is. It all comes down
to how you would like your template tag to function. In so
Masklinn kirjoitti:
> On 28 May 2009, at 15:30 , Alex Gaynor wrote:
>> On Thu, May 28, 2009 at 8:11 AM, Masklinn
>> wrote:
>>
>>> On 28 mai 09, at 14:55, Jani Tiainen wrote:
laspal kirjoitti:
> Hi,
> I have 2 list and want to iterate as one in template.
> How can I do it.
On Thu, May 28, 2009 at 1:24 PM, sandwich wrote:
>
> I wanna control the number of a table in Mysql using Django.
> It seems that we can limit the max_row of a table in Mysql using the
> table_options when creating a table.
> Does Django have those options for us to control the setting of the
> t
Hello Django Users.
I wanted to reach out and see if you allow Django related job
posting. I did not see anything listed against it in the archives so
I wanted to share a new position for a Proof of Concept Developer at
Bazaarvoice in Austin, TX. (www.bazaarvoice.com)
This is an exciting new po
I wanna control the number of a table in Mysql using Django.
It seems that we can limit the max_row of a table in Mysql using the
table_options when creating a table.
Does Django have those options for us to control the setting of the
table?
please help me to solve the problem.
--~--~-~--
On Thu, May 28, 2009 at 12:33 PM, creecode wrote:
>
> Hello Petry,
>
> Is there something about
> http://docs.djangoproject.com/en/dev/ref/models/querysets/#search
> that isn't working for you in 1.0.x?
>
> On May 28, 7:10 am, Petry wrote:
>
> > I'm trying to implement a search on my site, find
Hello Petry,
Is there something about
http://docs.djangoproject.com/en/dev/ref/models/querysets/#search
that isn't working for you in 1.0.x?
On May 28, 7:10 am, Petry wrote:
> I'm trying to implement a search on my site, find this[1] solution
> interesting because it is not necessary to use a
On Thu, May 28, 2009 at 1:11 PM, Alex Gaynor wrote:
>
> On Thu, May 28, 2009 at 11:51 AM, enthropyinaction <
> enthropy.in.act...@gmail.com> wrote:
>
>>
>> [snip] File "/home/django/ipdb/../ipdb/nagios/models.py", line 15, in
>>
>>class APC(models.Model):
>> File "/home/django/ipdb/../ipdb/
I'm dumb, sorry if I wasted anyone's time. Found my answer in the
Model Fields Reference (http://docs.djangoproject.com/en/dev/ref/
models/fields/#django.db.models.ForeignKey):
-
If you need to create a relationship on a model that has not yet bee
On Thu, May 28, 2009 at 11:51 AM, enthropyinaction <
enthropy.in.act...@gmail.com> wrote:
>
> First, an excerpt from my models.py and the traceback:
>
> -
>
> class Loc(models.Model):
>added = models.DateTimeField(auto_now_add=True)
>
First, an excerpt from my models.py and the traceback:
-
class Loc(models.Model):
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
name = models.CharField(max_length=100)
I have created a custom tag to generate select inputs from my database
models it is registered as a simple tag.
Everything is fine, except that I should do this to avoid my problem
is that calling my tag of this way {% combo "model"
instance.property.id %} raises TemplateSyntaxError when object i
On May 28, 8:19 am, jrs_66 wrote:
> 250 queries on one page seems to me to be dangerously high. I would
> have to guess you could reduce that significantly. Turn on query
> output to see if the Django ORM isn't creating sloppy queries in
> loops. My guess is that with some code alterations you
On May 28, 7:26 am, "Daniele Procida"
wrote:
> On Thu, May 28, 2009, Masklinn wrote:
> >> I need to create some templates that will cover a number of cases:
>
> >> display navigation menu: yes or no
> >> display additional info box: yes or no
>
> >> In other words, there are a total of fo
250 queries on one page seems to me to be dangerously high. I would
have to guess you could reduce that significantly. Turn on query
output to see if the Django ORM isn't creating sloppy queries in
loops. My guess is that with some code alterations you could help
On May 28, 4:57 am, Stefan
On Thu, May 28, 2009, Masklinn wrote:
>> I need to create some templates that will cover a number of cases:
>>
>>display navigation menu: yes or no
>>display additional info box: yes or no
>>
>> In other words, there are a total of four cases that need to be
>> provided for.
>>
>> I un
Hi,
Using the internal web server, I correctly load every language string
located in application_path/locale/language/LC_MESSAGES/django.mo
But whenever I use Apache, they don't appear to be loaded anymore.
However it appear the default ones are loaded.
The languages names are appropriately tran
On May 28, 2:29 am, Michael Keselman wrote:
> Hello,
>
> I have somewhat of a strange situation:
>
> Each user has his own calendar and own set of events, and I want the
> event categories to be models like Assignment, FieldTrip, Test/Quiz,
> etc. I want it like this so that I can make the ev
Hi all
I'm trying to implement a search on my site, find this[1] solution
interesting because it is not necessary to use any external code (or
as xapian sphinx). Unfortunately this solution only works in older
versions of django. I tried to fix backend.quote_name, but failed.
Someone has used a
On Thu, May 28, 2009 at 9:03 AM, Masklinn wrote:
>
> On 28 May 2009, at 15:30 , Alex Gaynor wrote:
> > On Thu, May 28, 2009 at 8:11 AM, Masklinn
> > wrote:
> >
> >>
> >> On 28 mai 09, at 14:55, Jani Tiainen wrote:
> >>> laspal kirjoitti:
> Hi,
> I have 2 list and want to iterate as on
On 28 May 2009, at 15:53 , Daniele Procida wrote:
> I need to create some templates that will cover a number of cases:
>
>display navigation menu: yes or no
>display additional info box: yes or no
>
> In other words, there are a total of four cases that need to be
> provided for.
>
> I u
On 28 May 2009, at 15:30 , Alex Gaynor wrote:
> On Thu, May 28, 2009 at 8:11 AM, Masklinn
> wrote:
>
>>
>> On 28 mai 09, at 14:55, Jani Tiainen wrote:
>>> laspal kirjoitti:
Hi,
I have 2 list and want to iterate as one in template.
How can I do it.
example->
list1 = [10
I need to create some templates that will cover a number of cases:
display navigation menu: yes or no
display additional info box: yes or no
In other words, there are a total of four cases that need to be provided for.
I understand how to use template inheritance so that a derived templ
On May 28, 2009, at 3:17 PM, Kevin Fullerton wrote:
>
> On Thu, May 28, 2009 01:50, Eric Abrahamsen wrote:
>>
>> On May 28, 2009, at 4:02 AM, Kevin Fullerton wrote:
>>
>>>
>>> I'm working with django.contrib.comments at the moment, and so far
>>> most
>>> things are working as expected.
>
>
>
>
On Thu, May 28, 2009 at 8:11 AM, Masklinn wrote:
>
> On 28 mai 09, at 14:55, Jani Tiainen wrote:
> > laspal kirjoitti:
> >> Hi,
> >> I have 2 list and want to iterate as one in template.
> >> How can I do it.
> >> example->
> >> list1 = [10,20,30,30]
> >> list2 = [aa,bb,cc,dd]
> >
> > combinedli
On 28 mai 09, at 14:55, Jani Tiainen wrote:
> laspal kirjoitti:
>> Hi,
>> I have 2 list and want to iterate as one in template.
>> How can I do it.
>> example->
>> list1 = [10,20,30,30]
>> list2 = [aa,bb,cc,dd]
>
> combinedlist = ( (a[x],b[x]) for x in range(len(a)) )
>>
>>
Reinventing zip (or, i
Running Django v1.0.2.
I have a form with a file field. The file needs to be in PDF format, so
I have a clean routine that checks that (modified slightly to NOT wrap
lines):
def clean_PDF_File(self):
"""Verify that the content is PDF format"""
type = "application/pdf"
if se
That seems to have fixed the problem, thanks!
- Andrew
On 28 May, 13:45, Michael wrote:
> On Thu, May 28, 2009 at 8:21 AM, Andrew Ingram wrote:
>
>
>
> > Hi all,
>
> > Some of our models make use of ImageFields, but our admin app is
> > hosted on one server (which the images are also served fro
laspal kirjoitti:
> Hi,
> I have 2 list and want to iterate as one in template.
> How can I do it.
> example->
> list1 = [10,20,30,30]
> list2 = [aa,bb,cc,dd]
combinedlist = ( (a[x],b[x]) for x in range(len(a)) )
> {% for item in list1 and item1 in list2 %}
{% for item,item1 in combinedlist %}
On Thu, May 28, 2009 at 8:21 AM, Andrew Ingram wrote:
>
> Hi all,
>
> Some of our models make use of ImageFields, but our admin app is
> hosted on one server (which the images are also served from) whilst
> the main web app is served from another.
>
> The problem is that when the web app loads a m
Hi all,
Some of our models make use of ImageFields, but our admin app is
hosted on one server (which the images are also served from) whilst
the main web app is served from another.
The problem is that when the web app loads a model with an imagefield,
it automatically tries to find the file loc
By default, dates are formated in English (things like .strftime("%A")
return days names in English).
I tried to put locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') in the
settings file and it works well on the development server. The problem
is under mod_python dates are printed in the selected
On Thu, May 28, 2009 at 4:57 AM, Stefan Tunsch wrote:
>
> Hi!
>
> I have a rather strange set up, for running a django intranet site.
>
> It is currently running on a Windows XP box with Apache 2.2 with
> mod_python and MySQL.
>
> The site is rather prone with database queries. The most complex p
You will need to use dynamic forms.
On Thu, May 28, 2009 at 1:02 AM, Jochem Berndsen wrote:
>
> All,
>
> Is there an easy way to include "conditional fields" in forms within the
> Django framework. By "conditional fields", I mean fields that are shown
> or not shown depending on earlier choices
cool, is would help to have a downloadable file for non launchpad
users.
On May 27, 6:29 pm, Nagy Viktor wrote:
> Hi,
>
> I've put together a nifty export to csv application. You can check it out
> athttps://launchpad.net/django-export-csv
>
> To get the code immediately just run: bzr branch lp
Hi!
I have a rather strange set up, for running a django intranet site.
It is currently running on a Windows XP box with Apache 2.2 with
mod_python and MySQL.
The site is rather prone with database queries. The most complex page on
the site reports to be executing around 350 sql queries.
The
On May 27, 9:32 pm, Jochem Berndsen wrote:
> All,
>
> Is there an easy way to include "conditional fields" in forms within the
> Django framework. By "conditional fields", I mean fields that are shown
> or not shown depending on earlier choices the user made in the form.
> What would be the canon
I am selecting the following in a queryset
.values
('id','who__name','who__name_slug','when__from_time','when__to_time')
but the field names are a bit clunky. Is there a way of doing the
equivalent of
.values
('id','who__name','who__name_slug','when__from_time','when__t
you might have to reset your database and do a fresh syncdb if you
have just added your "unique=True" bit.
On May 27, 9:10 pm, Bobby Roberts wrote:
> On May 27, 4:08 pm, Bobby Roberts wrote:
>
> > hi group... I thought slugs were unique, or supposed to be? Here's
> > what i'm doing:
>
> > in f
Since nobody responded, i figured i should revisit the documentation.
Here are the answers to my own questions:
1. To add a variable from an external file, i simply redefined the
value page_list inside the view. That causes it to be included in the
local context and added to locals().
In the app
On Thu, May 28, 2009 01:50, Eric Abrahamsen wrote:
>
> On May 28, 2009, at 4:02 AM, Kevin Fullerton wrote:
>
>>
>> I'm working with django.contrib.comments at the moment, and so far
>> most
>> things are working as expected.
>
> It's a known problem and the patch for this is already in trunk –
72 matches
Mail list logo