This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TH><span class="add-new-practice">Add New Practice</span></TH> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def add_new_practice(request): | |
| if request.is_ajax and request.POST: | |
| protocol_id = request.POST.get('protocol_id') | |
| form = PracticeModelForm(request.POST) | |
| if form.is_valid(): | |
| practice_object = Practice(protocol=Protocol.objects.get(id=protocol_id)) | |
| form = PracticeModelForm(request.POST, instance=practice_object) | |
| form.save() | |
| return HttpResponse(json.dumps({})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def delete_practice(request): | |
| if request.is_ajax and request.POST: | |
| kb_practice_id = request.POST.get('kb_practice_id') | |
| Practice.objects.get(id=kb_practice_id).delete() | |
| return HttpResponse(json.dumps({}), content_type="application/json") | |
| else: | |
| raise Http404 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Email/gmail configuration | |
| # console.EmailBackend is to test the email on console in dev mode | |
| # comment next line to spit emails on console for testing (of course comment the line next to it) | |
| # EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend' | |
| # smtp.EmailBackend is for the production server | |
| EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend' | |
| EMAIL_HOST='smtp.gmail.com' | |
| EMAIL_PORT=587 | |
| EMAIL_HOST_USER='[email protected]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import plivo | |
| def send_sms_plivo(to, message): | |
| """ | |
| Send message via plivo service 0.0037 USD/sms; only outgoing | |
| :return: | |
| """ | |
| auth_id = "....." | |
| auth_token="..........." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .state('tab.referral-registration-form', { | |
| url: '/register/referral/form', | |
| views: { | |
| 'tab-dash': { | |
| templateUrl: 'templates/dash-referral-registration/dash-referral_form.html', | |
| controller: 'RegisterReferralFormCtrl' | |
| } | |
| } | |
| }) | |
| .state('tab.referral-registration-ack', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_resultfile_upload_destination(instance, filename): | |
| return "complaint/00_generic/farmerid_{farmerid}/{file}".format(farmerid=instance.farmer.id, file=filename) | |
| class Complaint(models.Model): | |
| farmer = models.ForeignKey(Farmer) | |
| file = models.FileField(blank=True, default='', upload_to=get_resultfile_upload_destination) | |
| text = models.TextField(blank=True, default='') | |
| timestamp = models.DateTimeField(auto_now=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Gyro(models.Model): | |
| device = models.ForeignKey(Device) | |
| ts = models.DateTimeField() | |
| x = models.DecimalField(max_digits=18, decimal_places=18) | |
| y = models.DecimalField(max_digits=18, decimal_places=18) | |
| z = models.DecimalField(max_digits=18, decimal_places=18) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends "base_instance.html" %} | |
| {% load i18n staticfiles %} | |
| {% load templatetag_generic %} | |
| {% block meta_title %}{% trans "Consultants" %}{% endblock %} | |
| {% block title %} | |
| {{ affiliation }} : | |
| Consultant(s) List | |
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* START setup tabs in side nav*/ | |
| .nav-tabs li.active > a, | |
| .nav-tabs li.active > a:hover, | |
| .nav-tabs li.active > a:focus { | |
| color: #555555; | |
| cursor: default; | |
| background-color: #ffffff; | |
| border: 1px solid #ffffff; | |
| border-bottom-color: transparent; |
OlderNewer