Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django - Calling HTML snippet from python function with arguments from dropdown navbar
I am working on my project and was wondering, if there is a smart solution to the following problem: Basically, I have a python function (my_func) that returns a html string based on three arguments (a,b,c). Say... def my_func(a,b,c): # a = String # b = String # c = Integer # Make a html string html='<p>'+a+' and '+b+' is '+str(c)+'</p>' return html On my website, which I develop using Django with Jinja, I want to create a dropdown navbar to pick a = ['a','b','c','d'], b = ['x','y','z'], c = [1,2] and have the requested view change when the argments in the dropdown navbar are changed. The html of the dropdown would look something like <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <style> .navbar { overflow: hidden; background-color: #333; font-family: Arial, Helvetica, sans-serif; } .navbar a { float: left; font-size: 16px; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } .dropdown { float: left; overflow: hidden; } .dropdown .dropbtn { font-size: 16px; border: none; outline: none; color: white; padding: 14px 16px; background-color: inherit; font-family: inherit; margin: 0; } .navbar a:hover, .dropdown:hover .dropbtn { background-color: red; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: β¦ -
Nignx or Django is removing privileges to uploaded files
Currently I've a web app in Django that uploads files to a server folder in media/contracts/2018/5/3/myfile.pdf the issue is that when the file is bigger than 2MB the uploaded file permissions. -rw------- 1 root root 4664244 May 3 18:21 31ee8079-6ca9-4979-a0c1-d276b588e361.pdf if the file is lower than 2MB gets. -rwxrwxr-x 1 root root 2687931 May 3 14:14 8e498e49-ced8-45d2-af49-4234293d937c.pdf my Urls.py for media_root is: url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), -
If statement inside django html template
I have a variable called status which is either X or β I tried doing : {% if post.Status == X %} <h3> it is X </h3> {% else %} <h3> it is β </h3> {% endif %} but it only show β for both . What can be a fix for this `enter code here -
Django's AccessMixin doesn't define a dispatch() method, even though subclasses call super().dispatch()?
As described in Is it possible to disable Django two-factor authentication with a setting?, I'm trying to write Selenium tests for views which are protected with Django Two-Factor Authentication; specifically, the views inherit from the OTPRequiredMixin. Because it seems involved to generate a token as part of the test fixture, I'm considering whether it would be possible to use a patch decorator to bypass the two-factor authentication. So my test would look something like this: from django.test import StaticLiveServerTestCase from unittest.mock import patch class MyTestCase(StaticLiveServerTestCase): @patch('two_factor.views.mixins.OTPRequiredMixin.dispatch') def test_1(self, mocked_dispatch): mocked_dispatch.return_value = True # Continue testing... The problem is, I can't seem to figure out the 'API' for the dispatch() method from Django's source code at https://github.com/django/django/blob/master/django/contrib/auth/mixins.py, so I'm not sure what the expected return_value should be if the user passes authentication. Here is an excerpt of the Django source code: from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.views import redirect_to_login from django.core.exceptions import ImproperlyConfigured, PermissionDenied class AccessMixin: """ Abstract CBV mixin that gives access mixins the same customizable functionality. """ login_url = None permission_denied_message = '' raise_exception = False redirect_field_name = REDIRECT_FIELD_NAME def get_login_url(self): """ Override this method to override the login_url attribute. """ login_url = self.login_url or β¦ -
passing data from views to template django python?
I am trying to pass data from django view to my template but for some reason when I try to render the data in the template, nothing happens. Yet I can see that I am getting correct data from the model. What could I be doing wrong ? views.py class PatientBill(CreateView): model = PatientBill form_class = PatientBillform def get(self,request): form=PatientBillform(); billingservice = Billing.objects.values() print ('Billingservice',billingservice) return render(request,'cashier/patientbill.html',{'form':form,'Billingservice':billingservice}) patientbill.html <form method="post"> {% csrf_token %} {{ form.patientid }} <br> {{ form.totalbill }} <br> <label style="font-weight: bold;">Choose a service </label> <select id ="service" style="width: 50%;height: 30px;margin-left: 75px" > <option disabled selected> -- select an option -- </option> {% for bservice in Billingservice %} <option name = "servicedata" value={{bservice.service}}</option> {% endfor %} </select> <button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored subtn">Calculate</button> </form> Billingservice - Billingservice <QuerySet [{'id': 2, 'created': datetime.datetime(2018, 5, 3, 13, 28, 58, 170762, tzinfo=<UTC>), 'price': '2000', 'service': 'Consultation'}]> -
I can not add a new field to queryset: invalid syntax
I'm need add new field distance to each queryset objects. I use .annotate and get error: SyntaxError: invalid syntax. Where there was an error? get_object = City.objects.all() queryset = get_object.annotate(distance=(33, output_field=models.FloatField()) The get_object get all queryset object from City models -
Django Rest framework Serialize many to many field
I am trying to serialise a json payload that has a field with an array, the .is_valid() check is returning true but I am getting KeyError: 'passengers' when I try to do this serializer.data['passengers'] but the other fields work fine (such as booking_number and status). This is the response.data I am passing to the seralizer: {'booking_number': 2839, 'passengers': [{'first_name': 'Jack', 'surname': 'Smith', 'email': 'smith@mail.com', 'phone': '1234'}], 'status': 'ON_HOLD'} My seralizers: class PassengerSerializer(serializers.ModelSerializer): class Meta: model = Passenger class FindBus(serializers.ModelSerializer): passengers = PassengerSerializer(read_only=True, many=True) class Meta: model = Booking fields = ('booking_number', 'passengers', 'status') My models: class Passenger(models.Model): first_name = models.CharField(max_length=25) surname = models.CharField(max_length=25) email = models.EmailField() phone_number = models.CharField(max_length=12) class Booking(models.Model): booking_number = models.IntegerField(unique=True) passenger = models.ManyToManyField(Passenger) status = models.CharField(max_length=10) hold_time = models.DateTimeField() Any advise on how to get this working would be greatly appreciated. Btw I was following this: Django rest framework serializing many to many field -
Django app becomes very slow with Azure SQL database
I am trying to run a Django application in AWS with Azure SQL as database. But the response time becomes very slow. Sometimes it takes more than a minute to load some pages which involve some database query. The same application performs reasonably good (8-10 sec response time) with other databases like SQLite/PostgreSQL. I can imagine that because of remote database connection (Azure SQL) the performance may degrade a bit. But in fact the difference is huge. So, I tried to log the time for a specific view function to see how much time it actually takes between getting a request, and sending a response. Interestingly the required time it shows for processing the request including db query is on-average 20 sec. But I am getting the response in browser after much longer delay. I am using "django-pyodbc-azure" as db backend and "ODBC driver 13 for SQL server" as driver. Does anyone have any insight what could be wrong here? -
Why use Redis with PostgreSQL, why not just one of them?
I have seen all over the web that people are configuring their PostgreSQL along side Redis. My question is, why would someone want to use in-memory storage system like Redis, when they have already configured permanent storage system like PostgreSQL. I get that Redis works with RAM and that it is much faster, but is that the only reason? -
Installing virtualenvwrapper on macOS Sierra - "-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory" error
I'm a bit of a newbie to Python, and to virtual environments and Django. I want to install Django but it first recommends a virtualenv / virtualenvwrapper. A video I am watching recommends installing virtualenvwrapper so I just tried this, following these instructions: https://virtualenvwrapper.readthedocs.io/en/latest/install.html#basic-installation and Terminal: Where is the shell start-up file? I first ran pip install virtualenvwrapper which seemed to work fine. It generated some messages, ending with: Downloading https://files.pythonhosted.org/packages/e1/ba/f95e3ec83f93919b1437028e989cf3fa5ff4f5cae4a1f62255f71deddb5b/pbr-4.0.2-py2.py3-none-any.whl (98kB) 100% |ββββββββββββββββββββββββββββββββ| 102kB 5.3MB/s Requirement already satisfied: six>=1.10.0 in /Users/rishi/anaconda3/lib/python3.6/site-packages (from stevedore->virtualenvwrapper) Installing collected packages: virtualenv-clone, pbr, stevedore, virtualenv, virtualenvwrapper Successfully installed pbr-4.0.2 stevedore-1.28.0 virtualenv-15.2.0 virtualenv-clone-0.3.0 virtualenvwrapper-4.8.2 I then had to follow the "shell startup" guidelines which mentioned adding these lines to be shell startup file: export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel source /usr/local/bin/virtualenvwrapper.sh I did this. Once I run $ source ~/.bash_profile on terminal, I am presented with this error: -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory After searching online, a forum post recommended that I run: which virtualenvwrapper.sh and this gives me the result: /Users/rishi/anaconda3/bin/virtualenvwrapper.sh Note I have Anaconda installed for some (previous) learning. I now want to install/learn Django. Searching online, one person recommended to copy the virtualenvwrapper.sh from the one directory to the /usr/local/bin/ directory. It β¦ -
Python error trying install mysql-connector via pip
I'm to trying create a project in Python using Django. One of the dependencies is a connection with Mysql. I'm Using pip to import whatever I need. My problem is the error when I run this line: sudo pip3 install mysql-python The return is: Collecting mysql-python Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-6dok9yt5/mysql-python/setup.py", line 13, in <module> from setup_posix import get_config File "/tmp/pip-install-6dok9yt5/mysql-python/setup_posix.py", line 2, in <module> from ConfigParser import SafeConfigParser ModuleNotFoundError: No module named 'ConfigParser' The final line is: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-6dok9yt5/mysql-python/ Someone can help me? Thanks in advance! -
Error when add new field in queryset object: 'int' object is not callable
I'm start start study ORM Django and want add field distance to each queryset. I read, what is necessary is use .anntotate, but when I add the value of the field, I get error: 'int' object is not callable. What doin wrong? get_city = City.objects.filter(active='t') queryset = get_city.anntotate(distance=32(output_field=models.FloatField())) -
Django URL tag: Getting a NoReverseMatch on model id even though it exists
Really tiring issue today with Django templates. I've been successfully using URL tags with no issues for a while until today. I can't figure it out for the life of me. In the code below If I do a really ugly way of storing the url as a variable and then put it in an element, I get no problems and it works as normal. {% url 'app:post' post_id=recentpost.id as the_url %} <a href="{{ the_url }}">I'm linking to {{recentpost.id }} {{the_url}}</a> (I did it this way to debug what was going on--I've never had to store the url as a variable and then insert it into an before.) Now if I do it normally in a single template tag--I get a NoReverseMatch Error: <a href="{% url 'app:post' post_id=recentpost.id %}">TEST</a> django.urls.exceptions.NoReverseMatch: Reverse for 'post' with keyword arguments '{'post_id': ''}' not found. 1 pattern(s) tried: ['post\\/(?P[0-9]+)\\/$'] What's irritating, is that there is an identical {% url %} tag further down the template resolving the same URL but with a different post model ID, the only difference is that the variable name is "post" rather than "recentpost" It appears in the Exception that it's passing an empty variable to 'post_id' -- or that β¦ -
Django mod_wsgi: ImportError: No module named 'home'
I have a Django project that runs without issue using the dev server (runserver), but fails when serving through Apache/WSGI. Ubuntu 16.04 Django 2.0.4 mod_wsgi 4.6.4 The error is ImportError: No module named 'home' and here's the trace from Apache's error log: [Thu May 03 19:01:11.010623 2018] [mpm_event:notice] [pid 8568:tid 139727981401984] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.6.4 Python/3.5 configured -- resuming normal operations [Thu May 03 19:01:11.010742 2018] [mpm_event:info] [pid 8568:tid 139727981401984] AH00490: Server built: 2018-04-18T14:53:04 [Thu May 03 19:01:11.010763 2018] [core:notice] [pid 8568:tid 139727981401984] AH00094: Command line: '/usr/sbin/apache2' [Thu May 03 19:01:11.011684 2018] [wsgi:info] [pid 8572:tid 139727981401984] mod_wsgi (pid=8572): Python home /home/xxx/is_websites/webenv/. [Thu May 03 19:01:11.011766 2018] [wsgi:info] [pid 8572:tid 139727981401984] mod_wsgi (pid=8572): Initializing Python. [Thu May 03 19:01:11.014159 2018] [wsgi:info] [pid 8571:tid 139727981401984] mod_wsgi (pid=8571): Python home /home/xxx/is_websites/webenv/. [Thu May 03 19:01:11.014238 2018] [wsgi:info] [pid 8571:tid 139727981401984] mod_wsgi (pid=8571): Initializing Python. [Thu May 03 19:01:11.052639 2018] [wsgi:info] [pid 8572:tid 139727981401984] mod_wsgi (pid=8572): Attach interpreter ''. [Thu May 03 19:01:11.054513 2018] [wsgi:info] [pid 8571:tid 139727981401984] mod_wsgi (pid=8571): Attach interpreter ''. [Thu May 03 19:01:11.073009 2018] [wsgi:info] [pid 8571:tid 139727981401984] mod_wsgi (pid=8571): Adding '/home/xxx/is_websites/' to path. [Thu May 03 19:01:11.075298 2018] [wsgi:info] [pid 8572:tid 139727981401984] mod_wsgi (pid=8572): Adding '/home/xxx/is_websites/' to path. [Thu β¦ -
Django SAML integration
I am using Django 1.9, Python 3, running locally on Docker (for testing) Trying to integrate django-saml2-auth into my application. Pretty much followed all the steps in the docs: 1) All installations were successful 2) New URLs were imported above the rest 3) Installed apps includes 'django_saml2_auth' 4) 'SAML2_AUTH' dict was placed in settings (and all attributes were mapped) 5) In the SAML2 identity provider (using OneLogin), the Single-sign-on URL and Audience URI(SP Entity ID) was set to http://127.0.0.1:8000/saml2_auth/acs/ What happens is that when I get to http://127.0.0.1:8000/admin the browser goes into an infinite redirect loop: ... [02/May/2018 15:43:06] "GET /admin/ HTTP/1.1" 302 0 [02/May/2018 15:43:06] "GET /admin/login/?next=/admin/ HTTP/1.1" 302 0 [02/May/2018 15:43:07] "POST /saml2_auth/acs/ HTTP/1.1" 302 0 [02/May/2018 15:43:07] "GET /admin/ HTTP/1.1" 302 0 [02/May/2018 15:43:07] "GET /admin/login/?next=/admin/ HTTP/1.1" 302 0 [02/May/2018 15:43:08] "POST /saml2_auth/acs/ HTTP/1.1" 302 0 [02/May/2018 15:43:08] "GET /admin/ HTTP/1.1" 302 0 ... When I disable django-saml2-auth I see that a staff user was created. In the OneLogin interface I can see that I logged in successfully. Overriding django_saml2_auth.views.signin(r), where r is a django.core.handlers.wsgi.WSGIRequest, for <WSGIRequest: GET '/admin/login/?next=/admin/'>, and in the request, the user is set to AnonymousUser, COOKIES contain sessionid and csrftoken. I would expect β¦ -
strptime() argument 1 must be string, not type Django
I'm having trouble figuring out where I went wrong with this app trying to validate that a date is either in the present or future. But I'm getting the error in question. Here is the error: class AppointmentManage(models.Manager): def appointvalidate(self,postData): errors={} pause=datetime.datetime.strptime(time,"%Y-%m-%d %H:%M") if len(postData['task'])<2: errors["Task field cannot be left blank"]="task" if len(postData['task'])<20: errors["Task field is too long"]="task" if len(postData['date'])<1: errors["Date field cannot be left blank"]="date" else: print "this is pause " print pause if pause<datetime.datetime.now(): errors["Only present and future dates are permissable"]="date" if len(postData['time'])<1: errors["Time field cannot be left blank"]="time" return errors -
Django: NoReverseMatch -> Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid view function or pattern name
When visiting http://localhost:8000/reset-password/ I get following error: NoReverseMatch at /reset-password/ Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid view function or pattern name. But, if I visit http://localhost:8000/reset-password/done/ it shows no error. from django.conf.urls import url from account import views from django.contrib.auth.views import ( login, logout, password_reset, password_reset_done, password_reset_confirm, password_reset_complete, ) urlpatterns = [ url(r'^register/$', views.register_view, name='register'), url(r'^login/$', login, {'template_name': 'account/login.html'}, name='login'), url(r'^logout/$', logout, {'template_name': 'home.html', 'next_page': '/login'}, name='logout'), url(r'^profile/$', views.view_profile, name='profile'), url(r'^profile/edit/$', views.edit_profile, name='edit_profile'), url(r'^profile/change-password/$', views.change_password, name='change_password'), url(r'^reset-password/$', password_reset, name='reset_password'), url(r'^reset-password/done/$', password_reset_done, name='reset_password_done'), url(r'^reset-password/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', password_reset_confirm, name='reset_password_confirm'), url(r'^reset-password/complete/$', password_reset_complete, name='reset_password_complete'), ] Please help me to solve this error. I'm using django vesion 2.0.2. Thanks in advance. -
django access foreignkey value on CreateView class
I have a form that submits data, but before submitting to the database it will take the value from foreign first. here my models.py class Employee(models.Model): nik = models.CharField(max_length=100) name = models.CharField(max_length=100) def __str__(self): return self.name def get_absolute_url(self): return reverse("system:detail",kwargs={'pk':self.pk}) class EmpLoan(models.Model): status = models.BooleanField() nominal = models.DecimalField(max_digits=10, decimal_places=0) emp = models.ForeignKey(Employee, related_name='emploan') created_at = models.DateTimeField(auto_now=True) updated_at = models.DateTimeField(auto_now_add=True, null=True) def __str__(self): return self.emp.name class EmpInstallment(models.Model): nominal = models.DecimalField(max_digits=10, decimal_places=0) loan = models.ForeignKey(EmpLoan, related_name='empinstallment') created_at = models.DateTimeField(auto_now=True) def __str__(self): return self.loan.emp.name view.py class EmployeeCreateView(CreateView): fields = () model = models.Employee def form_valid(self, form): self.object = form.save(commit=False) data = self.object.EmpLoan.EmpInstallment.object.get(id=1) self.object.nik = data self.object.save() return super(ModelFormMixin, self).form_valid(form) how to access data on EmpInstallment?... iam trying use this data = self.object.EmpLoan.EmpInstallment.object.get(id=1) but it's not working. iam still learner and very noob on django -
In a Django template, how to specify a dictionary key which is itself an attribute?
I'm working on a Django project with a ListView that has both a search form, known in the view's context as search_form, and a filter form, filter_form. The interface looks like this: Both the search_form and the filter_form ultimately change what is returned by the ListView's get_queryset method. I would like to make it such that when you first apply a filter and then do a search, it will search the filtered results. At the moment, the 'reverse' functionality has already been implemented: when you first search and then filter, it will filter the search results. This is because of a hidden input element in the filter_form: <form action={% url 'dashboard:families' %} method="GET" data-behavior="filters"> <input type="hidden" name="q" value="{{ request.GET.q.strip }}"/> <div class="input-field col s2"> {{ filter_form.guide }} <label class="active">Guide</label> {% if filter_form.is_guide_filled %} <a href="" class="clear"><i class="material-icons tiny">clear</i></a> {% endif %} </div> For comparison, the search bar has the following template, _search.html: <form action="{% url action %}" method="get" class="left search col s6 hide-on-small-and-down" novalidate> <div class="input-field"> <input id="search" placeholder="{{ placeholder }}" autocomplete="off" type="search" name="q" value="{{ search_form.q.value.strip|default:'' }}" data-query="{{ search_form.q.value.strip|default:'' }}"> <label for="search" class="active"><i class="material-icons search-icon">search</i></label> <i data-behavior="search-clear" class="material-icons search-icon" {% if not search_form.q.value %}style="display: none;"{% endif %}>close</i> </div> </form> In β¦ -
How can I patch the User model while keeping existing data?
I have a big Django application, currently trying to upgrade from 1.6 to 1.7 (there's been attempts to upgrade straight to 1.11, but it was too much trouble, so my plan is to do it one minor at a time). I'm following the "Upgrade from South" instructions, and deleted all previous migrations, but I can't get makemigrations to work. The current problem is that the auth.User model has been patched to include two new fields: User.add_to_class('profile', models.ForeignKey('access.Profile', null=True, blank=True, related_name='user_foreignkey')) User.add_to_class('profiles', models.ManyToManyField('access.Profile', null=True, blank=True)) This patch was made in a separate app. If I just leave it where it is, I get the following error when running python manage.py makemigrations: ValueError: Lookup failed for model referenced by field auth.User.profiles: access.Profiles I tried moving the add_to_class calls to the same file where Profile is defined, (after the definition), but got the same error. I also tried changing the syntax from 'access.Profile' to Profile, to no effect. Is there something else that could make this work? If not, since I'm adding fields to the model, I figure the correct approach would be extend the AbstractUser model, as suggested by this guide. The problem with this is that the new initial migration will β¦ -
Change the text of standard permissions in the Admin Panel
How to change the text of the permission in the admin panel with: inc|Modelname|Can add permissions on: Modelname|add -
Additional field on django rest framework filters and form (not stored)
There are 2 scenarios here where I'm looking to add an additional non-stored field to the DRF 3.0 generics views. On both my add contact and list contacts web services I was able to call these correctly using python as client. I would like to be able to the same functionality possible in the browser though as well. For add contact I need to add a scenario ('phone', 'form') so I can have different validations take placed based on this value. For the list contacts, I have an interesting data scenario where I want to check 2 fields and related table for the phone number...so on this I'd just like to be able to add a field with name search_phone to the filters on the list view so I can handle it in get_queryset. I tried adding a field to ModelSerializer but I couldn't get it in the form or filter. TIA -
How to prevent Django 1.11 from creating migrations for unmanaged models?
I have a Django 1.11.10 project with an unmanaged model like: class MyModel(models.Model): id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=500) class Meta: managed = False The model wraps a custom SQL view. However, when I run manage.py makemigrations, I find that Django tries to generate a migration that creates a traditional SQL table for this model. In past versions of Django, as this question illustrates, managed = False used to prevent this. Is this no longer true? How do you get Django to not ignore schema changes on a model? -
Creating an external database and use it for authentication in django
I want to create an authenticating system (signup + login) where the credentials are stored in an external database which is not specific to this website (I want to create a system like stackexchange where you login with the same account to multiple websites) I want to signup with (email, password, Full name, adress) If anyone has an idea on how to do so or just has a tutorial on the net for making this happen will be a great help Thanks -
Django nltk view format proper response
I have a view that must return extracted nouns and verbs from my Task objects: @api_view(['GET']) def test(request): verbs=[] tasks = Task.objects.all() serializer = TaskSerializer(tasks, many=True) print(serializer.data) text = ''.join([' '.join([str(y) for y in x.values()]) for x in serializer.data]) text = nltk.word_tokenize(str(text)) #str(text) tags = nltk.pos_tag(text) return Response(filter(lambda x:x[1]=='VB', tags)) my print statement prints: [OrderedDict([(u'id', 17), ('title', u'browse through the list of books'), ('how_often', u'DO'), ('how_important_task', u'EI'), ('role', u'reader'), ('why_perform_task', u''), ('why_important_task', None), ('sequence_of_actions', u''), ('tools_used', u''), ('special_training_required', False), ('what_training_required', u''), ('what_can_go_wrong', u''), ('effects_of_task', u''), ('special_vocabulary_used', u''), ('people_involved', u''), ('any_improvements', u''), ('how_important_improvement', u''), ('benefits_of_improvement', u''), ('stakeholder', 2L), ('project', 1L)]), OrderedDict([(u'id', 18), ('title', u'search for a book'), ('how_often', u'DS'), ('how_important_task', u'EI'), ('role', u'reader'), ('why_perform_task', u''), ('why_important_task', None), ('sequence_of_actions', u''), ('tools_used', u''), ('special_training_required', False), ('what_training_required', u''), ('what_can_go_wrong', u''), ('effects_of_task', u''), ('special_vocabulary_used', u''), ('people_involved', u''), ('any_improvements', u''), ('how_important_improvement', u'RI'), ('benefits_of_improvement', u''), ('stakeholder', 2L), ('project', 1L)]), OrderedDict([(u'id', 19), ('title', u'request a book'), ('how_often', u'WO'), ('how_important_task', u'RI'), ('role', u'reader'), ('why_perform_task', u''), ('why_important_task', None), ('sequence_of_actions', u''), ('tools_used', u''), ('special_training_required', None), ('what_training_required', u''), ('what_can_go_wrong', u''), ('effects_of_task', u''), ('special_vocabulary_used', u''), ('people_involved', u''), ('any_improvements', u''), ('how_important_improvement', u''), ('benefits_of_improvement', u''), ('stakeholder', 2L), ('project', 2L)]), OrderedDict([(u'id', 26), ('title', u'check latest arrivals of the books'), ('how_often', u'MO'), ('how_important_task', u'LI'), ('role', u'reader'), ('why_perform_task', β¦