Caught an exception while rendering: 'Feature' object has no attribute 'serializable_value'

2009-01-30 Thread Thiago F. Crepaldi

Hello,

my site is almost ready, but i still getting some issues along the
way. To day i am testing the admin module and i found out some issues.
All models that use some foreign key presents a message like this:

TemplateSyntaxError at /ftrTool/admin/ftrTool/dependency/3/

Caught an exception while rendering: 'Feature' object has no attribute
'serializable_value'


The error raises at line 12, below:

2{% if fieldset.name %}{{ fieldset.name }}{% endif %}
3   {% if fieldset.description %}
{{ fieldset.description|safe }}{% endif %}
4   {% for line in fieldset %}
5   
6   {{ line.errors }}
7   {% for field in line %}
8   
9   {% if field.is_checkbox %}
10  {{ field.field }}{{ field.label_tag }}
11  {% else %}
12  {{ field.label_tag }}{{ field.field }}
13  {% endif %}
14  {% if field.field.field.help_text %}
{{ field.field.field.help_text|safe }}{% endif %}
15  
16  {% endfor %}
17  
18  {% endfor %}
19  
20

How do i get rid of this error ?

Att
Thiago.
--~--~-~--~~~---~--~~
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: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-29 Thread Thiago F. Crepaldi

Well,

i figured it out. As i said before, i upgraded from django 0.97 (svn)
to 1.0.2 stable, BUT i didn't rebooted my server. So, when i looked at
META INFORMATION in my browser, i saw that 0.97 version still being
used, instead of the new version. I rebooted it and everything is
normal again. =)

pretty weird, ham ?!

Thanks all
Thiago.

On Jan 29, 8:23 am, "Thiago F. Crepaldi"  wrote:
> Hello,
>
> in my templates pages, i do: {% load FtrToolTags %}
>
> in my FtrToolTags, i do: from webTool.ftrTool.models import Product
>
> i also use Product model on admin.py, forms.py, views.py and models.py
>
> Thanks,
> Thiago
>
> On Jan 28, 11:21 pm, Malcolm Tredinnick 
> wrote:
>
> > On Wed, 2009-01-28 at 16:15 -0800, Thiago F. Crepaldi wrote:
> > > in models.py all the code is ok.
>
> > What other files are using the Product model? In particular, how do you
> > import it into the module(s) that are using it in template tags.
> > Something in your code is not importing Product or importing it
> > incorrectly. Find that place.
>
> > > Is there any procedure to "register"
> > > Product ?
>
> > No. It only has to be imported.
>
> > Regards,
> > Malcolm
--~--~-~--~~~---~--~~
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: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-29 Thread Thiago F. Crepaldi

Hello,

in my templates pages, i do: {% load FtrToolTags %}

in my FtrToolTags, i do: from webTool.ftrTool.models import Product

i also use Product model on admin.py, forms.py, views.py and models.py

Thanks,
Thiago

On Jan 28, 11:21 pm, Malcolm Tredinnick 
wrote:
> On Wed, 2009-01-28 at 16:15 -0800, Thiago F. Crepaldi wrote:
> > in models.py all the code is ok.
>
> What other files are using the Product model? In particular, how do you
> import it into the module(s) that are using it in template tags.
> Something in your code is not importing Product or importing it
> incorrectly. Find that place.
>
> > Is there any procedure to "register"
> > Product ?
>
> No. It only has to be imported.
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
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: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-28 Thread Thiago F. Crepaldi

in models.py all the code is ok. Is there any procedure to "register"
Product ?

when i type "python" in my red hat console, nothings happens, so i
can't run "python manage.py syncdb" Would that be the reason Product
is not recognized ? it is the only new model inserted into the project

r...@server# python
r...@server#

It looks that int he same server there is python 2.3 and 2.5 but the
python command is a symlink to 2.5 version


thanks,
Thiago

On Jan 28, 3:11 pm, Karen Tracey  wrote:
> On Wed, Jan 28, 2009 at 12:03 PM, Thiago F. Crepaldi wrote:
>
>
>
>
>
> > Hello, a created a new model on a already working system in my
> > development computer. When i finished it, i exported those mysql data
> > data through phpmyadmin and imported to the production table. When i
> > deployed the new site, i got:
>
> > TemplateSyntaxError at
>
> > 'FtrToolTags' is not a valid tag library: Could not load template
> > library from django.templatetags.FtrToolTags, cannot import name
> > Product
>
> > Request Method:         GET
> > Request URL:    *
> > Exception Type:         TemplateSyntaxError
> > Exception Value:
>
> > 'FtrToolTags' is not a valid tag library: Could not load template
> > library from django.templatetags.FtrToolTags, cannot import name
> > Product
>
> > Exception Location:     /usr/local/lib/python2.5/site-packages/django/
> > template/defaulttags.py in load, line 857
> > Python Executable:      /usr/bin/python
> > Python Version:         2.5.2
>
> > Can anyone help me ?
>
> In trying to load your FtrToolTags library some code that attempts to
> import  "Product" was encountered, but Product is apparently not found or
> causes an error when it is imported.  You need to figure out what is wrong
> with Product and fix it.
>
> Karen
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-28 Thread Thiago F. Crepaldi

Hello, a created a new model on a already working system in my
development computer. When i finished it, i exported those mysql data
data through phpmyadmin and imported to the production table. When i
deployed the new site, i got:

TemplateSyntaxError at

'FtrToolTags' is not a valid tag library: Could not load template
library from django.templatetags.FtrToolTags, cannot import name
Product

Request Method: GET
Request URL:*
Exception Type: TemplateSyntaxError
Exception Value:

'FtrToolTags' is not a valid tag library: Could not load template
library from django.templatetags.FtrToolTags, cannot import name
Product

Exception Location: /usr/local/lib/python2.5/site-packages/django/
template/defaulttags.py in load, line 857
Python Executable:  /usr/bin/python
Python Version: 2.5.2

Can anyone help me ?
--~--~-~--~~~---~--~~
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: Caught an exception while rendering: 'Product' object has no attribute 'serializable_value'

2009-01-22 Thread Thiago F. Crepaldi

Traceback:
File "C:\PYTHON25\Lib\site-packages\django\core\handlers\base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\PYTHON25\Lib\site-packages\django\contrib\auth\decorators.py"
in __call__
  67. return self.view_func(request, *args, **kwargs)
File "D:\thiago\dados\eclipse_workspace\webTool\..\webTool\ftrTool
\views.py" in ftrDetails
  132.   { 'view':view, 'form': form,
'inlineFormsTable': inlineFormsTable, 'featurePk':featurePk},
File "C:\PYTHON25\Lib\site-packages\django\shortcuts\__init__.py" in
render_to_response
  18. return HttpResponse(loader.render_to_string(*args,
**kwargs), **httpresponse_kwargs)
File "C:\PYTHON25\Lib\site-packages\django\template\loader.py" in
render_to_string
  107. return t.render(context_instance)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  176. return self.nodelist.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  768. bits.append(self.render_node(node, context))
File "C:\PYTHON25\Lib\site-packages\django\template\debug.py" in
render_node
  71. result = node.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\loader_tags.py" in
render
  97. return compiled_parent.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  176. return self.nodelist.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  768. bits.append(self.render_node(node, context))
File "C:\PYTHON25\Lib\site-packages\django\template\debug.py" in
render_node
  71. result = node.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\loader_tags.py" in
render
  97. return compiled_parent.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  176. return self.nodelist.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  768. bits.append(self.render_node(node, context))
File "C:\PYTHON25\Lib\site-packages\django\template\debug.py" in
render_node
  71. result = node.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\loader_tags.py" in
render
  97. return compiled_parent.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  176. return self.nodelist.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  768. bits.append(self.render_node(node, context))
File "C:\PYTHON25\Lib\site-packages\django\template\debug.py" in
render_node
  71. result = node.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\loader_tags.py" in
render
  24. result = self.nodelist.render(context)
File "C:\PYTHON25\Lib\site-packages\django\template\__init__.py" in
render
  768. bits.append(self.render_node(node, context))
File "C:\PYTHON25\Lib\site-packages\django\template\debug.py" in
render_node
  81. raise wrapped

Exception Type: TemplateSyntaxError at ##
Exception Value: Caught an exception while rendering: 'Product' object
has no attribute 'serializable_value'

Original Traceback (most recent call last):
  File "C:\PYTHON25\Lib\site-packages\django\template\debug.py", line
