Reference to form cleaned data field throws TypeError: 'exceptions.AttributeError' object is not callable

2014-06-03 Thread Gloria W
This is the strangest bug I've seen in Django. (1.6.4 on Ubuntu 14.04, 
Python 2.7.6)
 It is sporadic, but once it starts happening, it is consistent until I 
restart the process. 
To try and debug it, I print the value of self.cleaned_data just before it 
occurs. The value prints fine. 


The code:

def clean_email(self):
logger.warn("Debugging Attribute error:%s" % 
pprint.pformat(self.cleaned_data))
try:
FytUser.objects.get(email=self.cleaned_data['email'])
raise forms.ValidationError('A user with that email address 
already exists.')
except FytUser.DoesNotExist:
return self.cleaned_data['email']


The traceback in the uwsgi logs: 

Debugging Attribute error:{'email': u't...@test.net'}

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", 
line 114, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "./registration/views.py", line 54, in preregister_check
if form.is_valid():

  File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 
129, in is_valid
return self.is_bound and not bool(self.errors)

  File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 
121, in errors
self.full_clean()

  File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 
273, in full_clean
self._clean_fields()

  File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 
291, in _clean_fields
value = getattr(self, 'clean_%s' % name)()

  File "./fyt/forms.py", line 87, in clean_email
FytUser.objects.get(email=self.cleaned_data['email'])

  File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", 
line 151, in get
return self.get_queryset().get(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 
307, in get
self.model._meta.object_name)

TypeError: 'exceptions.AttributeError' object is not callable


,
POST:'], u'discount_code': 
[u'']}>,
COOKIES:{'_ga': 'xxx',
 'csrftoken': 'x',
 'sessionid': 'xx',
 'signup_modal': 'true'},
META:{'CONTENT_LENGTH': '221',
 'CONTENT_TYPE': 'application/x-www-form-urlencoded; charset=UTF-8',
 u'CSRF_COOKIE': u'xx',
 'DOCUMENT_ROOT': '/home/xx',
 'HTTP_ACCEPT': 'application/json, text/javascript, */*; q=0.01',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
 'HTTP_CACHE_CONTROL': 'no-cache',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_CONTENT_LENGTH': '221',
 'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded; charset=UTF-8',
 'HTTP_COOKIE': 'csrftoken=xxx; sessionid=xx; _ga=xx; 
signup_modal=true',
 'HTTP_HOST': 'findyourtrainer.com',
 'HTTP_PRAGMA': 'no-cache',
 'HTTP_REFERER': 'https://x/register?next=/ 
',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 
Firefox/29.0',
 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
 'PATH_INFO': u'*/prereg_check/*',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '',
 'REMOTE_PORT': '37998',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '*/prereg_check/*',
 u'SCRIPT_NAME': u'',
 'SERVER_NAME': '.com',
 'SERVER_PORT': '443',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'UWSGI_SCHEME': 'https',
 'uwsgi.node': '.com',
 'uwsgi.version': '2.0.4',
 'wsgi.errors': ,
 'wsgi.file_wrapper': ,
 'wsgi.input': ,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'https',
 'wsgi.version': (1, 0)}>


This looks like a memory leak to me. Has anyone else seen this?
Thanks in advance,
~G~

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/11ddf2f6-7a07-4c1e-86db-b7e0223546ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"original" not set in admin template django/contrib/admin/templates/admin/submit_line.html after upgrade

2013-09-25 Thread Gloria W
Hi all,

I recently upgraded a site from 1.4 to 1.5.4, and it seems like in the 
submit_line template, "original" is not set. 
This line fails for that reason:

{% if show_delete_link %}{% trans "Delete" %}{% endif %}

The template chain at this point is so nested that it's hard to figure out 
where "original" originated. Does anyone know what is going on here?

Thank you,
Gloria

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Circular import on every backend except sqlite

2011-06-03 Thread Gloria W
I found it. Someone else on the machine had replaced mod_wsgi with a
2.6 variant they compiled. I am using one I compiled for 2.7.1.
Nasty things happen when the mod_wsgi module doesn't match the python
version one's running.
What a P.I.T.A. to find.

Gloria

On Jun 2, 9:11 am, Tom Evans  wrote:
> On Thu, Jun 2, 2011 at 12:44 PM, Gloria W  wrote:
> > I am experiencing this:
> >https://code.djangoproject.com/ticket/16136
> > and the only way I can prevent it is by using sqlite.
> > Does anyone have a patch for this, or more info?
> > Thank you in advance,
> > Gloria
>
> WFM, + everyone else. Reinstall django, I don't believe (looking at
> that ticket) that it is installed properly.
>
> Cheers
>
> Tom

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Circular import on every backend except sqlite

2011-06-02 Thread Gloria W
I am experiencing this:
https://code.djangoproject.com/ticket/16136
and the only way I can prevent it is by using sqlite.
Does anyone have a patch for this, or more info?
Thank you in advance,
Gloria

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Any SELECT returns no results via Django

2007-12-20 Thread Gloria W

More info on this: I am connecting to the db via an ssh tunnel. In the
settings-*.py files, I use
DATABASE_HOST = '127.0.0.1'
Works like a charm, except with the connection module. It is probably
not connecting.
Help!
Gloria

On Dec 19, 7:41 pm, Gloria W <[EMAIL PROTECTED]> wrote:
> I am boggled. A SELECT from the MySql command line works just fine.
> But within Django, it returns nothing. It doesn't matter what SQL
> statement I issue.
>
> Here is my syntax:
>
>  from django.db import connection
>   cursor = connection.cursor()
>   cursor.execute("use editorial_production_2007_12_14; SELECT
> category_id,message_id FROM categories_messages")
>
>  rows = cursor.fetchall()
>
> I'm stuck using Django 0.95 and Python 2.4 on an X86-64 Linux box.
>
> Has anyone else experienced this?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Any SELECT returns no results via Django

2007-12-19 Thread Gloria W

I am boggled. A SELECT from the MySql command line works just fine.
But within Django, it returns nothing. It doesn't matter what SQL
statement I issue.

Here is my syntax:


 from django.db import connection
  cursor = connection.cursor()
  cursor.execute("use editorial_production_2007_12_14; SELECT
category_id,message_id FROM categories_messages")

 rows = cursor.fetchall()

I'm stuck using Django 0.95 and Python 2.4 on an X86-64 Linux box.

Has anyone else experienced this?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Support for Federated MySql table?

2007-11-30 Thread Gloria W

Hi, I'm using Django 0.95 on Python2.4, and it seems that it doesn't
fully support federated tables in Mysql.

The problem I have is that the manage.py inspectdb dumps a table which
matches my sql table in construct, but no info about being federated.
So an objects.filter() on some of these fields is failing, although I
can see the fields when I iterate over the records.

Any help or pointers to good docs on Django's handling of federated
tables and foreign keys (for another problem I'm having) would be
greatly appreciated.

Thank you,
Gloria
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: KeyError, Submit Empty Field and Form Validation

2007-11-13 Thread Gloria W

This was an excellent response, and helped me immediately. Thank you.
~G~


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---