How to insert a string of characters into a text file using python?
<p>This is the text file I have .   </p>

<pre><code># This is an auto-generated Django model module created by ogrinspect.
from django.contrib.gis.db import models

class Parking(models.Model):
    name = models.CharField(max_length=80)
    descriptio = models.CharField(max_length=80)
    geom = models.PointField(srid=4326)
    objects = models.GeoManager()

# Auto-generated `LayerMapping` dictionary for Parking model
parking_mapping = {
    'name' : 'Name',
    'descriptio' : 'Descriptio',
    'geom' : 'POINT25D',
}
</code></pre>

<p>I want to insert <code>layer_id= models.ForeignKey('sdr_layer.id')</code> after  <code>class Parking(models.Model):</code>  using python script . Is it possible ? How to do it ?</p>
