Django

Code

Changeset 7422

Show
Ignore:
Timestamp:
04/14/08 20:13:52 (3 months ago)
Author:
mtredinnick
Message:

Fixed #7017 -- Minor typo fix in a comment. Thanks FranRuiz?.

Also promoted the comment to a docstring and removed some extra spaces.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/contenttypes/generic.py

    r7228 r7422  
    3636 
    3737    def instance_pre_init(self, signal, sender, args, kwargs): 
    38         # Handle initalizing an object with the generic FK instaed of 
    39         # content-type/object-id fields. 
     38        """ 
     39        Handles initializing an object with the generic FK instaed of 
     40        content-type/object-id fields. 
     41        """ 
    4042        if self.name in kwargs: 
    4143            value = kwargs.pop(self.name) 
     
    4446 
    4547    def get_content_type(self, obj=None, id=None): 
    46         # Convenience function using get_model avoids a circular import when using this model 
     48        # Convenience function using get_model avoids a circular import when 
     49        # using this model 
    4750        ContentType = get_model("contenttypes", "contenttype") 
    4851        if obj: 
     
    6265        except AttributeError: 
    6366            rel_obj = None 
    64              
     67 
    6568            # Make sure to use ContentType.objects.get_for_id() to ensure that 
    6669            # lookups are cached (see ticket #5570). This takes more code than 
    67             # the naive ``getattr(instance, self.ct_field)``, but has better  
     70            # the naive ``getattr(instance, self.ct_field)``, but has better 
    6871            # performance when dealing with GFKs in loops and such. 
    6972            f = self.model._meta.get_field(self.ct_field)