SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def pendaftaran(request):
  2.     if request.method == 'POST':
  3.         form = DaftarTKForm(request.POST)
  4.         if form.is_valid():
  5.             siswatk = form.save()
  6.             siswatk.nama_pendaftar = request.POST['nama_pendaftar']
  7.             siswatk.nama = request.POST ['nama']
  8.             siswatk.nama_badge = request.POST['nama_badge']
  9.             siswatk.tempat_lahir = request.POST['tempat_lahir']
  10.             siswatk.tgl_lahir = request.POST['tgl_lahir']
  11.             siswatk.hp = request.POST['hp']
  12.             siswatk.alamat = request.POST['alamat']
  13.             siswatk.is_active=False
  14.             siswatk.save()
  15.             user = siswatk.user
  16.             # if siswatk.jenis_kelamin == 'l':
  17.             #     siswatk.no_ppdb == str(siswatk.user.id + 11000)
  18.             # else:
  19.             #     # siswatk.jenis_kelamin == 'p':
  20.             #     siswatk.no_ppdb == siswatk.user.id + 12000
  21.             # return siswatk.no_ppdb
  22.             # siswatk.no_ppdb = siswatk.user.id + 1000
  23.             siswatk.no_unik = str(siswatk.user.id)
  24.             siswatk.user.is_tkit = True
  25.             siswatk.save()
  26.             user = siswatk.user
  27.             siswatk.save(update_fields=['no_ppdb', 'no_unik'])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top