cit-jmu/rooibos — pull request #11 by hanleybrand (2012-07-06 19:13:46+00:00)
Title: Solr sub

I messed this up a tiny bit (I meant for it to be two separate requests) - but anyway:

For me and at least one other school, reverting rooibos/data/models.py to the previous version fixes the problem with errors running manage.py mdid2migrate -- the errors seem related to the or int(type) part of the latest version, but I'm not sure what's wrong:

```
content_type=object and OwnedWrapper.t(object.__class__)
or int(type))
```

The change to solr/__init__.py is weirder - I looked over the changes you had made to django that got removed with 1,2,3, final and wondered if I could make a change to the solr init since that was the only rooibos file being referenced in the tracebacks people were posting.

I was mucking around with different sledgehammer solutions, and on a hunch I changed record_ids to a separate explicitly named list where you converted to a simple list from the django list, a la:

record_id_list = list(record_ids)
media_dict = self._preload_related(Media, record_id_list)
fieldvalue_dict = self._preload_related(FieldValue, record_id_list, related=2)
groups_dict = self._preload_related(CollectionItem, record_id_list)
count += len(record_id_list)

... and suddenly I can get through a solr reindex without any mySQL [I can't do my work](http://www.youtube.com/watch?v=6SHRFhfeLgY) errors.

I'm not sure why that would be - I can't even say what led me to make the change, but it seems to have worked - is it possible that there's some eccentricity of python's execution order (i.e. it was giving process_data yhr record_id_list before list() was executing)? If so, that would be quite eccentric.

Anyway, submitted for your review - the [try: ... except: ... ] is probably unnecessary, since the exception is getting thrown somewhere else, probably in the specific thread.