71, in render_node
result = node.render(context)
  File "C:\PYTHON25\Lib\site-packages\django\template\defaulttags.py",
line 148, in render
nodelist.append(node.render(context))
  File "C:\PYTHON25\Lib\site-packages\django\template\debug.py", line
87, in render
output = force_unicode(self.filter_expression.resolve(context))
  File "C:\PYTHON25\Lib\site-packages\django\utils\encoding.py", line
49, in force_unicode
s = unicode(s)
  File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py", line
333, in __unicode__
return self.as_widget()
  File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py", line
365, in as_widget
return widget.render(name, data, attrs=attrs)
  File "C:\PYTHON25\Lib\site-packages\django\forms\widgets.py", line
360, in render
options = self.render_options(choices, [value])
  File "C:\PYTHON25\Lib\site-packages\django\forms\widgets.py", line
376, in render_options
for option_value, option_label in chain(self.choices, choices):
  File "C:\Python25\lib\site-packages\django\forms\models.py", line
636, in __iter__
yield self.choice(obj)
  File "C:\Python25\lib\site-packages\django\forms\models.py", line
640, in choice
key = obj.serializable_value(self.field.to_field_name)
AttributeError: 'Product' object has no attribute 'serializable_value'
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email 

Caught an exception while rendering: 'Product' object has no attribute 'serializable_value'

2009-01-22 Thread Thiago F. Crepaldi

Hello, i have a model called FEATURE, where a "PRODUCT" charfield(50)
existed. Yesterday I created a PRODUCT model and updated FEATURE model
to use that foreign key.

However, when a form to view the FEATURE data is called through a
template, an error on line 27 occurs:

Caught an exception while rendering: 'Product' object has no attribute
'serializable_value'


TEMPLATE

17   
18  
19  
20  Feature Details
21  
22  
23
24  
25  
26  
27  {% for field in form %}
28  {% if field.errors %}
29  {{ field.errors }}
30  {% endif %}
31  
32  {{ field.label_tag }}{% if field.field.required %}
*{% endif %}
33  {{ field }}
34  
35  {% if field.help_text %}
36  
{{ field.help_text }}
37  {% endif %}



PRODUCT MODEL

class Product(MyBaseModel):

name  = models.CharField("Product Name", max_length = 50)
release  = models.CharField("Release", max_length = 10)
date1  = models.DateField("Date1")
date2  = models.DateField("Date2")
date3  = models.DateField("Date3")
date4  = models.DateField("Date4")
def __unicode__(self):
return self.name

class Meta:
db_table = 'ProductTable'
verbose_name = "Product"
verbose_name_plural = "Products"


FEATURE MODEL

class Feature(MyBaseModel):
(...)
product  = models.ForeignKey(Product, verbose_name="Product")
(...)


def __unicode__(self):
return str(self.featureId)

class Meta:
db_table = 'FeatureTable'

verbose_name = "Feature"
verbose_name_plural = "Features"
unique_together = [("fId", "pf", "intC", "db", "product")]

Thanks,
Thiago

--~--~-~--~~~---~--~~
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: 'RelatedObject' object has no attribute 'unique'

2009-01-20 Thread Thiago F. Crepaldi

Hello Bruno,

Karen Tracey solved my issue and now i will be able to apply those
refactoring you suggested me.

Thanks for tips :-)

Att
Thiago

On Jan 19, 7:18 pm, bruno desthuilliers
 wrote:
