Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- urlpatterns = [
- url(r'^admin/', admin.site.urls),
- url(r'^batches/', include('batches.urls')),
- url(r'^screenings/', include('screenings.urls')),
- url(r'^individuals/', include('batches.urls')),
- url(r'^businessnames', include('batches.urls')),
- ]
- from __future__ import unicode_literals
- from .models import BusinessName
- from .models import Individuals
- from .models import Batches
- from django.shortcuts import render
- from django.http import HttpResponse
- # Create your views here.
- def index(request):
- all_Batches = Batches.objects.all()
- html = ''
- for batch in all_Batches:
- url = '/batches/' + str(batch.id) + '/'
- html += '<a href="#"' + url + '">' + str(batch.FileName)+ '</a><br>'
- return HttpResponse(html)
- def detail(request, batches_id): #parametrul asta batches_id tr sa se gaseasca in urls.py din app
- return HttpResponse("<h2>Details for Batches ID:" + str(batches_id) + "</h2")
- def index_businessname(request):
- all_BusinessNames = BusinessName.objects.all()
- html1 = ''
- for bn in all_BusinessNames:
- url = '/businessnames/' + str(bn.id) + '/'
- html1 += '<a href="#"' + url + '">' + bn.FullName + '</a><br>'
- return HttpResponse(html1)
- def detail_businessname(request, businessname_id):
- return HttpResponse("<h2>Details for Business Names ID:" + str(businessname_id) + "</h2")
- def index_individual(request):
- all_individuals = Individuals.objects.all()
- html2 = ''
- for i in all_individuals:
- url = '/individuals/' + i.id + '/'
- html2 += '<a href="#"' + url + '">' + i.FullName + '</a><br>'
- return HttpResponse(html2)
- def detail_individual(request, individuals_id):
- return HttpResponse("<h2>Details for Individual Names ID:" + str(individuals_id)+ "</h2")
- urlpatterns = [
- # /batches/
- url(r'^$', views.index, name='index'),
- # /batches/2
- url(r'^(?P<batches_id>[0-9]+)/$',views.detail, name="detail"),
- # businessname/1
- url(r'^$',views.index_businessname, name="index_businessname"),
- # businessname/1
- url(r'^(?P<businessname_id>[0-9]+)/$', views.detail_businessname, name="detail_businessname"),
- # individuals/1
- url(r'^$', views.index_individual, name="index_individuals"),
- # individuals/1
- url(r'^(?P<individuals_id>[0-9]+)/$', views.detail_individual, name="detail_individual"),
- ]
- class Batches(models.Model):
- BatchNumber = models.IntegerField(null=True)
- FileName= models.CharField(max_length=250)
- UploadedDate= models.DateField(max_length=250)
- UploadedBy = models.CharField(max_length=250)
- NumberOfRows= models.IntegerField(null=True)
- Hits= models.IntegerField(null=True)
- Status= models.CharField(max_length=250)
- class Meta:
- verbose_name_plural = "Batches"
- def __str__(self):
- return self.FileName + '- ' + str(self.Hits) + '- ' + str(self.NumberOfRows) + '- ' + self.Status
- class BusinessName(models.Model):
- AccountingCode = models.CharField(max_length=50)
- RefID = models.CharField(max_length=50, default="")
- FullName = models.CharField(max_length=250)
- Aliases = models.CharField(max_length=250)
- Address = models.CharField(max_length=500)
- City= models.CharField(max_length=50)
- ZipCode= models.IntegerField(null=True)
- State = models.CharField(max_length=250)
- Country= models.CharField(max_length=250)
- TypeOfSanction= models.CharField(max_length=250)
- Monitoring= models.CharField(max_length=50)
- BatchNumber= models.IntegerField(null=True) # tr pus automat
- FileName= models.CharField(max_length=250) # tr pus automat1
- UploadDate = models.DateField(max_length=250) # tr pus automat
- UploadBy= models.CharField(max_length=250) # tr pus automat
- Decision= models.CharField(max_length=250) # tr pus Ulterior
- Status= models.CharField(max_length=250) # tr pus automat
- EngineDecision= models.CharField(max_length=250) # tr pus automat
- WhoAdjudicated= models.CharField(max_length=250)
- DateOfAdjudication= models.CharField(max_length=250)
- SdnType = models.CharField(max_length=250) #Entity or Individual
- class Meta:
- verbose_name_plural = "Business Names"
- def __str__(self):
- return self.FullName + '-' + self.Address + '-' + self.City + '-' + '-' + self.State + '-' + self.Country
- class Individuals(models.Model):
- AccountingCode = models.CharField(max_length=50)
- RefID = models.IntegerField(null=True)
- FullName = models.CharField(max_length=250)
- FirstName= models.CharField(max_length=250)
- Lastname= models.CharField(max_length=250)
- DayOfBirth = models.IntegerField(null=True)
- MonthOfBirth = models.IntegerField(null=True)
- YearOfBirth= models.IntegerField(null=True)
- FullDOB = models.DateField(max_length=250)
- Aliases = models.CharField(max_length=250)
- Address = models.CharField(max_length=500)
- City= models.CharField(max_length=50)
- ZipCode= models.IntegerField(null=True)
- State = models.CharField(max_length=250)
- Country= models.CharField(max_length=250)
- TypeOfSanction= models.CharField(max_length=250)
- Monitoring= models.CharField(max_length=50)
- BatchNumber= models.IntegerField(null=True) # tr pus automat
- FileName= models.CharField(max_length=250) # tr pus automat
- UploadDate= models.DateField(max_length=250) # tr pus automat
- UploadBy= models.CharField(max_length=250) # tr pus automat
- Decision= models.CharField(max_length=250) # tr pus Ulterior
- Status= models.CharField(max_length=250) # tr pus automat
- EngineDecision= models.CharField(max_length=250) # tr pus automat
- WhoAdjudicated= models.CharField(max_length=250)
- DateOfAdjudication= models.CharField(max_length=250)
- More= models.CharField(max_length=250)
- SdnType = models.CharField(max_length=250) #Entity or Individual
- class Meta:
- verbose_name_plural = "Individuals"
- def __str__(self):
- return self.FullName + '-' + self.Address + '-' + self.City + '-' + '-' + self.State + '-' + self.Country
- url(r'^', include('batches.urls')),
- urlpatterns = [
- url(r'^batches/$', views.index, name='index'),
- url(r'^batches/(?P<batches_id>[0-9]+)/$',views.detail, name="detail"),
- url(r'^businessname/$',views.index_businessname, name="index_businessname"),
- url(r'^businessname/(?P<businessname_id>[0-9]+)/$', views.detail_businessname, name="detail_businessname"),
- url(r'^individuals/$', views.index_individual, name="index_individuals"),
- url(r'^individuals/(?P<individuals_id>[0-9]+)/$', views.detail_individual, name="detail_individual"),
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement