Re: How to build a tree on the page?

2006-08-17 Thread xtian
ess you could store both the l/r values and parent_id - but that's less than ideal. Thanks - I hadn't seen the MPTT method before. It looks to be useful, in the right circumstances. Cheers, xtian --~--~-~--~~~---~--~~ You received this message becaus

Validation questions

2006-07-27 Thread xtian
aren't things that have been asked before - I couldn't see anything specific. A way to solve both of these, it seems, would be to have a hook where whole-object validation could happen before saving - is there anything like this in the fra

Re: Show auxiliary data in admin interface for a model

2005-08-26 Thread xtian
to include the price in the result: def __repr__(self): return '%s - £%s' % (self.code, self.price) There's probably a better to way to handle your larger problem, though - I'll leave that for the high-level Djangoistas. Cheers, xtian

Re: Class reconfiguration broken Foreign Keys?

2005-08-26 Thread xtian
I think that line should be job = metaForeignKey(Job, null=True) The _id is implied - it's part of the machinery that links your Log to your Job. Semantically, your log is linked to a job, not a jobid. On 8/26/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Seems like my ForeignKeys are

Re: Help me checking this model.. (tb included)

2005-08-23 Thread xtian
on system that SqlObject uses. What do you think? I might try implementing something like that, just to see how tricky it is. I'm also pretty sure that we've strayed away from the original problem, so I might have a play with this and then start a new thread. Thanks Brant - it's been interesting, and prompted me to have a bit of a look at Django's internals. Cheers, xtian

Re: Help me checking this model.. (tb included)

2005-08-22 Thread xtian
def dept_name(self): return self.get_department().name dept_name.short_description = 'department' This is a bit awkward - it works alright in the database and through the API, but the admin doesn't handle it properly. It would be better if Django could take the SqlObject approach and allow for late-linking between related entity classes, I think. xtian

Re: Help me checking this model.. (tb included)

2005-08-22 Thread xtian
in SqlObject the class's name can be used instead of a reference to the class, providing late binding to enable this kind of model. xtian

Re: links in admin not working

2005-08-17 Thread xtian
D'oh! I just finished sending a message about the same thing. On 8/17/05, David S. <[EMAIL PROTECTED]> wrote: > > Some images are not showing up in admin. For example: > "/media/img/admin/icon_searchbox.png" is not found. In fact, it is sent - it's truncated. > > The images linked to in the

broken images in development server?

2005-08-17 Thread xtian
nd anything about it. Has anyone else seen it? I guess lots of people are using linux/apache/both. Any hints as to what I could look at? Thanks, xtian

Re: expressions in templates?

2005-08-10 Thread xtian
On 8/9/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > ... > Of course, as you point out, you could write your own view, rather > than using a generic view, if you need more fine-grained control. Both > solutions are pretty easy and don't require much code. :) > Fair enough - thanks! xtian

expressions in templates?

2005-08-09 Thread xtian
play? (Something that occurs to me is to use __getattr__ on the Poll class to have 'virtual' methods that could sort by arbitrary attributes - I guess this would work, but it's a bit magical, and potentially error-prone.) Thanks, xtian

Re: Lookup API for models: how it works?

2005-08-05 Thread xtian
es) in order to decide what the SQL expression should be, and use the values to determine what to substitute in. It's pretty clever, especially because it can traverse joins to refer to attributes of related objects. HTH xtian On 8/5/05, Maniac <[EMAIL PROTECTED]> wrote: > > Hello! &g

Re: Foreign keys in Django models without id fields?

2005-08-03 Thread xtian
7;ve worked on systems where the volume of data something like this would affect would require taking the production system offline, and need DBA management of storage space. If synthetic keys are used, this situation can be handled easily. Cheers, xtian