> On 19 jan, 18:04, "Thiago F. Crepaldi"  wrote:
>
> Absolutely not an answer to your question, but...
>
> > below is the code required. I hope you can help me =)
>
> #*
>
> > #  searchFeature
>
> #*
>
> > def searchFeature(request, view = None):
> >     if request.method == 'POST':
> >         form = SearchFeatureForm(request.POST)
> >         if form.is_valid():
> >             # Perform the query
>
> >             ftrQuery = Feature.objects.all().order_by('featureId',
> > 'pk')
>
> Since your going to filter this out, starting by querying all is
> useless (thanks to querysets being lazy, it's at least _only_ useless.
>
> Remember that Django has Q objects for building complex queries, and
> that you can just collect Q objects in a list, then "or" or (like in
> this case) "and" them together in just one pass.
>
>
>
> >             # Remove empty fields and start filtering
> >             if request.POST.__getitem__('featureId') != "":
>
> First point : you should never directly access __magic_methods__ in
> Python - they are here as implementation for operators. In this case,
> you want:
>
>                if request.POST.get('featureId', '') != '':
>
> Second point: since empty strings eval to false in a boolean context,
> you don't have to explicitely compare them with the empty string. IOW:
>
>               if request.POST.get('featureId, ''):
>
> >                 ftrQuery = ftrQuery.filter(featureId__contains =
> > request.POST.__getitem__('featureId')).distinct()
>
> Third point : you're doing the same access twice. Better to do it just
> once:
>
>             featureId = request.POST.get('featureId, '')
>             if featureId:
>                  # code here
>
> While we're at it, attribute lookup is a somewhat costly operation in
> Python, specially when the attribute resolves to a method. So if
> you're going to heavily use the same method of the same object, it's
> better to alias it to a local name:
>
>          get_from_post = request.POST.get
>
>          featureId = get_from_post('featureId, '')
>          if featureId:
>                  # code here
>
> While we're at it : your form object is supposed to give you access to
> the validated (and possibly converted) data extracted from the
> request. Is there any reason to not use this feature ?
>
> Next point : you can pass dict objects to Queryset.filter(), (or to Q
> objects) using the ** notation (cf the section of the official Python
> tutorial about functions and named / keyword arguments). So you could
> greatly simplify you code:
>
> filters = [
>    # fieldname, lookup
>    ("featureId", "featureId__contains"),
>    ("name", "name__icontains")
>    ("pf", "platform"),
>    ("state", "state"),
>    ("db", "drumbeat__pk"),
>    # etc
>    ]
>
> queries = []
> add_q = queries.append
> for fieldname, lookup in filters:
>     value = get_from_post(fieldname, '')
>     if value:
>         add_q(Q(**{lookup:value}))
>
> # now "and" the Q objects:
> filters = reduce(lambda q1, q1 : q1 & q2, filters)
>
> # and do the query:
> if filters:
>     queryset = Feature.objects.filter(filters)
> else:
>     queryset = Feature.objects.all()
>
> queryset = queryset.order_by('featureId', 'pk')
>
> This can not apply to all your query construction (there are some
> complex cases in it), but it should already help uncluttering it for
> all the simple cases.
>
> (snip)
>
> >             from datetime import date
>
> Better to put import statements at the module's top-level.
>
> >             #Only way I could find to select with COUNT without
> > writting the SQL code.
>
> You might have a look at the example snippet for the 'extra' method of
> querysets.
>
> >             if que

Re: 'RelatedObject' object has no attribute 'unique'

2009-01-20 Thread Thiago F. Crepaldi

Hello Karen,

First of all, I really would like to thank you for helping me solve
this issue. Your fix (downloaded from 
http://code.djangoproject.com/changeset/9778?format=zip&new=9778)
was perfect and my form is working again, but now with a final release
(1.0.2) instead of a development one (svn 0.97)

I am happy django community have smart and helpful developers to make
this framework better everyday

Att
Thiago

On Jan 19, 5:45 pm, "Karen Tracey"  wrote:
> On Mon, Jan 19, 2009 at 1:54 PM, Karen Tracey  wrote:
> > On Mon, Jan 19, 2009 at 12:04 PM, Thiago F. Crepaldi 
> > wrote:
>
> >> hello Karen,
>
> >> below is the code required. I hope you can help me =)
>
> > In the future, please post code of that length/width to someplace like
> > dpaste.com; email makes it quite hard to read given how it gets wrapped.
>
> > I think what is happening is you have added a field to your model form that
> > has a name that matches a related object accessor for the model (that is,
> > you have added a field with a name that matches that of a model that has a
> > ForeignKey that points to your Feature model).  I've recreated the error
> > with a much simpler model form based on the tutorial's Poll model:
>
> >http://code.djangoproject.com/ticket/10069
>
> > I thought the fix was easy but a quick run of Django's model_forms test
> > shows that the quick fix I was thinking of breaks something else, and I'm
> > running out of time to look at this today, so it may be a little while
> > before a fix goes in.  In the meantime if you can identify the additional
> > field(s) that may be causing the problem in your form, renaming them to
> > something that doesn't exactly match the related model name(s) should work
> > as a temporary workaround.
>
> Actually the fix was simple,  I just didn't spell it properly first time
> around.   Fix is now in trunk and current 1.0.X branch so if you update to
> one of those levels I think the problem will go away.
>
> Karen
--~--~-~--~~~---~--~~
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: 'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Thiago F. Crepaldi
d(label="Estimator", required =
False)
teamSizeLow  = forms.IntegerField(label="Team Size", required
= False, widget=forms.TextInput(attrs={'size':'3'}))
teamSizeHigh = forms.IntegerField(label="Team Size", required
= False, widget=forms.TextInput(attrs={'size':'3'}))
#**ftrStartYear     = forms.IntegerField(label="Year", required =
False, max_value=2100, min_value=2000, widget=forms.TextInput(attrs=
{'size':'5', 'maxlength':'4'}))
#**ftrStartMonth= forms.IntegerField(label="Month", required =
False, max_value=12, min_value=1, widget=forms.TextInput(attrs=
{'size':'2', 'maxlength':'2'}))
ftrStartYear = forms.IntegerField(label="Year", required =
False, max_value=2100, min_value=2000, widget=forms.TextInput(attrs=
{'size':'5', 'max_length':'4'}))
ftrStartMonth= forms.IntegerField(label="Month", required =
False, max_value=12, min_value=1, widget=forms.TextInput(attrs=
{'size':'2', 'max_length':'2'}))
numDepsLow   = forms.IntegerField(label="Number of
Dependencies", required = False, widget=forms.TextInput(attrs=
{'size':'3'}))
numDepsHigh  = forms.IntegerField(label="Number of
Dependencies", required = False, widget=forms.TextInput(attrs=
{'size':'3'}))
dependency   = forms.CharField(label = "Dependency", required
= False, widget=forms.TextInput(attrs={'size':'25'}))

