Sunday, January 10, 2010

Re: Model Form crashing on Foreign Key

On Jan 10, 12:23 pm, Sontek <son...@gmail.com> wrote:
> So I'm trying to create a new feed within the Admin page and its
> crashing with the error  IntegrityError: lifestream_feed.lifestream_id
> may not be NULL, the call stack is... form['lifestream'] is set but
> form.instance.lifestream is not.  Here is the code:
>

Its not returning the empty returns, its reaching the return
self.cleaned_data:

-> return self.cleaned_data
(Pdb) list
85 self.cleaned_data['name'] = feed_info['title']
86 self.instance.name = self.cleaned_data['name']
87 self.cleaned_data['domain'] = get_url_domain(feed_url)
88 self.instance.domain = self.cleaned_data['domain']
89
90 -> return self.cleaned_data
91
92 class FeedAdmin(admin.ModelAdmin):
93 list_display = ('name', 'lifestream', 'domain',
'fetchable')
94 list_filter = ('domain', 'lifestream')
95 actions = ['make_fetchable', 'make_unfetchable']
(Pdb) self.cleaned_data
{'url': u'http://twitter.com/statuses/user_timeline/6166742.rss',
'domain': u'twitter.com', 'lifestream': <Lifestream: Social>, 'name':
u'Twitter / sontek', 'plugin_class_name':
u'lifestream.plugins.twitter.TwitterPlugin'}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate