how to use "{% url *** %}" in django template file?

2011-08-06 Thread Jimmy
Hi, I got the error "Caught ImportError while rendering: No module named urls" when using: {% url 'card.views.create_card' %} in the template file in the urls.py the route to the url is: urlpatterns = patterns('', url(r'card/create$', 'card.views.create_card'), ) The Django version I use

Annoucing python-dad

2011-08-06 Thread h3
"Python-dad which stands for Django Automated Deployment is a lightweight Python package which harness the power of virtualenv, pip and fabric to fully automate the development setup and deployment of django projects. " Blog post: http://haineault.com/blog/163/ Project page:

Re: Calculation for each object in a QuerySet

2011-08-06 Thread bruno desthuilliers
On 6 août, 19:32, nixlists wrote: > Thank you so much guys, your suggestions are very helpful. Bruno, Why, thanks... Oh, and did I suggest paying more attention to naming ?-) Sorry, couldn't resist - but from experience, good naming really makes a difference - it makes the

Re: Django for a front end designer

2011-08-06 Thread bruno desthuilliers
On 6 août, 22:53, paulo couto wrote: > Thank you all for your advices. > I started with the beginners guide from the python official site because i > think i should learn at least the basics of python before move into django. Yeps, right. Better to start with the core

Re: Django for a front end designer

2011-08-06 Thread bruno desthuilliers
On 5 août, 20:30, Doug Ballance wrote: > Your time spent learning python and django > will not be wasted if you also choose to learn/use php.  I think it's > much easier to learn good methodology and practices with python, and > then carry those practices over to php than than

How to write startup tests for urlconf?

2011-08-06 Thread Evgeny
Hello, Is it possible to somehow interrogate url configuration at startup time? I am trying to give users a meaningful message when something needs to be changed in the url configuration. For example - now I need to change the handler500 and handler404, when my app is upgraded. Tried many ways,

django-registration

2011-08-06 Thread bob gailer
I indstalled django-regstration per the Quick-Start guide: easy_install -Z django-registration manage.py syncdb I added 'registration', to INSTALLED_APPS = () and ACCOUNT_ACTIVATION_DAYS = 7 I added (r'^accounts/', include('registration.backends.default.urls')), tp my urls.py At this point I

force reading of django.settings (and thus logging)

2011-08-06 Thread Gelonida N
Hi, I have a small question: I use settings.py:LOGGING in order to configure my logging Now I'd like to add some log traces during the import phase of a module using django Example: import logging logger = logging.getLogger('mymodule') logger.INFO('created logger') import django.db

Problem with django book in Forms chapter 7

2011-08-06 Thread bob gailer
I love the django book. Until I got to the section "Tying Your First Form Class". Problem:-"This class can live anywhere you want — including directly in your views.py file — but community convention is to keep Form classes in a separate file called forms.py. Create this file in the same

Re: Django for a front end designer

2011-08-06 Thread paulo couto
Thank you all for your advices. I started with the beginners guide from the python official site because i think i should learn at least the basics of python before move into django. What you advice after i complete the beginners guide?Should i pick one of my designs and try to "pythonize" it?

Re: Django 1.3 CreateView/ModelForm and dynamic filtering of fields

2011-08-06 Thread Paul Walsh
hmm. Still stuck on this. I have tried a range of solutions, but none work for me with 1.3 class-based views. Can anyone help? thx, paul. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: if condition in template not working

2011-08-06 Thread sakthi vel
ya it worked. thank you! On Sat, Aug 6, 2011 at 11:07 PM, Thomas Orozco wrote: > In your context you passed your 'lists' object as 'book'. > > So {% if book %} would work, but your current syntax won't. > Le 6 août 2011 19:32, "shakthi" a écrit : >

Re: if condition in template not working

2011-08-06 Thread Thomas Orozco
In your context you passed your 'lists' object as 'book'. So {% if book %} would work, but your current syntax won't. Le 6 août 2011 19:32, "shakthi" a écrit : > The if condition in my html template is not working, only else is > executing. > > view function is > def

Re: if condition in template not working

2011-08-06 Thread Shawn Milochik
This is because you're passing it as 'book' in the context. {% if book %} will evaluate to True. -- 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

Re: Calculation for each object in a QuerySet

2011-08-06 Thread nixlists
Thank you so much guys, your suggestions are very helpful. Bruno, others: I really appreciate your help. -- 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

if condition in template not working

2011-08-06 Thread shakthi
The if condition in my html template is not working, only else is executing. view function is def test(request): lists=Book.objects.all() return render_to_response('test.html',{'book':lists}) template file:test.html {% if lists %} {% for a in lists %} There are

RE: Question about imports..Python Dejango and Models

2011-08-06 Thread Hayyan Rafiq
Thanks guys ... for clarifying that up.. > Date: Sat, 6 Aug 2011 01:50:21 -0700 > Subject: Re: Question about imports..Python Dejango and Models > From: andrew.mark.sc...@gmail.com > To: django-users@googlegroups.com > > Hi, > > models.Model is django.db.models.base.Model and is defined in

Re: Question about imports..Python Dejango and Models

2011-08-06 Thread Andrew
Hi, models.Model is django.db.models.base.Model and is defined in django/ db/models/base.py. Have a look at django/db/__init__.py (in your local Django installation or https://code.djangoproject.com/browser/django/tags/releases/1.3) and http://docs.python.org/tutorial/modules.html. Regards,

Displaying is_superuser and is_active in admin

2011-08-06 Thread Alex Dehnert
I'd like to be able to display the superuser and active status of users in the Django admin interface. Is there a good/clean way of doing that? (Alternatively, does anybody think there's a chance of getting code to make this happen in Django itself?) While looking around, I ran into

Re: static files (development server)

2011-08-06 Thread Shawn Milochik
Are you running collectstatic after making those changes? -- 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 group, send email to

Re: static files (development server)

2011-08-06 Thread veva...@yandex.ru
I have got working test project but it works very strange. http://www.w3.org/1999/xhtml; xml:lang="en"> What is strange: if I rename an image file or any directory and change a reference accordingly, an image disappears from the page. -- You received this message because you are

Re: Question about imports..Python Dejango and Models

2011-08-06 Thread Shawn Milochik
2011/8/6 Rafael Durán Castañeda : > I'm not a django expert but I think you are wrong. Checking my django > installation: > Yep, you're right. https://code.djangoproject.com/browser/django/trunk/django/db/models/base.py -- You received this message because you

Odp: Upload Multiple Images App ?

2011-08-06 Thread Petey
I did it in a simple way ;) I had seperate model class for images and I used inline models in admin Take a look at code below: models: class News(models.Model): title = models.CharField("Tytuł", max_length=256) text = models.TextField("Treść") date_added =

Re: Calculation for each object in a QuerySet

2011-08-06 Thread bruno desthuilliers
On 6 août, 02:45, nixlists wrote: > On Fri, Aug 5, 2011 at 5:14 PM, Subhranath Chunder > wrote: > > Your model declarations are very confusing for me, Indeed. Not using explicit names, and reusing the same name for both a field in the Product model

Re: Question about imports..Python Dejango and Models

2011-08-06 Thread bruno desthuilliers
On 6 août, 03:04, Adam Zedan wrote: > Hi while going through the Django Book I ran into the following code > Being fairly new to Python the code kind of confused me Python-related questions ought to posted on comp.lang.python... But anyway: > from django.db import models    

Re: Question about imports..Python Dejango and Models

2011-08-06 Thread Rafael Durán Castañeda
I'm not a django expert but I think you are wrong. Checking my django installation: - models is package not a python module - __init__.py from this file contains: from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.db import