Hello. This is a question for Jango model.
class EnActress(models.Model):
name = models.CharField(max_length=100, null=True)
After modifying the data in the name field in the above model (data in the name field exists)
class EnActress(models.Model):
name = models.CharField(max_length=100, null=True)
name_modify = models.CharField(max_length=100, null=True)
You want the name_modify field to have the modified data of the name field added as shown in . I want the data order to be the same as the name field, so which method should I use??
django python
I think we can run the following code on the long shell.
Instead of +"hello"
, you can process actress.name and put it in name_modify.
for actress in EnActress.objects.all():
actress.name_modify = actress.name + "hello"
actress.save
If you're not familiar with shell, see This lecture.
© 2024 OneMinuteCode. All rights reserved.