Re: Count clicks

2006-10-09 Thread Holger Schurig
> agreed, in a perfect world i would parse the log files. But > sometimes you don't have access to a cron daemon. In this case you should read the database API documentation page. Then your code looks something like this: from django.shortcuts import get_object_or_404 from my.models import MyOb

Re: HTML entities

2006-10-06 Thread Holger Schurig
> > Oh, I just noticed this with Konqueror from KDE 3.5.4: you can have this meta line in your base.html template as long as you want. When you use "./manage.py runserver", it won't be honored, the value from DEFAULT_CHARSET from settings.py takes precedence. --~--~-~--~~-

Re: long-running process. how to do it?

2006-10-06 Thread Holger Schurig
> I wrote a daemonize method that can be called by the view to > spawn a new process that executes your code. Looks very similar to django.utils.daemonize :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: HTML entities

2006-10-05 Thread Holger Schurig
> ä -> ä > Ö -> Ö > ß -> ß Do you really need them? Theoretically, you can simply set And then you may use those characters literally. However, I'm not a browser expert and don't know if all modern browsers under the sun understand this. --~--~-~--~~~---~--~-

Re: Importing models from each other.

2006-10-04 Thread Holger Schurig
> I try to import like: "import myproject" and then > myproject.auth.models.User but no luck, Django throws error, > that auth has no models class. Is there a way to make this to > work? For this kind of problem it helps sometimes to use the "-v" option to python, e.g. python -v ./manage.py run

Re: createsuper user by shell

2006-10-02 Thread Holger Schurig
> In the last svn version I can't use django-admin > createsuperuser name mail passw > > How to add a super user by python shell ? from django.contrib.auth.models import User user = User( username='name', password='sha1$8b4ed$jfhjdhfjhsw4334uhxnxcywjiewwcccf3a6d8326', email='[EMAIL PROTECT

Re: Why I'm giving up on Django

2006-09-29 Thread Holger Schurig
> I kept running into error messages which told me about > exceptions in the Django source code (this is the top part of > the error page) and I kept thinking "well, where's the bloody > use in that??? I want to know what MY error was! Grmbl.". Django your easily find out if a module name in it's

Re: acts_as_list?

2006-09-29 Thread Holger Schurig
> #Create a chapter, have it automatically set the position You may amend the model's save() method to do that for you: def save(self): # Fiddle with the positon field self.position = # And now the actual save operation super(Item, self).save() > move_higher

Re: How to create unions (or how to extend a QuerySet)?

2006-09-27 Thread Holger Schurig
I found a way. Using the extra() directive, I create another field, e.g. is_new. I then can use this as a sort criteria. There's no need to output this field: list = Device.objects .extra(select={'is_new': 'name LIKE "New Device%%"'}) .order_by('-is_new', 'parent', 'name') -

How to create unions (or how to extend a QuerySet)?

2006-09-27 Thread Holger Schurig
I have a list that looks like this: list = Device.objects.all().order_by('parent', 'name') and I use this list in a view. Works fine. However, I want to have the items with a special name at the top of the generated list. I can easily create two lists, which have the two items in it: li

Re: automatically fill in some fields of a form, storing authenticated user

2006-09-25 Thread Holger Schurig
> I think ajax tech will very suit for these things. Because you Recently there where browser exploits that utilized JavaScript. So it *CAN* happen that some people will turn JavaScript off. In this case your Ajax method doesn't work anymore. --~--~-~--~~~---~--~---

Re: The Holy Grail of Web Development

2006-09-25 Thread Holger Schurig
> knock-on errors)... and lastly... ScrIDE doesn't let me run > manage.py with arguments. It let's you. You can modify manage.py, and then you can change the values in sys.argv to your pleasure. I, for example, do this: if __name__ == "__main__": # Shut up the initial syncdb im

Re: settings.py help please

2006-09-21 Thread Holger Schurig
> raise ImproperlyConfigured, "Error loading MySQLdb module: > %s" % e django.core.exceptions.ImproperlyConfigured: Error > loading MySQLdb module: No module named MySQLdb Your python installation lacks the python-module name 'MySQLdb' to access MySQL databases. If you were on Debian, you w

Akismet strikes again

2006-09-20 Thread Holger Schurig
I tried to remove the link Django API (Beta): Automatic generated API using epydoc from the WikiStart page. However, some SPAM protection tool called "Akismet" prevented me from doing this. For the record: the indicated site doesn't work. --~--~-~--~~~---~--~---

Re: Multiple Components on One Page

2006-09-19 Thread Holger Schurig
> I am a recovering .NET addict and still very new to Python, so > just talk some heavy python right now and you can probably > make my head explode :-). http://www.diveintopython.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

How to combine generic object_detail and object_list view in a template?

2006-09-15 Thread Holger Schurig
I have a model similar to this: -- class Device(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(blank=False, maxlength=40) #... class Item(models.Model): id = models.AutoField(primary_key=True)