Limodou,
This is what I did and the result is that it hapens in the:
manipulator.save()
So I am going to the same thing in this function in order to see which
satement is causing trouble.
--~--~-~--~~~---~--~~
You received this message because you are subscribe
Limodou,
This is what I did and the result is that it hapens in the:
manipulator.save()
So I am going to the same thing in this function in order to see which
satement is causing trouble.
--~--~-~--~~~---~--~~
You received this message because you are subscribe
On 3/28/06, Siah <[EMAIL PROTECTED]> wrote:
>
> I don't think that's it. My django site is very generic. It has to be
> some sort of configuration I am missing.
>
> Any other ideas?
>
That sounds like the caching middleware is in effect. The settings
relating to this look something like this:
M
On 3/28/06, yml <[EMAIL PROTECTED]> wrote:
>
> Hello Limodou,
>
> ok I read the soucre of the formfield in order to fix the radio_admin
> buton I replace the SelectField by a RadioSelectField the form is now
> properly displayed with radio button.
>
> I agree with you that the error message seems
When viewing one object in the admin (say, a Landlord) I'd like to be
able to display a list of related objects (say, Properties). The
edit_inline feature is overkill, because the Properties don't need to
be edited in place -- and they have too many fields to fit comfortably
inline anyway.
Basica
Hello Limodou,
ok I read the soucre of the formfield in order to fix the radio_admin
buton I replace the SelectField by a RadioSelectField the form is now
properly displayed with radio button.
I agree with you that the error message seems to direct us to a pb of
template but there the line which
Hi, and thanks - I switched my "image caption" field to be the "core"
field and this was the change that worked.
Also, any idea why the ImageField widget doesn't show the image, just
the path to the image file, and a link that goes nowhere...
--~--~-~--~~~---~--~
Adrian Holovaty wrote:
>The convention is to put the URL-creation logic in your models, in a
>get_absolute_url() method.
>
Thank you Adrian and others for this info! All this time I was honestly
thinking that hard-coded urls in templates are some kind of evil that
need to be dealt with in futur
Todd O'Bryan wrote:
>The tutorial explains how to get objects based on field values, but I
>need to get a subset of the objects in a OneToMany relationship based
>on one of their values. Here's an example:
>
>BRANCH_KINDS = ((0, 'Main'), (1, 'Auxiliary'), (2, 'Dead'),)
>
>class Trunk(meta.Mod
Todd O'Bryan wrote:
> I'm an almost complete Python newbie, and I found dictionaries, but
> is there an automatic way to deal with lists of pairs that have been
> used for choices settings in the admin view, cause they're tuples of
> tuples, right?
>
> I have
>
> KINDS = ((0, 'foo'), (1, '
I like the URLs at the model. Think in terms of URI (Uniform
Resource Identifiers). The .get_absolute_url() tells how the model can
be found. It's part of the "rules that give access" to data.
On 3/27/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
> Models are, in part, an abstraction of the data.
On Monday 27 Mar 2006 9:49 pm, shredwheat wrote:
> I was reading through the source for djangoproject.com and
> learned a lot about how Django really works. Are there any other
> sites with the source available?
try hugo-'s or iholsman's sites - many of the sites mentioned in the
wiki have sourc
On Mon, Mar 27, 2006 at 04:21:09PM -0600, Adrian Holovaty wrote:
> The convention is to put the URL-creation logic in your models, in a
> get_absolute_url() method. Here's a quick example:
> ...
> You're right to imply that this goes against the DRY principle,
> because you have to define URLs in
On 3/28/06, Doug Van Horn <[EMAIL PROTECTED]> wrote:
>
> Disclaimer: I'm new to Python and Django, but I've been coding Java
> since '98.
>
> In thinking about the url definitions in urls.py, it occurs to me that
> a major rewrite of the url patterns could prove to be a pain. For
> example, I hav
I am subclassing User in magic-removal, and ran into this gotcha. My
model:
class Account(User):
tel = models.CharField(maxlength = 14, blank=True)
book = models.ManyToManyField(Book, blank=True)
in a view I when I try this:
acc = Account.objects.get(username=test_username)
prin
The tutorial explains how to get objects based on field values, but I
need to get a subset of the objects in a OneToMany relationship based
on one of their values. Here's an example:
BRANCH_KINDS = ((0, 'Main'), (1, 'Auxiliary'), (2, 'Dead'),)
class Trunk(meta.Model):
name = meta.Cha
On 3/28/06, yml <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> As discussed above I spend mos of my evening learning about
> manipulator. I was pretty happy since it seems much more difficult than
> it is.
> This is what I thaught when I did the couple of examples I found on
> the web.
>
> So what I d
I'm an almost complete Python newbie, and I found dictionaries, but
is there an automatic way to deal with lists of pairs that have been
used for choices settings in the admin view, cause they're tuples of
tuples, right?
I have
KINDS = ((0, 'foo'), (1, 'bar'))
class Thing(meta.Model):
Quick and nasty:
from django.core import template
register = template.Library()
@register.filter(name='commas')
def commas(value):
return "".join(commafy(value))
def commafy(s):
pieces = s.split(".")
l = len(pieces[0])
for i in range(0,l):
if (l -
Perhaps for a rainy day (very future release):
http://routes.groovie.org/
--~--~-~--~~~---~--~~
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 u
I don't think that's it. My django site is very generic. It has to be
some sort of configuration I am missing.
Any other ideas?
Thanks,
Sia
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
On 3/27/06, Doug Van Horn <[EMAIL PROTECTED]> wrote:
> In thinking about the url definitions in urls.py, it occurs to me that
> a major rewrite of the url patterns could prove to be a pain. For
> example, I have an app where the urls are deployed under /foo/, and I
> have a URL defined as '^bar/\
Read about autocommit.
Siah wrote:
> I just launched my django site for a client. My problem is something
> is caching my db data in a bizzar way. Here are some of the behaviours
>
> I get:
>
> - I login, and every other page it makes me login again for a 5 minutes
>
> or so and then it remem
On Monday 27 March 2006 13:23, Doug Van Horn wrote:
> When drawing a link to that view in HTML from another app I would
> 'hard code' that URL as, say, 'href="/foo/bar/99"'.
>
> Now say I come along and change my foo application, such that the
> URL is newly defined as, '^quux/\d+/bar/$'. Everywh
Hello,
As discussed above I spend mos of my evening learning about
manipulator. I was pretty happy since it seems much more difficult than
it is.
This is what I thaught when I did the couple of examples I found on
the web.
So what I did is generate the custom manipulator using the script that
I
> Anyway, am I overthinking this whole thing?
Yes. The major pattern in Django is that your model objects should have a:
def get_absolute_url(self):
return "/bar/%s/" % (self.id)
Then when you change the URL scheme you can either update your model
objects, or in cases where there are multi
What about mod_rewrite? And urls.py (afaik) can serve two different
paths to the same view.
On 3/27/06, Doug Van Horn <[EMAIL PROTECTED]> wrote:
>
> When drawing a link to that view in HTML from another app I would 'hard
> code' that URL as, say, 'href="/foo/bar/99"'.
--
Julio Nobrega - http:
Disclaimer: I'm new to Python and Django, but I've been coding Java
since '98.
In thinking about the url definitions in urls.py, it occurs to me that
a major rewrite of the url patterns could prove to be a pain. For
example, I have an app where the urls are deployed under /foo/, and I
have a URL
On Mon, Mar 27, 2006 at 12:37:54PM -0800, wam wrote:
> Well, it was my understanding that since I have the potential of having
> many 'inspired by' documents linked to a particular document, and that
> any particular document could have inspired many other other documents,
> then that means I'm lo
Malcolm Tredinnick wrote:
> Hi William,
> I may be missing something, but it sounds like you want a one-to-many
> (a.k.a. ForeignKey) relationship here. The 'one' side is the "self"
> document in each case with links to 'many' other documents. I don't
> believe a ManyToMany relationship is necessa
I just launched my django site for a client. My problem is something
is caching my db data in a bizzar way. Here are some of the behaviours
I get:
- I login, and every other page it makes me login again for a 5 minutes
or so and then it remembers that I am logged in.
- I add a record, it refl
On 3/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> When's the book due?
> How about a chapter "migrating to Django from J2EE -- Becoming more
> productive by unlearning" or something along those lines? I'd be happy
> to proof-read it.
Hehe...Well, I've never used J2EE (or any Java at all,
shredwheat wrote:
>
> I was reading through the source for djangoproject.com and learned a
> lot about how Django really works. Are there any other sites with the
> source available?
>
If you go to the code page you'll find some links to other sites
which use Django. The biggest one available
On 3/27/06, Ned Batchelder <[EMAIL PROTECTED]> wrote:
> I'd like to add some custom annotations on the traceback emails that get
> sent when an exception occurs and DEBUG = False. For example, we are
> using our own user representation, and would like to include the user
> identity in the traceba
I was reading through the source for djangoproject.com and learned a
lot about how Django really works. Are there any other sites with the
source available?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django us
tonemcd wrote:
> I think that this http://lukeplant.me.uk/blog.php?id=1107301634 might
> be helpful.
I've just used the first bit of Luke's wheeze- storing the user.id and
stuffing it in the model's save method.
I had to put 'null-True' in the model to get the user.id bit of this to
work. Otherwi
yes, i have the correct files in the correct places.. i just can't
figure out why it doesn't work..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
Well Luke (the author) might have a better idea than me, but I'll have
a go ;)
Put it anywhere in your applications folder structure, Luke chose
cciw/middleware because his app is called 'cciw' - but it doesn't
matter because in his model file, he has the following...
..
...
import cciw.middlewa
Hello tonemcd,
Thank you for the link it look interesting.
However I am not understanding where I should add those lines:
# cciw/middleware/threadlocals.py
import threading
_thread_locals = threading.local()
def get_current_user():
try:
return _thread_locals.user
except Attribut
On 3/27/06, yml <[EMAIL PROTECTED]> wrote:
>
> Hello Limodou,
>
> Thank you this is what I start to understand. The pb is that so far I
> have never try that and it looks pretty difficult. This impression
> might be becous I have never done it.
> This is time to learn... :-)
> So I will try to im
yml schrieb:
> This look very interesting so what I will do is to install magic
> removal branch this evening and try your recipe.
But: be prepared that if you use this on existing code, you might have
to change quite a lot. See
http://code.djangoproject.com/wiki/RemovingTheMagic
--and, it is
Rock wrote:
> Is there a template filter for turning a large integer into a human
> readable number?
>
> 1234567 --> 1,234,567
> 12345 --> 12,345
>
> I don't think that python built-in formatting can do this. (Am I
> wrong?)
>
> Assuming there isn't already a simple filter that will do this,
Hello Limodou,
Thank you this is what I start to understand. The pb is that so far I
have never try that and it looks pretty difficult. This impression
might be becous I have never done it.
This is time to learn... :-)
So I will try to implement my first manipulator this evening. My
objective is
Hi,
I understand your point but for some reason in that case I need a one
to many relationship.
cu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
Hello Michael,
This look very interesting so what I will do is to install magic
removal branch this evening and try your recipe.
I have a couple of question before doing that, I want to make sure that
I have a good understanding of what I should do.
Could you confirm that "Person" in your code
I am doing it with template filters. There's a "highlight" function
that I use like this:
{{ var|highlight:keyword }}
Where "keyword" is the search term. The function adds a
around the word.
On 3/27/06, bradford <[EMAIL PROTECTED]> wrote:
>
> A question came up in #django and I was wonderi
I'd like to add some custom annotations on the traceback emails that get
sent when an exception occurs and DEBUG = False. For example, we are
using our own user representation, and would like to include the user
identity in the traceback.
I can hack into the code that generates these emails,
Gacha wrote:
> I created a simple model "articles" and I added field:
> author= meta.ForeignKey(User,editable=False)
>
> When I add new artcicle I want to assign to this field the current user
> ID, but so far no luck :(
>
> I tryed:
> def _pre_save(self):
> from django.models.auth.u
At least in magic removal, take a look at the "follow" parameter for the
automatically generated manipulators and the generic views. See my
recent posting about "customised generic views" for details. I think
this is what you really want.
Michael
--~--~-~--~~~---~-
Adrian - thanks a lot! That worked. Forest - meet trees. Trees - meet
forest. :-) I *knew* the problem was staring me in the face all along.
I was actually making a wrong assumption in what I could do with a
ManyToManyField, and so my oh-so-clever query for the newest entries in
a given blog was
yml schrieb:
> Hello,
>
> what I am trying to do since this morning is to allow my logged in user
> to create Members. As you will see below Member is related to the User
> class by a foreignkey.
> so far I create User, Member using generic view. What I would like to
> do is to remove the user fi
51 matches
Mail list logo