-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfak.py
50 lines (41 loc) · 1.28 KB
/
fak.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from mapp.models import *
from accounts.models import CustomUser
from django.utils.text import slugify
from faker import Faker
import names
import nepali_roman as nr
faker = Faker('hi_IN')
# faker.items()
# addr = faker.address()
# naddr = nr.romanize_text(addr)
# print(addr, naddr)
# a = Assignment.objects.get()
# for item in a:
# print(a)
f = Faker('hi_IN')
def accounts(num=5):
for _ in range(num):
city_name = nr.romanize_text(f.city_name())
street_name = nr.romanize_text(f.street_address())
postcode = f.postcode()
name = '{} {}'.format(nr.romanize_text(f.first_name()).capitalize(),
nr.romanize_text(f.last_name()).capitalize())
email = name.replace(' ', '_')+ '@gmail.com'
addr = '{}, {}-{}'.format(street_name, city_name, postcode)
phone_number = '+91'+str(f.random_number(10))
print(name, phone_number, email)
print(addr)
obj = CustomUser(
email=email,
password='123',
name=name,
mobile_number=phone_number,
job='NA',
address=addr,
)
obj.save()
# accounts(2)
for s in Service.objects.all():
# s.nameSlug = slugify(s.name) + str(uuid.uuid4())
# s.save()
print( s.nameSlug)