Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
mysql-python installation error
I am setting up django rest project with mysql. I installed all my dependencies including mysql-python: Django==1.11.12 djangorestframework==3.8.2 django-cors-headers==2.2.0 drfdocs==0.0.11 mysql-python==1.2.5 django-rest-auth==0.9.3 django-allauth==0.35.0 nltk==3.2.5 django-extensions==2.0.7 pyparsing==2.2.0 pydot==1.2.4 I needed few tweaks as discussed here Mac pip install mysql-python unsuccessful Now when I try to run python manage.py migrate I get following error: (VB_env) shannon:VB_Backend_SCG nitishpatkar$ python manage.py migrate Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute django.setup() File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module> from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 52, in <module> class AbstractBaseUser(models.Model): File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/db/models/base.py", line 124, in __new__ new_class.add_to_class('_meta', Options(meta, app_label)) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/db/models/base.py", line 325, in add_to_class value.contribute_to_class(cls, name) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/db/models/options.py", line 214, in contribute_to_class self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/db/__init__.py", line 33, in __getattr__ return getattr(connections[DEFAULT_DB_ALIAS], item) File "/Users/nitishpatkar/Development/Vision Backlog rewrite/VB_env/lib/python2.7/site-packages/django/db/utils.py", line 211, in __getitem__ backend … -
While building project in circleci 2.0 getting apturl==0.5.2 missing error
I have integrated my github project with circleci 2.0. but when i run build from circleci dashboard, i am getting this error. Could not find a version that satisfies the requirement apturl==0.5.2 (from -r requirements.txt (line 1)) (from versions: ) No matching distribution found for apturl==0.5.2 (from -r requirements.txt (line 1)) Here is my config.yml # Python CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-python/ for more details # version: 2 jobs: build: docker: # specify the version you desire here # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - image: circleci/python:3.6.1 # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ # - image: circleci/postgres:9.4 working_directory: ~/Amazon_customers steps: - checkout # Download and cache dependencies - restore_cache: keys: - v1-dependencies-{{ checksum "requirements.txt" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: install dependencies command: | pipenv install - save_cache: paths: - ./venv key: v1-dependencies-{{ checksum "requirements.txt" }} # run tests! # this example uses Django's built-in test-runner # other common Python testing frameworks include pytest and nose # https://pytest.org # https://nose.readthedocs.io - run: name: run tests command: | . … -
how to set path for excel file in django
I'm using pandas ExcelWriter and openpyxl for creating excel in Django project. how would I set particular path in my project directory to save the created excel? thanks, in advance. from pandas import ExcelWriter df_view = obj_master.get_employee() writer = ExcelWriter('PythonExportt.xlsx') df_view.to_excel(writer, 'Sheet1') writer.save() -
Celery - Cannot fetch task results
I'm using the Django ORM/Cache as the result backend for celery. I can see that django_celery_results_taskresult table is created in the database. After the tasks are finished the results are also inserted in the database which can be viewed from MySQL. But when I try to access the results using AsyncResult and task ID from django manage.py shell I get the following error. >>> AsyncResult.get('88e4d870-1a2b-4675-8f7c-1eacb7199bda') Traceback (most recent call last): File "<console>", line 1, in <module> File "/root/vms/lib/python3.6/site-packages/celery/result.py", line 199, in get if self.ignored: AttributeError: 'str' object has no attribute 'ignored' >>> AsyncResult('88e4d870-1a2b-4675-8f7c-1eacb7199bda').get() Traceback (most recent call last): File "<console>", line 1, in <module> File "/root/vms/lib/python3.6/site-packages/celery/result.py", line 224, in get on_message=on_message, File "/root/vms/lib/python3.6/site-packages/celery/backends/base.py", line 470, in wait_for_pending no_ack=no_ack, File "/root/vms/lib/python3.6/site-packages/celery/backends/base.py", line 773, in _is_disabled raise NotImplementedError(E_NO_BACKEND.strip()) NotImplementedError: No result backend is configured. Please see the documentation for more information. My celery.py file is: from __future__ import absolute_import, unicode_literals from celery import Celery import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'vms.settings') app = Celery('vms', broker='redis://localhost', include=['cve.tasks','cpe.tasks']) app.conf.update( result_backend='django-db', timezone = 'Asia/Kolkata' ) if __name__ == '__main__': app.start() I've included django_celery_results in settings.py INSTALLED_APPLICATIONS. I find it weird that the results get inserted into the database but cannot be retrieved. -
transporterror at django-elasticsearch-dsl . can anyone help solve me this error . I tried other solutions but didn't work?
RequestError at /search/.... TransportError(400, 'search_phase_execution_exception', 'Fielddata is disabled on text fields by default. Set fielddata=true on [title] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.') -
How to Pass a Python Variable to a Template in another app in Django
I have views in app_1 which returns a dictionary and I want to display it in the html in another app called app_2. I tried using {{dic_name.value_1}} and also like {{app_name:dic_name.value_1}}, but it didn't work. -app_1 --urls.py --views.py -app_2 --templates --app_2 -- app_2.html Can anyone help to solve this problem. Thanks -
Django: get_object_or_404 for ListView
I have the following ListView. I know about get_object_or_404. But is there a way to show a 404 page if the ListView doesn't exist? class OrderListView(ListView): template_name = 'orders/order_list.html' def get_queryset(self): return OrderItem.objects.filter( order__order_reference=self.kwargs['order_reference'], ) -
Django: how do you filter with dates and a foreign key
Inside of models I have: The Hotel Name The price for each night. models.py: class Hotel_Database(models.Model): hotel_name = models.CharField(max_length=20) class Hotel_Date_Price(models.Model): hotel = models.ForeignKey(Hotel_Database, on_delete=models.CASCADE , related_name='hotel') checkin = models.DateField(default= datetime.date.today()) checkout = models.DateField(default=datetime.date.today() + datetime.timedelta(1)) price = models.IntegerField() views.py: import datetime x = Hotel_Database.objects.get(id=1) #the price for the night of June 26th: Hotel_Date_Price.objects.create(hotel = x, checkin= datetime.date(2018, 6, 27), checkout=datetime.date(2018, 6,28), price=50).save() #the price for the night of June 27th: Hotel_Date_Price.objects.create(hotel = x, checkin= datetime.date(2018, 6, 28), checkout=datetime.date(2018, 6,29), price=50).save() Hotel_Database.objects.filter(hotel_name__icontains='Hotel', hotel__checkin__lte=datetime.date(2018, 6, 27), hotel__checkout__gte=datetime.date(2018, 6, 28)) #results: <QuerySet [<Hotel_Database: Shangri-La>]> Now here is what happens when I try to filter through more than one night: Hotel_Database.objects.filter(hotel_name__icontains='Hotel', hotel__checkin__lte=datetime.date(2018, 6, 27), hotel__checkout__gte=datetime.date(2018, 6, 29)) #results: <QuerySet []> # it returns an empty list I am basically trying to change the price of each night -
Django graphene 2 with relay restricting queries access based on ID
I am trying to restrict single object queries to the user that created them. Models.py class Env(models.Model): name = models.CharField(max_length=50) user = models.ForeignKey( User, on_delete=models.CASCADE) description = TextField() Schema.py class EnvNode(DjangoObjectType): class Meta: model = Env filter_fields = { 'name': ['iexact'], 'description': ['exact', 'icontains'], } interfaces = (relay.Node, ) Query(object): env = relay.Node.Field(EnvNode) all_envs = DjangoFilterConnectionField(EnvNode) I tried adding a resolve query but it only worked for the "all_env" query with the filter and did not work for the single object query def resolve_env(self, info): env = Env.objects.filter(user = info.context.user.id) if env is not None: return env else: return None Also tried adding a class method to the EnvNode as recommended here under filtering Node based ID access: @classmethod def get_node(context, cls, id, info): try: env = cls._meta.model.objects.get(id = id) except cls._meta.model.DoesNotExist: return None if context.user == env.user: return env return None but I got an error: "message": "get_node() missing 1 required positional argument: 'info'", -
ModelSerializer doesn't respect the required attribute on a field
If I have: class Example(serializers.ModelSerializer): time = DateTimeRangeField(required=False) it will fail with an error: {'time': ['This field is required.']} However if this was serializers.Serializer it respects the required attribute on the field. Has anybody else come across this? Any ideas on how to make a field not required? -
Do browsers delete resources with POST requests?
I have found this snippet in the django codebase: # Add support for browsers which only accept GET and POST for now. def post(self, request, *args, **kwargs): return self.delete(request, *args, **kwargs) What does this mean? Do browsers delete resources with GET / POST requests? Why? Can somebody provide a rationale / history / link for why this might be so? -
Django - How to assign AuthUser id(PK) to username?
I want to assign the id generated to the username column of AuthUser Model. How can I do that? I tried updating the UserManager but to no luck. Here's what I did. def _create_user(self, username=None, email=None, password=None, **extra_fields): """ Create and save a user with the given email, and password. """ email = self.normalize_email(email) user = self.model(email=email, **extra_fields) if not username: username = user.id # it always returns None. user.username = self.model.normalize_username(username) user.set_password(password) user.save(using=self._db) return user How can I do it? -
Django: data send from Ajax to Python is emptied
I am trying to get a string data that is send from Ajax to Python. However, as I log the code, the data isn't sent. It's empty. Could you tell me why? p.s. the purpose of the code is to get the name of the submit button to validate in views.py javascript <script type='text/javascript'> $(".submit-btn").click(function(){ var button_pressed = JSON.stringify($(this).attr('name')); $.ajax({ url: "{% url 'add_test' %}", type: 'POST', data: {'button_pressed' : button_pressed, 'csrfmiddlewaretoken': $("[name=csrfmiddlewaretoken]").val()}, }) }); </script> views.py def add_test(request): if request.method == 'POST': test_name = request.POST.get('test_name') test_type = request.POST.get('test_type') test_date = request.POST.get('test_date') test_obj = Test(test_name = test_name, test_type = test_type, test_date = test_date) test_obj.save() button_pressed = request.POST.get('button_pressed') #button_pressed = json.loads(button_pressed) print button_pressed ,"+++++++++++++++++++++++++++++" return HttpResponseRedirect('/test-management/test/') test_list.html <form class="form" method="POST" action="{% url 'add_test' %}"> {% csrf_token %} <h2>Add Test</h2> <div class="card-body"> <div class="form-group bmd-form-group"> <div class="input-group"> <p>Name :</p> <input type="text" class="form-control" id="test_name" name="test_name" placeholder="Test Name..."> </div> </div> <div class="form-group bmd-form-group"> <div class="input-group"> <p>Type :</p> <input type="text" class="form-control" id="test_type" name="test_type" placeholder="Test Type..."> </div> </div> <div class="form-group bmd-form-group"> <div class="input-group"> <p>Date :</p> <input type="date" class="form-control" id="test_date" name="test_date" placeholder="Test Date..."> </div> </div> </div> <div class="modal-footer justify-content-right"> <button type="submit" class="btn btn-primary btn-link btn-wd btn-lg" data-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-primary btn-link btn-wd btn-lg submit-btn" name="add_new">Add & … -
Django postgres jsonfield filter error: Unsupported lookup
I am using DJango(version 2.0.6) and postgres(version 9.6). I am trying to filter table sp_users based on city: { "name": "abc", "age":30, "gender":"male", "address":{ "city":"Gotham", "state":"xyz", "country":"mno" } } using the following code: SpUsers.objects.filter(address__city='Gotham') here SpUsers is the model which maps to above table. I get the following error: Unsupported lookup 'city' for JSONField or join on the field not permitted. In the model i have defined address field as follows: address = JSONField(null=True, blank=False, default=dict) What am i missing here? How to resolve this issue? -
Displaying images with a horizontal scroll bar in a progressive web app
I am trying to display images of apparels category wise. So I have apparels from kurtis, jeans, saree and tops. So these categories has to be displayed vertically one after the other and the images belonging to individual categories has to be displayed horizontally with a scroll bar. And each of the images when hovered over should display its attributes. All these are happening in a progressive web app with Django backend with HTML, CSS interface. views.py @login_required def viewall(request): context = RequestContext(request) categories = Category.objects.all() images = Images.objects.all().order_by('-id') return render_to_response('cms/view-all.html',{'images':images,'media_url':settings.MEDIA_URL,'categories':categories,},context) view-all.html {% extends "cms/base.html" %} {% block title %} View-all {% endblock %} {% block main %} <style> *{box-sizing: border-box;} .wrapper{ overflow-x:scroll; white-space: nowrap; } .container { background: #ccc; position: relative; height: 50%; width: 75%; max-width: 75%; display: inline-block; } img { padding: 0; display: block; margin: 0 auto auto 0; height: 20%; width: 75%; margin-left: auto; margin-right: auto; max-height: 50%; max-width: 100%; } .overlay { position: absolute; bottom: 0; background: rgb(0, 0, 0); background: rgba(0, 0, 0, 0.5); color: #f1f1f1; width: 75%; transition: .5s ease; opacity:0; color: white; font-size: 20px; padding: 20px; text-align: center; } .container:hover .overlay { opacity: 1; } </style> {% for category in categories %} … -
I'm using Angular 1.6 with django, if i refresh a page django serves the html file but controllers are not loading
I'm sharing my main.js, controller.js, home_page.html, index.html file below. Please some one help me fix the issue which is, when i was in the home page ('127.0.0.1:8000/home/') and try to refresh the page im getting only the html page and all the contents in the rootScope or scope disappears. But this is usual but i don't know how to again gain the data from the controller. main.js $stateProvider .state("base", { url : "/", views : { "main-content" : { controller : "baseController", template : "<div ui-view='content'></div>" } } }) .state("base.login", { url : "account/login/", views : { "content" : { controller : "loginController", templateUrl : "/account/login/" } } }) .state("base.register", { url : "account/register/", views : { "content" : { controller : "registerController", templateUrl : "/account/register/" } } }) .state("base.home", { url : "home/", views : { "content" : { controller : "homeController", templateUrl : "/home/" } } }) .state("base.changepassword", { url : "settings/", views : { "content" : { controller : "changePasswordController", templateUrl : "/settings/" } } }) controller.js myApp.controller('homeController', ['$http', '$scope', '$window', '$rootScope', function($http, $scope, $window, $rootScope) { // debugger; if (! $rootScope.currentUser.first_name) { var search_payload = { "email": $rootScope.currentUser.email }; $http({ url: '/api/current/user/', method: "POST", data : … -
django.core.exceptions.ValidationError: ['ManagementForm data is missing or has been tampered with']
I am trying to create a Channel Formset to Person Create/Update page. So i tried the django formsets as per documentation, but i am getting this error. Can someone help me. I was stuck here for 2 days. Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/django/contrib/staticfiles/handlers.py", line 66, in call return self.application(environ, start_response) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 146, in call response = self.get_response(request) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 81, in get_response response = self._middleware_chain(request) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner response = response_for_exception(request, exc) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response six.reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise raise value File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in call response = self.get_response(request) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner response = response_for_exception(request, exc) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info()) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response six.reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise raise value File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in call response = self.get_response(request) … -
django built-in authentication views not rendering templates
I made registration folder under my templates folder and add these thwo files(login.html & logout.html) in this folder.when i runserver i got no error but my login template in not rendering.only base template is render.please guide me? Login.html {% extends 'base.html' %} {% block title %}Login{% endblock %} {% block content %} <h1>Log-in</h1> {% if form.errors %} <p>Your username and password didn't match. Please try again.</p> {% else %} <p>Please, use the following form to log-in. If you don't have an account <a href="{% url "register" %}">register here</a></p> {% endif %} <div class="login-form"> <form action="{% url "login" %}" method="post"> {{ form.as_p }} {% csrf_token %} <input type="hidden" name="next" value="{{ next }}" /> <p><input type="submit" value="Log-in"></p> </form> <p><a href="#">Forgotten your password?</a></p> </div> {% endblock %} urls.py from django.urls import path from django.contrib.auth.views import LogoutView, LoginView from . import views urlpatterns = [ path('', views.dashboard, name='dashboard'), #login and logout path('login', LoginView.as_view(), name='login'), path('logout', LogoutView.as_view(), name='logout'), ] views.py from django.shortcuts import render from django.contrib.auth.decorators import login_required @login_required def dashboard(request): return render(request, 'account/dashboard.html', {'section': 'dashboard'}) setting.py from django.urls import reverse_lazy LOGIN_REDIRECT_URL = reverse_lazy('dashboard') LOGIN_URL = reverse_lazy('login') LOGOUT_URL = reverse_lazy('logout') -
Django does not createing superuser with custom user model
I created a custom user model as shown in this question. Only difference here is that I don't have a custom backend authentication. I did the migration after creating the user model. But manage.py createsuperuser not creating a super user in the db. I have created another user using registration form. The user is able to login and logout without any issue. So I manually changed is_superuser to True in db and I could login from the admin page. What am I doing wrong here? Is it safe to create user from registration from and change to super user and use it? I'm using django 1.11.13. -
Error in MySQL syntax while using raw command in Django
In a function in views.py, I am trying to access the header columns(column names) of a table using a SQL query, and use it. I am using a MYSQL database for my Django project. However, I am getting the following error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use" My code: views.py def get_columns(request): # some other code with connection.cursor() as cursor: cursor.execute("DESCRIBE %s", [table_name]) for column in cursor.fetchall(): #use columns extracted here return (Some appropriate response) Can someone please help me figure out the problem here? -
Record audio from browser and Save it as a wav file
How to Record audio from the browser and Save it as a wav file? I have to use this feature on my website with Python -Django. -
Importing model from other app causes problems
I have two apps... let's call them tiger and bird. At first, I was using models from tiger in the bird app. This is how I did the importing in bird/models.py: from django.db import models from tiger.models import TigerClass, AnotherTigerClass This worked well. There is no problem with me importing the TigerClass and OtherTigerClass into the bird app. Now, I want to also do the opposite. So in the tiger app I want to import a model from the bird app. As far as I can find in the manual, there are no restrictions on this and I should be able to use the same syntax. So this is what I do in tiger/models.py: from django.db import models from bird.models import BirdClass However, the moment I do this, my app throws a very odd error: web_1 | Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fac830d1730> web_1 | Traceback (most recent call last): web_1 | File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper web_1 | fn(*args, **kwargs) web_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run web_1 | autoreload.raise_last_exception() web_1 | File "/usr/local/lib/python3.6/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception web_1 | raise _exception[1] web_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 327, in execute web_1 | autoreload.check_errors(django.setup)() … -
how to find where is located the file via include in django?
I have to urls: url(r'^users/', include('apps.users.urls', namespace='users')), url(r'^accounts/', include('allauth.urls')), the first one /users I can see through the path apps.users.urls where is located, but the second one is not in the folders path, how can I know where is located the allauth.urls -
Detecting changes for update_or_create
In my django app, I have the following: act, created = Account.objects.update_or_create( adwords_id=aj['adwords_id'], defaults=dict( status=aj['status'], spent_in_hkd=round(float(aj['spent_in_hkd']), 2), vendor_nickname=aj['vendor_nickname'], ) ) I am currently integrating django-reversions into my project. In order to capture a "revision", I am required to call this method: reversion.create_revision(). I have attempted doing so: with reversion.create_revision(): act, created = Account.objects.update_or_create( adwords_id=aj['adwords_id'], But it seems like this is creating revisions even though there are no changes. How can I call create_revision only when there are changes made to this particular Account instance? -
Python Django Using admin datepicker in a custom form
I am trying to use a django admin datepicker in a custom form. it is displaying alright but the year only begin in 2018 but no later than 2018. how to i earlier years. my form.py from django.forms.extras.widgets import SelectDateWidget class ContactForm(forms.ModelForm): class Meta: model =contacts fields = ('First_Name','Middle_Name','Last_Name','Date_of_Birth','Gender','Island','Province','Date_of_Baptism','Congregation','Status','Comments',) widgets = {'Date_of_Birth': SelectDateWidget(),'Date_of_Baptism':SelectDateWidget()}