Re: Problem with a clean in inline formset

2012-05-01 Thread Ernesto Guevara
Solution: def clean(self): if any(self.errors): # Don't bother validating the formset unless each form is valid on its own return for i in range(0, self.total_form_count()): form = self.forms[i] cleaned_data = form.clean() displa

Re: no module named books found

2012-06-16 Thread Ernesto Guevara
Check the structure of project: Here I use Eclipse, and my project have this structure: myproject>myproject>app In your case: djangotest2>djangotest2>books Or: djangotest2>books And in installed_apps: INSTALLED_APPS = ( 'books', ) 2012/6/16 Sabbineni Navneet > project name is django

Re: no module named books found

2012-06-16 Thread Ernesto Guevara
The problem now is the database configuration: raise ImproperlyConfigured(" settings.DATABASES is improperly configured. " django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. DATAB

Re: Django 1.4 and google app engine

2012-06-17 Thread Ernesto Guevara
In GAE only using django-norel, a fork of django with no join's queryset. https://developers.google.com/appengine/articles/django-nonrel Or using in Google Cloud SQL: https://developers.google.com/appengine/docs/python/cloud-sql/django But is a paying service. 2012/6/17 Gebriel Abebe > Plea

Re: no module named books found

2012-06-17 Thread Ernesto Guevara
"Do we have to create a database with that name before." Yes, you need create the database "xam" (from mysql query browser) before running syncb. 2012/6/17 Sabbineni Navneet > I have Mysqldb installed. > It still shows the same error. > > > > -- > You received this message because you are subs

Re: Custom Tags and Includes, invalid block !

2012-06-18 Thread Ernesto Guevara
Hi! Try {% load name_of_custom_tag %} after the extends tag in template. 2012/6/18 upmauro > Hello, sorry my english ! > > I have one question, i create one custom tag and this works fine. > > But i have a situation : > > *site.html* > * > * > {% include "header.html" %} > > Django looks the b

Re: Where to delete model image?

2012-07-13 Thread Ernesto Guevara
Hi! I have this old code here. # forms.py class UploadFileForm(ModelForm): title = forms.CharField(max_length=250 ,label="Nome:") original_image = forms.ImageField(label="Imagem:") class Meta: model = Photo # models.py from django.dispatch import receiver from django.db.mo

Re: Extend user model: class inheritance or OneToOneField?

2012-07-13 Thread Ernesto Guevara
Hi! I prefer using OnetoOne with a pre_delete signal to remove user from a pirncipal object instance: from django.contrib.auth.models import User from django.db.models.signals import pre_delete from django.dispatch import receiver class Customer(User): user = models.OneToOneField(User) @rec

Re: 'NoneType' object has no attribute 'datetime' bug?

2012-07-14 Thread Ernesto Guevara
Try this: from datetime import datetime, time, date current_date = datetime.now() today = datetime.combine(date.today(), time(19,30)) Look: >>> from datetime import datetime, time, date >>> print datetime.now() 2012-07-14 14:14:17.897023 >>> print datetime.combine(date.today(),time(19,30)) 201

Re: admin login fails

2011-04-19 Thread Ernesto Guevara
Or you can delete database and execute again syncdb. The aplication ask again the password, warning for capslock. =) 2011/4/19 pfc > I'm new to Django and am following the tutorials, specifically: > http://docs.djangoproject.com/en/dev/intro/tutorial02/ > I followed the instructions on adding ad

Re: The import staticfiles_urlpatterns is not working in django 1.3

2011-04-21 Thread Ernesto Guevara
Hello Brian! This right, in fact that word "import" I inadvertently pasted, but the import does not work. from django.contrib.staticfiles.urls import staticfiles_urlpatterns The problem was that when doing the import, it does not appear available by pressing ctrl + backspace in Eclipse, that is,

Re: How to register EmployeeAdmin using atributes in Person class

2011-04-24 Thread Ernesto Guevara
I still having a little problem using OneToOne relationship and Edit form. The forms are created with combobox and get all address in database, i need the address of the specific Employee only. Anybody know fix this problem? Thanks! 2011/4/23 Guevara > I got put in the form of employee the for

Re: {{ STATIC_URL }} and RequestContext()

2011-04-25 Thread Ernesto Guevara
Hello! You need create a "static" folder in your project and inside in this folder you create a "css" folder. I use this configuration and works. settings.py import os.path STATIC_ROOT = '' # URL prefix for static files. STATIC_URL = '/static/' ADMIN_MEDIA_PREFIX = '/static/admin/' TEMPLATE_D

Re: Need advice on ecommerce app direction

2011-04-25 Thread Ernesto Guevara
I find for download "Beginning Django E-Commerce" in webmasterresourceskit site. Look that. Regards. 2011/4/25 Shant Parseghian > Hi all, I'm aware of the choices out there for Django ecommerce apps but im > confused about which to use. I need a simple shop that will do delivery only > so no sh

Re: Does django 1.3 has a ubuntu deb package released!

2011-04-29 Thread Ernesto Guevara
In the repository of ubuntu 10.04.2 the version 1.1.1 is available, better download version 1.3 of the Django site and install. Is very easy. Regards! 2011/4/29 Korobase > Does django 1.3 has a ubuntu deb package released ! > I have googled but get none,Any one have done this? > Thanks. > > --

Re: Using composition in Django

2011-04-29 Thread Ernesto Guevara
Thanks for the clarification, I put in the ForeignKey in employee class and is working. Regards! 2011/4/27 Tom Evans > On Sun, Apr 17, 2011 at 9:21 PM, W Craig Trader > wrote: > > If your goal is to have an employee object that has direct access to all > of > > its related person object, and wh

Re: Change select to a form in a ForeignKey relationship

2011-05-13 Thread Ernesto Guevara
Very good, I edited here. Thank You! 2011/5/13 Shawn Milochik > On 05/13/2011 04:22 PM, Guevara wrote: > >> Thank you shaw! >> >> You're welcome. Note that there's no reason to add 'commit = True' when > saving the address -- that's the default. > > > Shawn > > -- > You received this message b

Re: specify Postgres encoding as unicode

2011-05-18 Thread Ernesto Guevara
Hello! Open your pdAdminIII and create a database using UTF-8. For aplication this is setting for your settings.py: DEFAULT_CHARSET = 'utf-8' FILE_CHARSET = 'utf-8' Regards! 2011/5/18 Thin Rhino > Hello, > > I am wondering if it is possible for me to specify the encoding to use for > a postgre

Re: django raw_id_fields patch

2011-05-25 Thread Ernesto Guevara
I need change the FK id value in raw_id to Thanks! 2011/5/25 epic2005 > who have the raw_id_fields patch url.. or some sugguest for modify > raw_id_fields pop id back in the textbox , please give me , thanks a > lot. > > -- > You received this message because you are subscribed to the Goog

Re: Does django 1.3 has a ubuntu deb package released!

2011-05-31 Thread Ernesto Guevara
In Ubuntu 10.04 repository stlll 1.1 version. =/ 2011/5/31 Tobias Quinn > You can always install the debian package from: > > http://packages.debian.org/wheezy/python-django > > which seems to work fine... > > On Apr 30, 3:29 am, Korobase wrote: > > Does django 1.3 has a ubuntu deb package rele

Re: populating a field based on selection of foreign key

2011-04-09 Thread Ernesto Guevara
Hello! I think you need something like this in your admin.py: class SystemAdmin(admin.ModelAdmin): list_display = ("generation", "system", "cog_E") ordering = ["-cog_E"] search_fields = ("system") list_filter = ("generation") list_per_page = 10 admin.site.register(System, Syst