Have you tried this?
for border in country_instance.contries.all():
border.length = new_border
On 18 jun, 10:39, Peter Bulychev <[EMAIL PROTECTED]> wrote:
> Is it possible to insert additional row into table, which corresponds
> to ManyToManyField?
--~--~-~--~~~-
Couldn't this also be done via:
Country(models.Model)
name = Char()
borders = ManyToMany(CountryBorders)
CountryBorders(models.Model):
border = models.FK(Country)
length = models.PosIntField()
With this you could have:
Country:
name: Germany
borders: France/1000Km, Austria/400Km,B
You'll have to do something like this:
Country(models.Model):
name = models.CharField(max_length = 100)
boders = models.ManyToManyField('self')
Meta:
verbose_name_plural = "countries"
BorderLength(models.Model):
countryA = models.ForeignKey(Country)
countryB = models
Hello.
Is it possible to insert additional row into table, which corresponds
to ManyToManyField?
For instance, I have 'Countries' table, which possesses
ManyToManyField 'borders'. My goal is to store border length for
neighbor countries by inserting additional field 'length' into the
'borders' t
4 matches
Mail list logo