Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
2672 มุมมอง

Hi all, 

I've created a model from gui, now I need to exted it and there are a lot of records, so I can't create it from py file from scratch, how can I solve the issue?


I've tryied to declare the model in py file but I'm not able to overryde what was created from gui. I've also tryied to inherit it, but the change are not updated.


Any help will be very appreciated.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I think instead of copy past table export-import  data will be way easy 

create a new model using py with the same field and type ( without x_ prefix)
Export CSV file from an existing model created using GUI
Import CSV file to new model create by .py


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hi, thanks for the response, is there not a more smart way to do it? If I define the model from code, can I switch the table is such a way?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

I will suggest you to do add new model from the code and copy the existing data in the current model to the new table. During the copy to new table, try to keep same id for the records.

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 20
5507
0
ต.ค. 18
2533
2
ส.ค. 21
6378
1
พ.ค. 19
3675
0
เม.ย. 18
2934