class Meta:
model = Feature
exclude = ('date','description', 'wikiLink')

On Jan 19, 12:37 pm, "Karen Tracey"  wrote:
> On Mon, Jan 19, 2009 at 7:50 AM, Thiago F. Crepaldi wrote:
>
>
>
> > Hello,
>
> > I am migrating a system from django 0.97 (svn) to 1.0.2 (stable) and I
> > got the following error when a [database] SEARCH FORM is submitted :
> > 'RelatedObject' object has no attribute 'unique'
>
> > I recreated all tables through 'python manage.db syncdb' command and
> > imported all the old data back again.
>
> Just FYI, this is not necessary to migrate from .9x to 1.0.2.  Tables from
> .9x installations work perfectly well with 1.0.x.
>
>
>
> > It looks like that all unique indexes declared were created correctly
> > on the MySQL database.
>
> > In fact, I didn't even understand what this error means. Can someone
> > help me out ?
>
> It would be easier to help if you shared the code you have in your
> ftrTool\views.py searchFeature function, as well as the form definition you
> are using.  All I can say from the traceback below is that the unique
> validation code is finding it's got a RelatedObject object where it is
> expecting to have something else.  Whether that is a bug in your code or in
> the unique validation code is hard to say without seeing your code.
>
> Karen
>
>
>
> > I already read
> >http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide/
> > and
> >http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
> > and, unfortunately, had no luck =/
>
> > Environment:
>
> > Request Method: POST
> > Request URL:http://localhost:8000/ftrTool/searchFeature/
> > Django Version: 1.0.2 final
> > Python Version: 2.5.2
> > Installed Applications:
> > ['django.contrib.auth',
> > 'django.contrib.contenttypes',
> > 'django.contrib.sessions',
> > 'django.contrib.admin',
> > 'webTool.ftrTool']
> > Installed Middleware:
> > ('django.middleware.common.CommonMiddleware',
> > 'django.contrib.sessions.middleware.SessionMiddleware',
> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
> > 'django.middleware.doc.XViewMiddleware')
>
> > Traceback:
> > File "C:\PYTHON25\Lib\site-packages\django\core\handlers\base.py" in
> > get_response
> >  86. response = callback(request, *callback_args,
> > **callback_kwargs)
> > File "D:\thiago\dados\eclipse_workspace\webTool\..\webTool\ftrTool
> > \views.py" in searchFeature
> >  474. if form.is_valid():
> > File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in is_valid
> >  120. return self.is_bound and not bool(self.errors)
> > File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in
> > _get_errors
> >  111. self.full_clean()
> > File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in
> > full_clean
> >  241. self.cleaned_data = self.clean()
> > File "C:\PYTHON25\Lib\site-packages\django\forms\models.py" in clean
> >  223. self.validate_unique()
> > File "C:\PYTHON25\Lib\site-packages\django\forms\models.py" in
> > validate_unique
> >  251. if f.unique and self.cleaned_data.get(name) is not
> > None:
>
> > Exception Type: AttributeError at /ftrTool/searchFeature/
> > Exception Value: 'RelatedObject' object has no attribute 'unique'
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Thiago F. Crepaldi
Hello,

