Re: Ifnotequal used with Length filter and a zero value not working

2009-06-24 Thread Marcin Mierzejewski
Hi Matthew, > I have what is basically this layout: > > {% ifnotequal activeusers|length 0 %} >     {{ activeusers|length }} Friends Online > {% else %} >     Friends > {% endifnotequal %} Try this: {% if activeusers %} {{ activeusers|length }} Friends Online {% else %} Friends {% endif

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Marcin Mierzejewski
Hi Archatas, On Apr 16, 4:07 pm, "Aidas Bendoraitis [aka Archatas]" wrote: > > 8. Using parameters > >      /products/?sort=popularity > >      /products/?filter=featured > >      /products/?page=5 > >      /products/add/ > >      /products/myproduct/ > >      /products/myanotherproduct/ > In th

Re: Clean URL Design: List Views and Details Views

2009-04-16 Thread Marcin Mierzejewski
Hi Aidas, > 7. Using the controlling words before the type of list: >     /by-popularity/products/ >     /featured/products/ >     /page5/products/ >     /add/products/ >     /products/myproduct/ >     /products/myanotherproduct/ 8. Using parameters /products/?sort=popularity /products

Re: Running two django version from same python.

2009-04-16 Thread Marcin Mierzejewski
Hi Harish, On Apr 16, 12:27 pm, Harish wrote: > Is it possble to install two seperate django versions (0.97  and > 1.0.x) in one python site-package file. > If yes how and if no why? You can put django into your project directory, e.g. /myproject /__init__.py /manage.py /urls.py /

Re: Best practice... page specific details in views or templates

2008-10-23 Thread Marcin Mierzejewski
Hi Ramya, > I have 2 options > a. Build the object as well as pass the set the variables for titles / > headings in view and have a single template for all views. > Down fall.. view has details related to rendering.. > b. Have many templates with each template having specific information > for ev

Re: template tags with variables as arguments

2008-10-22 Thread Marcin Mierzejewski
Hi Ramyak, > a. Can template tags take arguments (not a string) > {% formatDateTime_5 value %} > where value is a variable > time data did not match format: data=value fmt=%Y-%m-%dT%H:%M:%S+ Yes. > > b. Can template tags take objects as arguments.. tat is if the above > is possible.. Yes.

Re: uploading CSV files

2008-05-21 Thread Marcin Mierzejewski
Dear Nanda, Please visit the link below: http://www.zoia.org/blog/2007/07/29/django-file-upload/ I hope that it helps you. Best regards, Marcin Mierzejewski On May 21, 1:40 pm, nandu <[EMAIL PROTECTED]> wrote: > Dear All, > > I am having a problem with where to start when

Re: TemplateDoesNotExist error

2008-02-08 Thread Marcin Mierzejewski
Hi, You have to add path to directory where you have template files. settings.py file TEMPLATE_DIR parameter. Regards, Marcin On Feb 7, 4:16 pm, Schmoopie <[EMAIL PROTECTED]> wrote: > I'm slaying the configuration bugs, slowly but surely, with your help. > > The latest one is a TemplateDoesNot

Re: Customizing the Admin Interface's Look and Feel - ch 6

2008-02-08 Thread Marcin Mierzejewski
Hi You have to add ADMIN_MEDIA_PREFIX to your settings.py file, e.g.: ADMIN_MEDIA_PREFIX = '/media/admin' Regrads, Marcin On Feb 7, 6:35 pm, mangamonk <[EMAIL PROTECTED]> wrote: > I'm trying to make a change to my templates here.. > > /django_trunk/mysite/templates/admin/base_site.html > > But

Re: template & forloop help

2008-02-08 Thread Marcin Mierzejewski
Hi, What is 'divs' in your example? And what do you want to do it? If you want to display a list "name1", "name2", "name3" you can do it in this way: view.py divs = ('name1', 'name2', 'name3') template.html {% for div in divs %} {{ div }} {% endfor %} Regards, Marcin On Feb 6, 5:23 pm, [

Re: best practices for a production site

2008-01-18 Thread Marcin Mierzejewski
Hi Kenneth, I have very similar situation in my projects (some our projects, we develop 4 version in the same time - client specific versions). We do it in this way (we are using SVN): /trunk/ <- latest version /branches/product-1.0 /branches/product-1.1 /branches/product-1.2 /tags/product-1.0.0

Re: ManyToManyField problem?

2007-12-13 Thread Marcin Mierzejewski
ambiguity > > On Dec 13, 2007 5:45 PM, Marcin Mierzejewski <[EMAIL PROTECTED]> > wrote: > > > > > It should work. > > > On Dec 13, 9:32 am, "Young Gyu Park" <[EMAIL PROTECTED]> wrote: > > > Ye. It works. > > > > But when

Re: ManyToManyField problem?

2007-12-13 Thread Marcin Mierzejewski
It should work. On Dec 13, 9:32 am, "Young Gyu Park" <[EMAIL PROTECTED]> wrote: > Ye. It works. > > But when I work with generic view such as update insert, how can I work with > this code? > > On Dec 13, 2007 5:04 PM, Marcin Mierzejewski <[EMAIL PROTECT

Re: ManyToManyField problem?

2007-12-13 Thread Marcin Mierzejewski
Hi, Try this: class Entry(models.Model): ... tags = models.ManyToManyField( Tag ) class Tags(self): return self.tags.all() class Tag(models.Model): ... And now, Entry.Targs() returns all Tags related to the blog entry. Regards, Marcin On Dec 13, 8:54 am, "Young Gyu Park" <[EMAIL

Re: Spam mail in forms

2007-11-20 Thread Marcin Mierzejewski
Hi Rufman, You can use third part software like http://recaptcha.net/ or you can use this idea to write something similar. Regards, Marcin On Nov 20, 4:15 pm, Rufman <[EMAIL PROTECTED]> wrote: > Hey Guys > > Is there some way to stop (reduce) the spam I get through a form? I > was thinking of

Re: Django / Apache Problem (ignores SetHandler)

2007-11-20 Thread Marcin Mierzejewski
Hi, You can use django.views.static.serve. In my application I have the following link in my urls.py (r'^css/(?P.*)$', 'django.views.static.serve', {'document_root': '%s/templates/css' % APPLICATION_ROOT }), (r'^javascript/(?P.*)$', 'django.views.static.serve', {'document_root': '%s/templates/ja

Re: Dynamic ImageField

2007-11-08 Thread Marcin Mierzejewski
Hi, Yes, you can: http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/ http://code.djangoproject.com/wiki/CustomUploadAndFilters Regards, Marcin On Nov 8, 2:08 pm, cschand <[EMAIL PROTECTED]> wrote: > Hi all, > Can we make dynamic ImageFields? upload file t

Re: syncDB

2007-11-06 Thread Marcin Mierzejewski
Hi, >From Django Book: "syncdb command is a simple sync of your models to your database. It looks at all of the models in each app in your INSTALLED_APPS setting". But you can uses --settings option for manage.py. ./manage.py syncdb --settings=mysettings where mysettings.py contains only your

Re: Authorization Model at the Field Level

2007-11-06 Thread Marcin Mierzejewski
Hi Manakel, On Nov 6, 11:53 am, Manakel <[EMAIL PROTECTED]> wrote: > This web application had a Authorization model at the Field level. > [] > TASK has a progress status field and a due date field > realisator user can only change the status field > owner can change both the status field

Re: FLATPAGES

2007-10-25 Thread Marcin Mierzejewski
Hi, > I get the add flat page in admin, but after adding a flat page,when i > try to 'view on site', it gives me a 404 error.Can you tell me why > isn't FlatpageFallbackMiddleware working?And yes, I did add the > trailing slashes as url. (eg: /about/). Please advice. Thank you. Did you add dja