Re: [Django] #14387: pre_save problem with inherrited model

2010-12-29 Thread Django
#14387: pre_save problem with inherrited model
--+-
  Reporter:  iskren   | Owner:  
   
Status:  closed   | Milestone:  
   
 Component:  ORM aggregation  |   Version:  1.2 
   
Resolution:  invalid  |  Keywords:  pre_save inheritance 
inherited save
 Stage:  Unreviewed   | Has_patch:  0   
   
Needs_docs:  0|   Needs_tests:  0   
   
Needs_better_patch:  0|  
--+-
Changes (by russellm):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 A DoesNotExist exception is raised because you're trying to iterate over
 the obtain and iterate over a list of objects related to an object that
 has not yet been saved.

 If you need more details, please ask on django-users.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14387: pre_save problem with inherrited model

2010-10-05 Thread Django
#14387: pre_save problem with inherrited model
--+-
  Reporter:  iskren   | Owner:  
   
Status:  new  | Milestone:  
   
 Component:  ORM aggregation  |   Version:  1.2 
   
Resolution:   |  Keywords:  pre_save inheritance 
inherited save
 Stage:  Unreviewed   | Has_patch:  0   
   
Needs_docs:  0|   Needs_tests:  0   
   
Needs_better_patch:  0|  
--+-
Changes (by iskren):

  * owner:  iskren =>
  * status:  assigned => new

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14387: pre_save problem with inherrited model

2010-10-04 Thread Django
#14387: pre_save problem with inherrited model
--+-
  Reporter:  iskren   | Owner:  iskren  
   
Status:  assigned | Milestone:  
   
 Component:  ORM aggregation  |   Version:  1.2 
   
Resolution:   |  Keywords:  pre_save inheritance 
inherited save
 Stage:  Unreviewed   | Has_patch:  0   
   
Needs_docs:  0|   Needs_tests:  0   
   
Needs_better_patch:  0|  
--+-
Changes (by iskren):

  * owner:  => iskren
  * status:  new => assigned

Comment:

 The solution I used was to check if the primary key of the instance is
 None and if so skip the code that breaks.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14387: pre_save problem with inherrited model

2010-10-04 Thread Django
#14387: pre_save problem with inherrited model
--+-
  Reporter:  iskren   | Owner:  
   
Status:  new  | Milestone:  
   
 Component:  ORM aggregation  |   Version:  1.2 
   
Resolution:   |  Keywords:  pre_save inheritance 
inherited save
 Stage:  Unreviewed   | Has_patch:  0   
   
Needs_docs:  0|   Needs_tests:  0   
   
Needs_better_patch:  0|  
--+-
Comment (by iskren):

 After creating an empty instance of the Child Class and trying to save it,
 django DoesNotExist exception;
 when the inheritance is removed test works fine. Also if I remove the
 pre_save it works fine, but the wanted result is not achieved.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #14387: pre_save problem with inherrited model

2010-10-04 Thread Django
#14387: pre_save problem with inherrited model
---+
   Reporter:  iskren   |Owner:  
  
 Status:  new  |Milestone:  
  
  Component:  ORM aggregation  |  Version:  1.2 
  
   Keywords:  pre_save inheritance inherited save  |Stage:  
Unreviewed
  Has_patch:  0|   Needs_docs:  0   
  
Needs_tests:  0|   Needs_better_patch:  0   
  
---+
 Hello.

 I have a base-class and a child-class. The child-class has a pre_save
 signal and it has a list of related items to it.
 when testing for save action django raises DoesNotExist exception.
 Traceback follows:

 Thank you for the time spent on the Django project

  File "../children_pre_save_problem/test_b/tests.py", line 9, in
 test1_inc_num
 invo.save()
   File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line 410,
 in save
 self.save_base(force_insert=force_insert, force_update=force_update)
   File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line 432,
 in save_base
 signals.pre_save.send(sender=origin, instance=self, raw=raw)
   File "/usr/lib/pymodules/python2.6/django/dispatch/dispatcher.py", line
 166, in send
 response = receiver(signal=self, sender=sender, **named)
   File
 "/home/iskren/tc/python/children_pre_save_problem/test_b/models.py", line
 30, in invoicedoc_pre_save
 instance.recalc_total()
   File
 "/home/iskren/tc/python/children_pre_save_problem/test_b/models.py", line
 19, in recalc_total
 for item in self.item_set.all():
   File "/usr/lib/pymodules/python2.6/django/db/models/fields/related.py",
 line 324, in __get__
 self.related.model._default_manager.__class__)
   File "/usr/lib/pymodules/python2.6/django/db/models/fields/related.py",
 line 399, in create_manager
 getattr(instance, attname)}
   File "/usr/lib/pymodules/python2.6/django/db/models/fields/related.py",
 line 244, in __get__
 raise self.field.rel.to.DoesNotExist

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.