Changed the format to get input
This commit is contained in:
parent
70711888ea
commit
1da13d787f
|
@ -17,17 +17,24 @@ def run(*args):
|
||||||
if args[0] in ("manual", "man") :
|
if args[0] in ("manual", "man") :
|
||||||
if not args:
|
if not args:
|
||||||
raise ValueError("Invalid number of arguments passed")
|
raise ValueError("Invalid number of arguments passed")
|
||||||
|
|
||||||
|
print("id\troll_no\tname\tbranch\tphone_number\tcpi\tdegree\tbatch")
|
||||||
for i in range(1, int(args[1])+1):
|
for i in range(1, int(args[1])+1):
|
||||||
|
details = input()
|
||||||
|
details = details.split(",")
|
||||||
|
details = [i.strip() for i in details]
|
||||||
|
details = [int(details[0]), int(details[1]), details[2], details[3],
|
||||||
|
int(details[4]), float(details[5]), details[6], details[7]]
|
||||||
|
|
||||||
student = Student.objects.create(
|
student = Student.objects.create(
|
||||||
id = input("Enter id: "),
|
id = details[0],
|
||||||
roll_no = input("Enter roll_no: "),
|
roll_no = details[1],
|
||||||
name = input("Enter name: "),
|
name = details[2],
|
||||||
branch = input("Enter branch: "),
|
branch = details[3],
|
||||||
phone_number = input("Enter phone_number: "),
|
phone_number = details[4],
|
||||||
cpi = input("Enter cpi: "),
|
cpi = details[5],
|
||||||
degree = input("Enter degree: "),
|
degree = details[6],
|
||||||
batch = input("Enter batch: ")
|
batch = details[7],
|
||||||
|
|
||||||
)
|
)
|
||||||
student.save()
|
student.save()
|
||||||
|
|
Loading…
Reference in New Issue