Re: Configuring a Django Project for Intranet Deployment

2007-11-11 Thread Stefan Matthias Aust
ou need to add the function name to the settings' TEMPLATE_CONTEXT_PROCESSORS tuple. HTH, -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Can I customize RelatedManagers?

2007-11-11 Thread Stefan Matthias Aust
user = models.ForeignKey(User, related_name='favs') class user_favs_mixin: def best(self): ... The ForeignRelatedObjectsDescriptor would the look for the innerclass and add it to the list of superclases of its dynamic RelatedManager cl

Re: Should Django have a road map?

2007-10-01 Thread Stefan Matthias Aust
on. My point is: it is the responsibility of the project which wants to get considered for usage. Your (and James) point is, I think: if it was said once, it can be found. That feels elite, IMHO. I appreciate your opinion. -- Stefan Matthias Aust --~--~-~--~~~---~--~

Re: Should Django have a road map?

2007-10-01 Thread Stefan Matthias Aust
a.html ;) > It's not a "court". Overstatement. See above. > And, again, it's easy to find these things out if you're genuinely > interested; the Trac timeline and the developers' list are both > well-advertised and publicly available. Let's agree that

Re: Should Django have a road map?

2007-10-01 Thread Stefan Matthias Aust
ccurate. > [...] You explained my points much better than I could (in plain English at least ;) Thanks. -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Should Django have a road map?

2007-10-01 Thread Stefan Matthias Aust
James, thanks for your details answer. Let me put it right here: I'm not complaining about the lack of dedication or progress in the development of Django. It's more about visibility and marketing. 2007/10/1, James Bennett <[EMAIL PROTECTED]>: > On 10/1/07, Stefan Ma

Should Django have a road map?

2007-10-01 Thread Stefan Matthias Aust
one version. That would be useful for others too, I hope, but I do not want to fork or split the development. However, I need some patches applied for our own work faster than in the official version. I'd like to know whether others feel the same and would like to see (and discuss) a focused roa

Can Django be combined with a more powerful ORM?

2007-08-20 Thread Stefan Matthias Aust
it seems that each time I ask a game for its fleets or systems, a new database query is executed and I have to cache them manually and reset the cache manually if I add new ships or systems. I'm afraid, I over-bend Django's ORM here... -- Stefan Matthias Aust --~--~-~--~---

Re: truncate string after x characters

2007-08-20 Thread Stefan Matthias Aust
alue, arg): try: return value[:int(arg)] except ValueError: return value -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Extending the model's manager methods?

2007-08-14 Thread Stefan Matthias Aust
id=id) ... except: Foo.DoesNotExist: foo = None ... or for foo in Foo.objects.filter(id=id)[:1]: ... but I wonder whether it might be useful to add a method get_or_none() and another exists() method to the objects object. What do you think? -- Stefan Matthias

Re: ifequal not working?

2007-07-28 Thread Stefan Matthias Aust
arguments. They must be variables, numbers or constants in quotes. To special case the last element of a list, do this: {% for item in items %} {% if forloop.last %} class="last" {% endif %} ... {% endfor %} -- Stefan Matthias Aust --~--~-~--~~~---~--

How to pick a template based on the request object?

2007-07-26 Thread Stefan Matthias Aust
ric solution that requires no code changes in contributed modules? -- Stefan Matthias Aust // Truth until paradox --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Using the enumerate() function in a loop?

2007-07-21 Thread Stefan Matthias Aust
Greg, 2007/7/22, Greg <[EMAIL PROTECTED]>: > Does anybody know how I can get the list position so I can put it in > the url? Search for "forloop.counter0" on http://www.djangoproject.com/documentation/templates/#for --

Re: How to implement Django-like models?

2007-07-21 Thread Stefan Matthias Aust
y @transaction.commit_manually def test(foo): foo.count += 1 transaction.rollback() class Test(unittest.TestCase): def test_transactions(self): foo = Foo(count=1) test(foo) self.assertEqual(1, foo.count) The above code will fail. The count isn't reset to 1. It doe

Re: 4 beginner's questions

2007-07-21 Thread Stefan Matthias Aust
2007/7/21, Tim Chase <[EMAIL PROTECTED]>: > I believe you're looking for the word "arbitrary". Yes. Thanks. Geeks should however take into consideration that a "random access file" isn't called an "arbitra

How to implement Django-like models?

2007-07-21 Thread Stefan Matthias Aust
d dictionaries, that is mutable sequences. At the same time, I like how Django expresses relations between objects and automatically manages them. So I tried to come up with some custom relation class - and failed so far ;( -- Stefan Matthias Aust --~--~-~--~~~---~-

Storing binary data into a table

2007-07-21 Thread Stefan Matthias Aust
cannot use that. Additional question: Is there a way to store serialized (a.k.a. pickled) Python objects? Thanks, -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Debugging file uploads

2007-07-21 Thread Stefan Matthias Aust
py" file. A simple view method will simply spawn a new editor. Because I don't really know what to return from that view, it will work best with a bit of Ajax. -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because you are su

Re: 4 beginner's questions

2007-07-21 Thread Stefan Matthias Aust
2007/7/21, Nis Jørgensen <[EMAIL PROTECTED]>: > > Stefan Matthias Aust skrev: > > > > Let's assume you have users who are allowed to assign nick names to > > theirselves and still all thoses nick names must be different. This is > > want I call a random

Re: 4 beginner's questions

2007-07-21 Thread Stefan Matthias Aust
ick names must be different. This is want I call a random ID. -- Stefan Matthias Aust --~--~-~--~~~---~--~~ 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@googlegro

Re: Blog engine

2007-07-19 Thread Stefan Matthias Aust
write their own custom blogging solution because it's so easy? I guess not :) -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: 4 beginner's questions

2007-07-19 Thread Stefan Matthias Aust
4 Oh, it's not creating the ID, my question was whether I can safely assume that I will always get an IntegrityError (and nothing else) and whether just inserting stuff and catching errors is the recommended Pythonic way. -- Stefan Matthias Aust // Truth until paradox --~--~-~--

Re: Blog engine

2007-07-19 Thread Stefan Matthias Aust
If it is so easy to create a blogging application with Django, then this should be an argument for a standard application, not against it IMHO. At minimum, it could become a nice example application, either as part of the django distribution or as a separate download. And if it is still easy enou

Debugging file uploads

2007-07-19 Thread Stefan Matthias Aust
place :) What I know about Python so far, this should be possible, shouldn't it? If you can load and display the source code, you must be able to save a modified version to the same location... And, well, syntax coloring would be nice... no just kidding... -- Stefan Mat

4 beginner's questions

2007-07-19 Thread Stefan Matthias Aust
file. ... Wait, I think, _save_FIELD_file() will eventually save the file and yes, that while loop is obviously not threadsafe! So I need to set the filename myself. But how? -- Stefan Matthias Aust --~--~-~--~~~---~--~~ You received this message because yo