I am migrating a system from django 0.97 (svn) to 1.0.2 (stable) and I got
the following error when a [database] SEARCH FORM is submitted :
'RelatedObject' object has no attribute 'unique'

I recreated all tables through 'python manage.db syncdb' command and
imported all the old data back again.

It looks like that all unique indexes declared were created correctly on the
MySQL database.

In fact, I didn't even understand what this error means. Can someone help me
out ?

I already read
http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide/ and
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
and, unfortunately, had no luck =/


Environment:

Request Method: POST
Request URL: http://localhost:8000/ftrTool/searchFeature/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'webTool.ftrTool']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware')


Traceback:
File "C:\PYTHON25\Lib\site-packages\django\core\handlers\base.py" in
get_response
 86. response = callback(request, *callback_args,
**callback_kwargs)
File "D:\thiago\dados\eclipse_workspace\webTool\..\webTool\ftrTool\views.py"
in searchFeature
 474. if form.is_valid():
File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in is_valid
 120. return self.is_bound and not bool(self.errors)
File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in _get_errors
 111. self.full_clean()
File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in full_clean
 241. self.cleaned_data = self.clean()
File "C:\PYTHON25\Lib\site-packages\django\forms\models.py" in clean
 223. self.validate_unique()
File "C:\PYTHON25\Lib\site-packages\django\forms\models.py" in
validate_unique
 251. if f.unique and self.cleaned_data.get(name) is not None:

Exception Type: AttributeError at /ftrTool/searchFeature/
Exception Value: 'RelatedObject' object has no attribute 'unique'


--
Thiago

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



'RelatedObject' object has no attribute 'unique'

2009-01-19 Thread Thiago F. Crepaldi

Hello,

I am migrating a system from django 0.97 (svn) to 1.0.2 (stable) and I
got the following error when a [database] SEARCH FORM is submitted :
'RelatedObject' object has no attribute 'unique'

I recreated all tables through 'python manage.db syncdb' command and
imported all the old data back again.

It looks like that all unique indexes declared were created correctly
on the MySQL database.

In fact, I didn't even understand what this error means. Can someone
help me out ?

I already read
http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide/
and
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges
and, unfortunately, had no luck =/


Environment:

Request Method: POST
Request URL: http://localhost:8000/ftrTool/searchFeature/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'webTool.ftrTool']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware')


Traceback:
File "C:\PYTHON25\Lib\site-packages\django\core\handlers\base.py" in
get_response
 86. response = callback(request, *callback_args,
**callback_kwargs)
File "D:\thiago\dados\eclipse_workspace\webTool\..\webTool\ftrTool
\views.py" in searchFeature
 474. if form.is_valid():
File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in is_valid
 120. return self.is_bound and not bool(self.errors)
File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in
_get_errors
 111. self.full_clean()
File "C:\PYTHON25\Lib\site-packages\django\forms\forms.py" in
full_clean
 241. self.cleaned_data = self.clean()
File "C:\PYTHON25\Lib\site-packages\django\forms\models.py" in clean
 223. self.validate_unique()
File "C:\PYTHON25\Lib\site-packages\django\forms\models.py" in
validate_unique
 251. if f.unique and self.cleaned_data.get(name) is not
None:

Exception Type: AttributeError at /ftrTool/searchFeature/
Exception Value: 'RelatedObject' object has no attribute 'unique'


--
Thiago

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---