Re: age in years calculation

2007-08-03 Thread Niels
Interesting. Would this work?? (now - birthday).days * 100 / 36524 Niels On Aug 3, 1:45 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > On 8/3/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > > > > > > Hey Everyone, > > > do

Re: dynamic template?

2008-07-22 Thread Niels
Tsss...how stupid. Thanks On Jul 22, 2:51 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Hi Niels.  See the documentation for the include tag: > > http://www.djangoproject.com/documentation/templates/#include > > It indicates that "[t]he template name can ei

dynamic template?

2008-07-22 Thread Niels
':nav.html,'template_content':agenda.html}) So I have one 'main template' where I can include different html files with I maintain in my view. Someone a suggestion? Niels --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

makemessages .. not all translations found or commented out

2009-06-23 Thread Niels
I have text (in .html, .py an .txt) that should be translated. When I use this command ./manage.py makemessages -l nl -- pythonpath=apps_pinax,templates_pinax It finds translations in the html file like: #: templates_pinax/tribes/topics.html:11 msgid "Discussion Topics for Tribe" msgstr

url's in form labels

2009-09-07 Thread Niels
ke to have something like: terms_conditions = forms.BooleanField(label=_("< a href='{{ terms_and_conditions }}'>Terms and conditions"), help_text=_("You have to agree with the terms and conditions"), required=True) Someone a suggstion, because the above s

comments : error messages not in page layout

2009-10-30 Thread Niels
-not-in-original-page some help? Thanks, Niels --~--~-~--~~~---~--~~ 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 g

initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Niels
Is this a known bug? csh .. > python manage.py syncdb Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating table

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Niels
On Wed, Nov 09, 2011 at 03:38:23PM +, Tom Evans wrote: > On Wed, Nov 9, 2011 at 3:24 PM, Niels <pro2...@nlsp.xs4all.nl> wrote: > > Is this a known bug? > > > > csh .. > python manage.py syncdb > > > > Creating tables ... > > Creati

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Niels
On Wed, Nov 09, 2011 at 04:21:55PM +, Tom Evans wrote: > On Wed, Nov 9, 2011 at 4:03 PM, Niels <pro2...@nlsp.xs4all.nl> wrote: > > Worse: > >>>> locale.getdefaultlocale() > > (None, None) > > > > Still i'd say this should be handled better th

object is not iterable.

2010-05-14 Thread Niels
In my template this error occurs: Caught an exception while rendering: 'Gallery' object is not iterable It occurs in this part: {% for image in car.images %} Where my models looks like: from photologue.models import Gallery,Photo ... class CarDetail(models.Model): images =

Extranet : Complete project behind login?

2009-12-16 Thread Niels
We're developing an extranet. What is the best (and easiest) way to put a complete project behind a login? I don't want to add @login_required to all views Thanks, Niels -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Extranet : Complete project behind login?

2009-12-17 Thread Niels
Thanks a lot. That works. Great. On Dec 16, 5:07 pm, Shawn Milochik wrote: > You can do it easily with middleware. > > Here's what I wrote for this exact purpose:http://pastebin.com/f52e6ef04 > > You will have to add it to MIDDLEWARE_CLASSES in your settings.py. > > Shawn

Django marketplace?

2010-03-11 Thread Niels
Hello, Sometimes I need some specific Django development where I don't have time for, or someone else could do better. I am looking for a marketplace where I can look for a Django/Python developer for a small but specific code snippet developer. Does someone has a suggestion? Thanks, Niels

Re: Translation problem in newforms

2007-04-12 Thread Niels
Hi. I think you need the to add following import statement after importing newforms as well: from django.utils.translation import gettext_lazy as _ On Apr 12, 5:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have the following form: > > from django import newforms as forms > > class

Re: Translation problem in newforms

2007-04-12 Thread Niels
Your understanding is basically correct. Gettext_lazy returns an object that will be stored inside the form class definition. The actual translation then occurs when that object is evaluated as a string. And there is quite some magic going on behind the scenes: >>> from django.utils.translation

