Revision 314bdec9

View differences:

crm/crm/urls.py
8 8
    # Examples:
9 9
    # url(r'^$', 'crm.views.home', name='home'),
10 10
    # url(r'^crm/', include('crm.foo.urls')),
11
    url(r'^roboauth/(?P<rfid_tag>\0x[0-9Aa-Ff]+)/(?P<mach_num>\d+)', 'crm.robocrm.roboauth'),
11 12

  
12 13
    # Uncomment the admin/doc line below to enable admin documentation:
13 14
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
crm/robocrm/views.py
1 1
# Create your views here.
2

  
3
def roboauth(request, rfid_tag, mach_number):
4
  r = robocrm.objects.filter(rfid=rfid_tag)
5
  auth_machines = r.machines.filter(id=mach_number)
6
  if auth_machines.count() > 0 :
7
    return HttpResponse("1")
8
  else
9
    return HttpResponse("0")
10

  

Also available in: Unified diff