I have a .97 app that I'm trying to migrate to 1.1.
The current hangup is that forms that were generated by
generic.create_update were using oldforms under the covers and
automatically put the class="vDateField" in place that let the
javascript do it's magic and make the calendar selection widget
Well, somewhere between upgrading to trunk, using smart_unicode and
playing around with mysqldb connection settings I'm now getting my
data converted. Thanks for your help.
On Jul 11, 12:13 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Wed, 2007-07-11 at 05:56 +
Well, I upgraded to the trunk version of django and now my error looks
like this:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 6:
unexpected code byte
Not sure if this is much of an improvement.
On Jul 10, 2:03 am, Horst Gutmann <[EMAIL PROTECTED]>
Every time I think I understand string encoding I get reminded that I
don't.
I have a simple form where I can cut and paste in a value with an
"interesting" character in it (e.g. "Foo(r)" - in case that doesn't come
thru that's "F" "o" "o" followed by a registered trademark symbol).
It gets store
Well, either I'm not able to follow your example or we are talking
about different things. In any case here is what I got working as a
first draft. As a big benefit to me is the fact that I now understand
these inner workings a little better. I was hoping to get away with
simple wrappers to gen
tly with newforms to achieve
something like this?
On Jan 29, 6:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> See patch on ticket <http://code.djangoproject.com/ticket/2445>.
>
> On Jan 29, 8:31 am, "qhfgva" <[EMAIL PROTECTED]> wrote:
>
If my original post was not entirely clear, I'm interested in any
method available to limit_choices_to that lets you dynamically create
the list of available options as a function of the current model
instance.
thanks.
On Jan 28, 4:28 pm, "qhfgva" <[EMAIL PROTECTED]>
I currently have a drop down for a model where I'd only like to show
choices that are currently "active". That's easy enough with:
foo = models.ForeignKey(Foo,
limit_choices_to={'active__exact':True})
But if someone is working with a model where the "foo" that they had
previousl
I think you have a small error in your example. Should be:
class Thing(models.Model):
#element = models.ForeignKey(Thing)
element = models.ForeignKey(Element)
name = models.CharField(maxlength=100)
Also I figured out my problem (I think). I was passing ForeignKey
editable=False, appa
Thanks for the link. Using a wrapper is one of the things I had tried.
Here is what I tried. I *think* I'm close, but I don't see the last
little bit that I'm missing:
models.py
class Foo(models.Model):
charfoo = models.CharField(maxlength=10)
class Goo(models.Model):
chargoo = mod
So far I've been using generic views for everything so I'm not sure if
I've reached the end of what those can do, or just need some better
understanding of how to use them.
I have a Foo model and a Goo model which among other attributes has a
non-editable ForeignKey reference back to Foo. I'm h
In order to fit more columns of data on the screen in the admin, I
tried the following:
# for use in list_display
def combined_cols(self):
return '%s%s%s' % (self.col1, self.col2,sel.col3)
Which displayed the '' in the output.
Is there some way to prevent the output from being html escaped
ith HTTP;
Sun, 21 May 2006 22:28:35 + (UTC)
From: "qhfgva" <[EMAIL PROTECTED]>
To: "Django users"
Subject: does django go to 11?
Date: Sun, 21 May 2006 22:28:35 -
Message-ID: <[EMAIL PROTECTED]>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U;
May 2006 05:43:43 + (UTC)
From: "qhfgva" <[EMAIL PROTECTED]>
To: "Django users"
Subject: Re: null=True conditionally
Date: Sun, 21 May 2006 05:43:43 -
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<
Thanks for your response, I'm not having luck with this. It seems like
the admin interface is requiring ForeignKey fields even when marked as
null=True.
My validator that I wrote seems to be working, but since the fk field
is being required it defeats the purpose.
Here is my model. Is there an
Perhaps more generally, how can I constrain baz to a certain subset of
values as a function of bar?
bar = ('qwe','wer','ert','rty')
baz = ('w1','w2','t1','t2')
E.g if bar's value has a 'w' in it then baz must be w1 or w2.
Otherwise it must be t2 or t2.
--~--~-~--~~~
Class Foo(Model):
blah = CharField(maxlength=20)
bar = ForeignKey(Qwerty) # requred field
baz = CharField(maxlength=20, null=False)
In the above class I'd like to make baz a required field if bar is of a
certain value otherwise it can be blank. If there a way to accomplish
this?
Th
Thanks for the tip. Your example didn't quite work for me. I changed
it to:
'groups__name__exact'
Possibly it's because we are using different versions? I'm using the
most recent trunk (magic-removal-branch).
One question if you don't mind answering. I'm guessing that there is
juju going on
I have a table like
Contracts
contract_number : text
faculty : foreign_key to User
As expected ALL the users show up in this drop down in the admin page.
My intention is to have faculty is be a sub set of users. My first
thought is to
create a Group called "faculty" and use the "l
19 matches
Mail list logo