In my admin I am trying to create a new object, A. A has a FK to B,
which has a FK to Category, as shown: A -> B-> Category. The problem
is that when I create a new A object in my admin, it only shows a drop
down for B, and there you can have multiple B titles, but just not for
the same
On 3/31/06, sam <[EMAIL PROTECTED]> wrote:
I would like to get help on how to use Django DB API to accomplish theequivalent of the following SQL statement:select a from X, Y where X.f = Y.id and Y.c=123;X has field a, f and Y has field id, c.
f is foreign key of Y and Y's primary key is id.Its a
I would like to get help on how to use Django DB API to accomplish the
equivalent of the following SQL statement:
select a from X, Y where X.f = Y.id and Y.c=123;
X has field a, f and Y has field id, c.
f is foreign key of Y and Y's primary key is id.
Thanks in advance.
You're dancing all around it. I'm pretty sure its:
poll__id__exact=1 (two underscores both times)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On Thu, Mar 30, 2006 at 03:07:01PM -0500, Max Battcher wrote:
> I hate to say it, but Routes and most of the other schemes presented
> _do_ feel over-engineered. The current URL patterns system is fast
> and clean. The get_absolute_url() pattern is simple one, and yes it
> might break the
Hello,
I used edit_inline with a OneToOneField and it worked.
I am trying to extend the user model, but with multiple OneToOneField
models. For example, I might have an Employee model that has a
OneToOneField to User, and a Customer model with a OneToOneField to
User.
Now, if I add
> I hate to say it, but Routes and most of the other schemes presented
> _do_ feel over-engineered. The current URL patterns system is fast
> and clean.
I actually agree 100%. And my earlier post indeed smacks of
overengineering. And in my current smallish project I don't intend to
do any of
thanks a lot Jacob, I WAS missing the obvious.
--~--~-~--~~~---~--~~
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@googlegroups.com
To unsubscribe from this
On Mar 30, 2006, at 3:45 PM, [EMAIL PROTECTED] wrote:
> This is probably a really trivial question.
> How do I set my Django app's current working directory when running
> under mod_python?
The "correct" answer is that you shouldn't be relying on the working
directory in a web app; use
On Mar 30, 2006, at 2:50 PM, arthur debert wrote:
> sorry if this is too basic. ;-( , am I missing the obvious?
> wouldn't a get_content_type() static method make sense for all model
> classes?
You want ContentType.objects.get_for_model(MyModel)
Jacob
Hi.
This is probably a really trivial question.
How do I set my Django app's current working directory when running
under mod_python?
I have a view which loads local files and includes their content in a
directory. When running under the development server, this works fine.
Running under
I had a frustrated user today whose seemingly valid input into an
IntegerField was getting rejected at the validation step (using my
model's default manipulator). We eventually discovered a stray space at
the end of his input.
Is there a reason that formfield values destined for numeric Django
Hi. I am trying to get a model's content type in magic-removal.
I have a model's instance when I try :
ContentTypeManager().get_for_model(instance)
I get :
AttributeError: 'NoneType' object has no attribute 'DoesNotExist'
I got it working with:
def get_content_type(model):
opts =
Hello,
i would like to make some validation for whole form, not just only for
one field in admin.
Is it possible? st like def _manipulator_validate_form...
thanks
JJ
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
On 3/30/06, ToddG <[EMAIL PROTECTED]> wrote:
>
> I'm not sure if this was earlier missed or ignored by people [nobody
> explictly ruled it out], I can't help but think Django's URL handling
> will either drift towards re-implementing Routes:
> http://routes.groovie.org/ or staying as it is.
I found a tiny difference in the http.conf files (AllowOveride was set
to "FileInfo" instead of "None".) I made that change, even though I
seriously doubted that it would make a difference. Then I bounced
apache and amazingly enough the new urls.py showed up.
I set the AllowOverride setting back
I'm not sure if this was earlier missed or ignored by people [nobody
explictly ruled it out], I can't help but think Django's URL handling
will either drift towards re-implementing Routes:
http://routes.groovie.org/ or staying as it is. (note the lastest
version has a nice feature where you can
Rock wrote:
> Yes I did. No help.
>
> Then I forced the creation of a new urls.pyc by importing urls.py in
> "python manage.py shell" and importing urls.py and explicitly checking
> that the correct number of urlpatterns were defined. Still no joy in
> the browser though.
>
> Note that the
On Mar 30, 2006, at 9:35 AM, Rock wrote:
> Then I forced the creation of a new urls.pyc by importing urls.py in
> "python manage.py shell" and importing urls.py and explicitly checking
> that the correct number of urlpatterns were defined. Still no joy in
> the browser though.
>
> Note that the
Yes I did. No help.
Then I forced the creation of a new urls.pyc by importing urls.py in
"python manage.py shell" and importing urls.py and explicitly checking
that the correct number of urlpatterns were defined. Still no joy in
the browser though.
Note that the access_log shows my request but
Forgot: In the trunk the problem also exists.
2006/3/30, Daniel Bimschas <[EMAIL PROTECTED]>:
> If have a model like this:
>
> class Article(meta.Model):
> cite_key = meta.CharField(maxlength=255, primary_key=True)
> ...
>
> where "cite_key" is a unique string used in a
If have a model like this:
class Article(meta.Model):
cite_key = meta.CharField(maxlength=255, primary_key=True)
...
where "cite_key" is a unique string used in a bibtex-file. The problem
now are the links to the edit pages created by the admin interface.
The html-code is
I'm going to type out loud for a little bit. I'm hoping to better
define the problem so we can think about solutions more clearly (or go
find ones as solved by other frameworks).
Django has the concept of an application, a reusable chunk of
functionality which can be reused in many different
I have a development site where I can update myproject.urls.py and the
changes are acted upon immediately by my server. I just cloned this
site onto another computer and everything seems to be in order except
that on this new system, changes to urls.py are entirely ignored.
Nothing I do seems to
On 3/30/06, Daniel Bimschas <[EMAIL PROTECTED]> wrote:
>
> Hi there!
>
> I'm currently trying to convert an old webapp written in PHP into a
> django-based app. The PHP-System used VARCHAR-Fields as primary keys
> in the MySQL - DB.
>
> Now, if i convert the data for the new tables created by
Jacob Kaplan-Moss schrieb:
> Yeah, Python's logging module should do everything you need.
If not, re-read the docs ;-)
Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
On Mar 29, 2006, at 8:03 PM, Brian Elliott wrote:
> Is there a recommended way to do logging in a production
> environment? Should I just use Python's logging module or is there a
> built-in way to do this? (I am using the M-R branch.)
Yeah, Python's logging module should do everything you
Hi there!
I'm currently trying to convert an old webapp written in PHP into a
django-based app. The PHP-System used VARCHAR-Fields as primary keys
in the MySQL - DB.
Now, if i convert the data for the new tables created by Django, I
have the problem that the admin interface can't edit any
Thanks a lot! I would have tried to do something with tuples, but this seems to make easy sense.ToddOn Mar 30, 2006, at 6:06 AM, Ned Batchelder wrote: Sorry, sent the email before the formatting was right: class K:
def __init__(self, label=None, **kwargs):
assert(len(kwargs) == 1)
And there's a bug! The body of choices() should be:
def choices(self):
return [(k.v, k.label) for k in self.klist]
Ned Batchelder wrote:
Sorry, sent the email before the formatting was right:
class K:
def __init__(self, label=None, **kwargs):
Sorry, sent the email before the formatting was right:
class K:
def __init__(self, label=None, **kwargs):
assert(len(kwargs) == 1)
for k, v in kwargs.items():
self.id = k
self.v = v
self.label = label or self.id
class Constants:
def
On 3/30/06, yml <[EMAIL PROTECTED]> wrote:
>
> This is an amazing tip. I didn't know that I could print messages in
> the runserver console.
> I was missing that a lot. this is eaxcltly were the problem is for some
> unknown reason the information is correct in new_data but when I am
> retrieving
This is an amazing tip. I didn't know that I could print messages in
the runserver console.
I was missing that a lot. this is eaxcltly were the problem is for some
unknown reason the information is correct in new_data but when I am
retrieving new_data['localisation'] I got only the last piece of
On 3/30/06, yml <[EMAIL PROTECTED]> wrote:
>
> Your suggestion give the same result:
> temp.set_localisation(map(int,new_data['localisation']))
>
> Only the last selected localisation is saved.
>
>
I think you can print new_data['localisation'] to see if it's what you want.
--
I like python!
My
Your suggestion give the same result:
temp.set_localisation(map(int,new_data['localisation']))
Only the last selected localisation is saved.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
I have added an additional temp.save.
First I create the Profile with the mandatory attributes then I add the
optional ones if they exist.
This seems to work, I mean I do not get an error message when clicking
on submit.
My problem is now that even if I multi select localisation I only save
the
36 matches
Mail list logo