Re: integratin Django to an old site

2007-04-12 Thread Niels
below it. Everything else will be served by apache and whatever means configured in your configuration. Regards, Niels On Apr 12, 9:50 pm, "sjol" <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to integrate Django to an "old" site. By this I mean that >

Re: integratin Django to an old site

2007-04-12 Thread Niels
ehm... take 2: which has the same effect :$ On Apr 13, 1:16 am, "Niels" <[EMAIL PROTECTED]> wrote: > Things don't need be more complicated than neccessary: --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: How can I order foreign key items presented in the admin?

2007-04-13 Thread Niels
class SuitetoTest(models.Model): runorder = models.IntegerField(core=True) test = models.ForeignKey(Test) suite = models.ForeignKey(Suite, edit_inline=models.TABULAR, num_in_admin=10) class Meta: ordering = ("runorder",) On Apr 13, 12:17 pm, "Ryan Alexander"

Re: Tutorial part 4 IndexError

2007-04-13 Thread Niels
I smell the sense of an end-of-line convention problem in django's debug view. Could it be your sourcefile uses '\r' for end of line where django expects a '\n' ?? On Apr 13, 8:12 am, "jonathan_ou" <[EMAIL PROTECTED]> wrote: > I am using python 2.5 with django 0.96 rev 5005 using mysql database.

Re: Maintaining a resource between requests

2007-06-13 Thread Niels
On Jun 13, 8:38 pm, "Patrick Quinn" <[EMAIL PROTECTED]> wrote: > I'd like to maintain a resource (python object) between multiple > requests and multiple users. In this case, I'd like my app to > maintain a Jabber connection which is established when it's needed and > kept as long as possible.

Re: How to make dictionary out of model instance

2007-07-16 Thread Niels
Or yet another option: def instance_dict(i): return dict(map( --~--~-~--~~~---~--~~ 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

Re: How to make dictionary out of model instance

2007-07-16 Thread Niels
On Jul 16, 11:18 pm, Niels <[EMAIL PROTECTED]> wrote: Grumble. Safari ate my code. That should read (new try...) def instance_dict(i): return dict(map( lambda a, b=i: (a, getattr(b, a)), [f.attname for f in i._meta.fields] )) --~--~-~--~~~---~--~---

Re: Problem with multiple django versions on mod_python

2007-07-19 Thread Niels
PythonHandler django_someversion_handler PythonInterpreter version2 Finally, you might want to have different manage.py stubs with an extra first line importing the right django module as django into the namespace to get going. Best regards... Niels On Jul 19, 12:46 pm, oggie rob <[EMAIL PROTECT

Re: Random IndexError

2007-07-19 Thread Niels
This might mean your sourcefile uses '\r' for newlines which isn't handled correctly by django. If that's the case, this might be worth filing a ticket, i think. On Jul 19, 1:20 pm, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Hi there! > > I'm getting random IndexErrors. This has risen when

Re: Random IndexError

2007-07-19 Thread Niels
Well, that should be explained in http://www.djangoproject.com/documentation/contributing/#reporting-bugs And after following the do's and avoiding the don'ts, you would proceed at http://code.djangoproject.com/newticket Best, Niels On Jul 19, 2:33 pm, Chris Hoeppner <[EMAIL PROTEC

Re: mod_python - Using Apache prefork Vs Apache worker

2006-09-08 Thread Niels
Hi there Just to report on this, i set up a machine with very little memory using apache 2.2.1 (worker mpm), with mod_python 3.3 (development version 20060520) and django. It seems there is nothing much in django nor python that isn't thread safe. External C libraries you load as a python module

Re: Django Web Hosting Service

2007-11-22 Thread Niels Sandholt Busch
> Can anybody recommend me a Django Web Hosting Service? Webfaction is really good. I'm a happy customer. \Niels --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi