Hi guys 
I have some code in a clean() method that works ok on Django 1.77 but stops 
working in 1.8 

The scenario 

class Span(models.Model): 

    happening = models.ForeignKey('Happening', blank = True, null = True) 
    soul_class = models.ForeignKey('SoulClass', blank = True, null = True) 


In the clean() method of the Span class I have a check as follows 
    if self.happening: 
        foo 

    if self.soul_class: 
        bar 

This was working fine in Django up to 1.77 but when I upgrade to Django 1.8 
both self.happening **and** self.soul_class are None. 

The primary difference appears to be the value of _soul_class_cache as 
follows..... 

The Span object in 1.77 looks like 
{'end_date': None, 'id': None, '_state': <django.db.models.base.ModelState 
object at 0x7ff046ac1320>, 'start_date': datetime.date(2015, 4, 16), 
'soul_class_id': None, 'end_time': datetime.time(14, 12), 'happening_id': 
None, '_happening_cache': None, 'start_time': datetime.time(14, 12), 
'_soul_class_cache': <SoulClass: Chi Kung>} 

In 1.8 
{'start_time': datetime.time(14, 0), 'end_date': None, 'soul_class_id': 
None, '_state': <django.db.models.base.ModelState object at 
0x7f88d698d2e8>, 'happening_id': None, '_happening_cache': None, 
'_soul_class_cache': None, 'end_time': datetime.time(15, 0), 'id': None, 
'start_date': datetime.date(2015, 4, 16)} 

Any ideas? 
Cheers 
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/602df646-9328-496d-b35b-1a0e2c5aaaee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to