Q:

Django - kwargs aren't passed

I am writing an app in Django meant to check XML for errors. It parses each line in the XML file, creates an object (from a class called XMLElement) corresponding to that line, checks the line for errors, generates a string detailing the error, then appends it to a list. Here is a code snippet of what it does:
try:
        self.string_list = kwargs['tag_string'].replace("<", "").replace(">", "").split()
        print self.string_list
        self.element_name = self.string_list[0]
    except (ValueError, IndexError) as e:
        self.errors.append("XMLElement {0} contains an error:{1}".format(self.element_name, str(e)))

Then, after it is done parsing the file, the model class that the functions are called from joins all the errors into one string, then creates an object with that string as a keyworded argument.
    print '\n'.join(obj.errors)
    err_obj = Errors(errors='\n'.join(obj.errors))

class Errors(models.Model):
    errors = models.TextField()

Whenever I print the error list from the XMLElement instance, the error is printed properly. However, when I try to print the error from the error class using Errors.objects.all()[n].errors from the django shell, it returns an empty unicode string. Not only that, but instead of saving one error object, it saves multiple, anywhere between 3 and 5. What part of my code could be causing this? 
Gist link to the entire file

A:

I was finally able to fix this problem. By doing two things:
The first thing I did was changed the superclass of the XMLElement class from models.Model to object. That fixed the majority of my problem. However, it didn't help fix a problem where multiple objects would be created by the __init__ function of my UserFile class. I solved this by moving the creation of the Errors objects from UserFile.__init__ to a function called check in views.py

