Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django test - testing form in a view but form is raising 'nonfield' error - why?
I am writing a test which follows the logic of my views: View 1: Display search form (GET request) User uses search form (POST request) Search form validated against request.POST querydict If valid, HttpReponseRedirect to another view View 2: Display search form using kwargs from redirect User clicks on checkboxes (MultipleChoiceField) - (POST request) Checkbox form is validated against request.POST querydict If valid, another HttpReponseRedirect However in my test, at View 2 step 3 and 4, the form.is_valid() method is raising an error "errorlist nonfield" and stating that one of the choices is not available. In the test I am using a value (model id) which should be displayed, so I am confused why this is happening: test.py: def test_new_report(self): self.uploadTestDataRequired() run_obj = Run.objects.all()[0] # VIEW 1 data = { 'experiment_name': str(run_obj), 'choice': 'primary', 'submit': 'Search experiment', } response = self.client.post('/reporting/', data) self.assertRedirects( response, reverse('results:search_sample_run', kwargs={ 'run_id': run_obj.id, 'choice': 'primary', } ), status_code=302, target_status_code=200, ) # VIEW 2 sr_obj = SampleRun.objects.filter(run_id=run_obj) data = { 'run_id': str(run_obj.id), 'sample_run_id': sr_obj[0].id, 'submit': 'Report samples' } query_dict = QueryDict('', mutable=True) query_dict.update(data) response = self.client.post(response.url, query_dict) views.py: View 1: class Search(LoginRequiredMixin, GroupRequiredMixin, View): runsearchform = RunSearchForm template_name = 'results/search_templates/search_form.html' def get(self, request, *args, **kwargs): print('Search … -
' ' object is not iterable. Django 1.11
I'm trying to use the get() to display individual items. Models: class JoinGroup(models.Model): title=models.CharField(max_length=120) location=models.CharField(max_length=20) details= models.TextField() travelers_that_have_booked=models.FloatField() price1=models.FloatField() price2=models.FloatField() price3=models.FloatField() price4=models.FloatField() price5=models.FloatField() price6=models.FloatField() price7=models.FloatField() image1=models.ImageField() image2=models.ImageField() image3=models.ImageField() image4=models.ImageField() image5=models.ImageField() image6=models.ImageField() image7=models.ImageField() accomodation=( ('budget'), ( 'standard') ) itinerary= models.TextField() created_on=models.DateField(auto_now_add=True) bookbefore=models.DateField() def __str__(self): return self.title views: def single(request, id): singlegroup = get_object_or_404(JoinGroup, id=id) return render(request, 'joingroup/single.html', {"singlegroup": singlegroup}) error: 'JoinGroup' object is not iterable -
can we run 2 group parallel tasks using django canvas for celery tasks
like this I added in my celery.py @app.task(bind=True) def execute_analysis(id_=1): task1 = group(news_event_task.si(i) for i in range(10)) task2 = group(parallel_task.si(i) for i in range(10)) return chain(task1, task2)() -
Should we save results in database models which we can anytime calculate using data?
I am trying to create a Report Card Model. I have with me: Question ids, answers selected for each question by candidate, correct answer id of each question, weight of each question. Is it a good idea, to create fields like "Total marks, average, no of correct answers, number of questions" etc in my ReportCard model OR should I calculate everything , every time a viewer visits the detail view of this report card ? My Model so far: class ReportCard(models.Model): exam = models.OneToOneField(Exam) class ExamChoiceMade(models.Model): ReportCard = models.OneToOneField(ReportCard) question_no = models.PositiveIntegerField(default=0) answer_chosen = models.PositiveIntegerField(default=0) is_correct = models.BooleanField(default=False) -
Why django redis cache cannot get the data in redis
My cache settings: CACHES = { 'default': { 'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': 'redis://127.0.0.1:6379/1', 'OPTIONS': { "CLIENT_CLASS": "django_redis.client.DefaultClient", }, } } the host is 127.0.0.1, the port is 6379 and database is 1. I want to add the data by using redis_connection like this: from django_redis import get_redis_connection redis_conn = get_redis_connection('default') redis_conn.set('somekey', 'somevalue') So the redis database has the data now, I can get it by: redis_conn.get('somekey') but I couldn't get it by django.core.cache.cache, although data exists in the database: from django.core.cache import cache cache.get('somekey') #return None If I must use conn to set data and use cache to get data, what should I do? -
How to pause Python script for inputs in a chat bot type environment where there are mu GETs and POSTs
I have a Django based ChatBot ,where in I want to integrate a python script which takes an input and acts accordingly. So I do it this ways:I take the Input value from the ChatBot pass it to the script it returns a value The issue in when I do a POST from my views.py then I lose my script state. As in,after one of the POST happens ,If I do another GET and pass it to my script it start the script again.I want a way such that I dont lose my script state even after multiple GETs and POSTs .The script should somehow pause and take the new inputs from the ChatBot front-end via Django Views.Py -
Does Django support oracleDB nosql?
Im trying to use django with oracle nosql. I know django supports oracleDB but I don't know if oracle regular driver can be used by oracle nosql too. is there any driver for Nosql to support code first? -
Django query to get all formset images belonging to a particular object via foreign key relationship
views.py def TrainerDashView(request): if not request.user.is_authenticated: return redirect('accounts:index') else: page = request.GET.get('page', 1) notifications = Notification.objects.filter(receiver= request.user,task__is_verified=False) count = Notification.objects.filter(receiver = request.user).count() tasks = Task.objects.filter(student__mentor=request.user,is_verified=False) paginator = Paginator(tasks,1) try: tasklist = paginator.page(page) except PageNotAnInteger: tasklist = paginator.page(1) except EmptyPage: tasklist = paginator.page(paginator.num_pages) context={ 'notifications':notifications, 'trainer':request.user, 'tasks': tasklist, } return render(request,'mentor.html',context) models.py class Task(models.Model): level = models.ForeignKey(Level, on_delete=models.CASCADE) todo = models.ForeignKey(ToDo, on_delete=models.CASCADE) student = models.ForeignKey(User, on_delete=models.CASCADE) title = models.CharField(max_length=150) content = models.TextField() timestamp = models.TimeField(auto_now=True) datestamp = models.DateField( auto_now=True) like =models.ManyToManyField(User,related_name='user_likes',blank=True) is_verified=models.BooleanField(default=False,blank=True) def __str__(self): return self.title def get_absolute_url(self): return reverse('student:task-detail', kwargs={'pk': self.pk}) objects = PostManager() @property def comments(self): instance = self qs = Comment.objects.filter_by_instance(instance) return qs @property def get_content_type(self): instance = self content_type = ContentType.objects.get_for_model(instance.__class__) return content_type class Images(models.Model): post = models.ForeignKey(Task, default=None,on_delete=models.CASCADE) image = models.ImageField(verbose_name='Image') Im using formsets to connect 3 images to a particular task.I want to display the 3 images for the task in template.The tasks are displayed as a list with pagination ,1 task per page. How do i get all the 3 images and display for a particular task? Confused about the query to use ! -
django.db.utils.ProgrammingError: relation "auth_permission" does not exist
I am having a working sqlite database in my local environment. On heroku I am using psql. But I am getting following error when I try to run $ heroku run python manage.py migrate Traceback (most recent call last): File "/app/.heroku/python/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) psycopg2.ProgrammingError: relation "auth_permission" does not exist LINE 1: ...ntent_type_id", "auth_permission"."codename" FROM "auth_perm... ^ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv self.execute(*args, **cmd_options) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 350, in execute self.check() File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 379, in check include_deployment_checks=include_deployment_checks, File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 366, in _run_checks return checks.run_checks(**kwargs) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/checks/registry.py", line 71, in run_checks new_errors = check(app_configs=app_configs) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "/app/.heroku/python/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py", line 533, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/app/.heroku/python/lib/python3.6/site-packages/django/urls/resolvers.py", line 526, in urlconf_module return import_module(self.urlconf_name) File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", … -
How to filter by foreign key field in model?
I have two models: # models.py class FirstModel(models.Model): first_field = models.CharField(max_lenght=123) class SecondModel(models.Model): first_model_field = models.ForeignKey(FirstModel, related_name="first_models", on_delete=models.CASCADE, db_constraint=False) class Meta: verbose_name = "Second" verbose_name_plural = "Second" I've tried to write filter to show all FirstModel instances with SecondModel and without. When I run that code: for e in FirstModel.objects.all(): print(e.second.all()) I see several querysets. Some of those is empty, some - is not. # views.py from django_filters import FilterSet, CharFilter, Filter class FirstModelFilterSet(FilterSet): first_field = CharFilter(name='first_field', lookup_expr='icontains') second = Filter(name='second', lookup_expr="isnull") class Meta: model = Envelope fields = ['first_field', 'second'] class EnvelopeViewSet(ModelViewSet): queryset = FirstModel.objects.all() filter_class = FirstModelFilterSet FirstModelFilterSet works correctly with first_field filtering. But not with second. How to fix it? -
Instance of list in ArrayField valid?
I have some user accounts with the field "donation_methods". A user can you choose between different methods to accept donations. By default every user should have the value: 'cash' in the array donation_methods = ArrayField( models.CharField( max_length=15, choices=DONATION.CHOICES, ), default=list({DONATION.CASH}), ) Is this the correct way to do this because it's an instance and not a callable? -
Django password_reset Form email validation
Django password_reset Form does not check if email exists or not. Also validates form whatever email address is given. The question is, how do i check and throw error for non existing emails with custom form? By the way, i found below solution at here but it is not working for me. (using Django 2.1). And if this should work, i couldn't found what i am missing. forms.py class EmailValidationOnForgotPassword(PasswordResetForm): def clean_email(self): email = self.cleaned_data['email'] if not User.objects.filter(email__iexact=email, is_active=True).exists(): raise ValidationError("There is no user registered with the specified email address!") return email urls.py path('sifre-sifirla/', PasswordResetView.as_view(), {'password_reset_form':EmailValidationOnForgotPassword}, name='password_reset'), Thank you in advance. -
How do I include all fields for my elasticsearch project?
I am trying to implement elasticsearch into my project. Right now it is able to search through the response field in my Response table, but i also want to be able to search through the other fields e.g. Question, Topics, Clients. When i try to add in "Question" under fields, my site breaks. documents.py: from django_elasticsearch_dsl import DocType, Index, fields from app.models import Response @response_index20.doc_type class ResponseDocument20(DocType): class Meta: model = Response fields = [ 'Response', #'Question', ] models.py: class Response(models.Model): Question = models.ForeignKey(Question, default=436, on_delete=models.CASCADE) Topic = models.ForeignKey(Topic, default=13, on_delete=models.CASCADE) Response = models.TextField() Client = models.ForeignKey(ClientDetail, default=8, on_delete=models.CASCADE) Planit_location = models.ForeignKey(Planit_location, default=1, on_delete=models.CASCADE) Image = models.ForeignKey(Image, default=0, on_delete=models.CASCADE) Date_added = models.DateField(default=datetime.date.today) def __str__(self): return self.Response views.py: from app.documents import ResponseDocument20 @login_required(login_url="/login/") def search_es20(request): q = request.GET.get('q') if q:#ES responses = ResponseDocument20.search().query("wildcard", Response=q)#ES else:#ES responses = ''#ES return render(request, 'app/search_es20.html', { 'responses': responses, 'query': q, }) -
How to call my field validators in my save method in Django?
I have a model with a field that requires alphanumeric characters. I force this constraint using a validator. Something like this: from django.core.validators import RegexValidator validate_alphanumeric = RegexValidator(r'^[a-zA-Z0-9]*$', 'Only alphanumeric characters are allowed.') class MyModel(models.Model): my_field = models.CharField(max_length=255, validators=[validate_alphanumeric,] def save(self, *args, **kwargs): # self.call_validators() or whatever super(MyModel, self).save(*args, **kwargs) Now, this works automatically in my admin site, and model forms. However, when I create objects from the shell, or lets say a manual API endpoint, then the validator is not enforced. Is there a built-in function in django like the one in my comments that I can just call in my save method? Or do I have to manually validate my field again in the save method? Thanks. -
Django model instance left open
Could there be any problems in case Django Model instance is left open and not saved? For example: qs1 = Foo1.objects.all().first() qs1.some_field = 'Bar1' qs2 = Foo2.objects.all().first() qs2.some_field = 'Bar2' I was thinking of having 2 open instances of 2 different models which would have to be called in multiple cases. So instead of writing those 4 lines over and over again, could I simply define those like that and then just call qs1.save() and qs2.save() without having problems in future? -
Unable to write multiple QRCodes to pdf
I am trying to write multiple QR codes on a pdf file using reportlab, the problem is that QR codes are being written on one another. Snapshot attached. Here's the code: p = canvas.Canvas('rand.pdf') x = 0 y = 0 d = Drawing(45, 45) for i in range(3): qrw2 = QrCodeWidget(str(timezone.now())) d.add(qrw2) renderPDF.draw(d, p, x, y) x+=160 y+=160 p.showPage() p.save() -
Better way to file response with DRF?
I have this action: @action(methods=['get'], detail=True) def download_csv(self, request, pk, *args, **kwargs): project = self.get_object() data = show_stages_tasks(request, pk) file_name = f"{project.name}.csv" export_to_csv(data, file_name) file_handle = open(file_name, "r") response = FileResponse(file_handle.read(), content_type='application/csv') response['Content-Disposition'] = f'attachment; filename="{file_handle.name}"' file_handle.close() os.remove(file_name) return response and export_to_csv is: def export_to_csv(data, filename="project"): content = JSONRenderer().render(data) stream = io.BytesIO(content) content_parsed = JSONParser().parse(stream) tasks = content_parsed[0]["related_tasks"] keys = tasks[0].keys() with open(filename, 'w') as output_file: dict_writer = csv.DictWriter(output_file, fieldnames=keys) dict_writer.writeheader() for task in tasks: task['children'] = [] task['task_folders'] = [] dict_writer.writerow(task) And show_stages_tasks returns a serialized data with DRF serializer, with 3 nested serializers (too big and I think unnecessary to post it here). As you see here - I parse serializer data, create a CSV file, save it, next open it, pass in the Response and delete file. The question is can I somehow pass the content of the file, without actually creating CSV file and next deleting it? -
Deploying django project with Apache
I am trying to deploy a django project with Apache but I got this error [Tue Oct 23 11:05:27.321603 2018] [wsgi:error] [pid 11440:tid 1308] [client ::1:7844] ModuleNotFoundError: No module named 'django'\r [Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] mod_wsgi (pid=11440): Failed to exec Python script file 'C:/wamp64/bin/apache/apache2.4.27/htdocs/project/djangoProject/djangoProject/wsgi.py'. [Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] mod_wsgi (pid=11440): Exception occurred processing WSGI script 'C:/wamp64/bin/apache/apache2.4.27/htdocs/project/djangoProject/djangoProject/wsgi.py'. [Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] Traceback (most recent call last):\r [Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] File "C:/wamp64/bin/apache/apache2.4.27/htdocs/project/djangoProject/djangoProject/wsgi.py", line 13, in <module>\r [Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] from django.core.wsgi import get_wsgi_application\r [Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] ModuleNotFoundError: No module named 'django'\r -
Django 2.1, How to show Foreign key values in template?
Sorry for my English level and my model is not good. Now, i'm stuck showing value in templates. purchaseinfo/models.py class Status(Models.model): type = models.CharField(max_length=30) class PurchaseInfo(models.Model): purchase_id = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) purchase_name = models.CharField(max_length=30) ..... type = models.ForeignKey(Status,on_delete=models.PROTECT) customlogin/views.py def purchaseHistory(request): history = PurchaseInfo.objects.filter(purchase_id=request.user).values() return render(request,'customlogin/purchaseHistory.html',{'history':history}) customlogin/purchaseHistory.html {% for i in history %} <tr> <td>{{i.purchase_name}}</td> <td>{{i.product_price}}</td> ...... <td>{{i.type}}</td> <---- Here, Only this cannot show </tr> {% endfor %} In templates, Other things work well. But {{i.type}} cannot show. class Status's values : before deposit, Confirmation of payment and so on. before deposit is base value. So i want to show base value in templates. How can show the {{i.type}} in templates?? T.T -
TinyMCE local file upload handling with Python
I am new to using Django. And I would like to customize TinyMCE editor for myself. I downloaded it and added to the project as a third part library, did not install it through pip. As you know, there is no free local file uploader in TinyMCE. And I'd like to do 3 things: local image uploder, local audio/video uploader, and local file uploader(with any extension(.pdf, .c, .cpp), this is like how you add a file at the end of a post so that users can download it). And during the realization I had the following issues. I implemented the local loader with TiniMCE file_picker_callback, and everything works fine. I can upload and edit photos locally, and all of this is displayed on the view page template. The path of each image is recorded in the textarea field in MySQL DB as src atribute. Whether each image should be uploaded(copied) to the MEDIA folder of the site or in a separate field in the MySQL DB. And how it can be implemented, how to write and call the python handler in the js file? And I still do not download audio / video files. It seems for this in js … -
'ManagementForm data is missing or has been tampered with' error when loading multiple model forms django
views.py @login_required(login_url='/account/login/') def TaskCreateView(request,pk,todo_id): if not request.user.is_authenticated: return redirect('accounts:index') else: instance = get_object_or_404(Level, pk=pk) qs = instance.todo_set.get(id = todo_id) todo = Task.objects.filter(todo=qs, student=request.user) if todo.exists(): messages.warning(request, 'You Already Completed This Task') return HttpResponseRedirect(instance.get_absolute_url()) form = StudentTaskForm(request.POST or None, request.FILES or None) if form.is_valid(): form.instance.user = User.objects.get(id=request.user.id) obj = form.save(commit=False) obj.student = request.user obj.todo = qs obj.level = instance obj.save() ImageFormSet = modelformset_factory(Images, form=ImageForm, extra=3) formset = ImageFormSet(request.POST, request.FILES, queryset=Images.objects.none()) if request.method == 'POST': if formset.is_valid(): for form in formset.cleaned_data: image = form['image'] photo = Images(post=form, image=image) photo.save() return redirect('student:dashboard') return render(request,'task_form.html', {'form':form,"qs":qs,'formset':formset}) forms.py class StudentTaskForm(forms.ModelForm): title = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control',' type': "text",'placeholder':'Enter Title'})) content = forms.CharField(widget=SummernoteWidget()) class Meta: model = Task fields = [ 'title', 'content', ] widgets = { 'content': SummernoteWidget(), } class ImageForm(forms.ModelForm): image = forms.ImageField(label='Image') class Meta: model = Images fields = ('image', ) I have two models Task and Images and im using two forms for the same. Im trying to implement multiple image upload for the same.When i try to load the form im encountering this error.I have added the {{ formset.management_form }} in the template. THe images model has a foreign key to the Task template: <form id="post_form" action="" method="post" enctype="multipart/form-data"> {% csrf_token %} {% … -
Comma separated text instead of multiple selection on Django Form for Many to Many Field
So, I'm developing a web application to control the inventory on my company in Django (yes, I know there are plenty open source alternatives out there, we are in fact using fusioninventory right now, but I'm not the boss...). The thing is, one computer can have multiple users, and so I implemented it on the model as a ManyToMany field. Here is the relevant code for the model, filter and html template. Note that I'm using django_filters lib to implement the search filters and widget_tweaks to give some style to the form. models.py class Computer(models.Model): tag = models.CharField(max_length = 20, unique=True) users = models.ManyToManyField(User, blank = True, default = 'No_User',) TYPE = ( ('DESK','Desktop'), ('LAP','Laptop'), ) computertype = models.CharField( max_length = 4, choices = TYPE, ) STATUS = ( ('OK','OK'), ('Broken','Broken'), ('Unusable','Unusable'), ) computerstatus = models.CharField( max_length = 12, choices = STATUS, default = 'OK', ) model = models.CharField(max_length = 36) serial = models.CharField(max_length = 36) buy_date = models.DateField() modified_date = models.DateTimeField(auto_now=True) def __str__(self): return self.tag def get_absolute_url(self): return reverse('computer_detail', args=[str(self.id)]) filters.py class UserFilter(django_filters.FilterSet): class Meta: model = User fields = { 'username': ['contains'], } class ComputerFilter(django_filters.FilterSet): tag = django_filters.CharFilter(lookup_expr="icontains",label = 'Etiqueta',) computertype = django_filters.ChoiceFilter(choices = Computer.TYPE, lookup_expr="icontains",label = 'Tipo',) … -
How can I pass in a parameter to my TestCase in Django?
Using an edited version of the example from Django's own doc, lets say my code looks like this: from django.test import TestCase from myapp.models import Animal class AnimalTestCase(TestCase): def __init__(self, animal_family): self.animal_family = animal_family def setUp(self): Animal.objects.create(name="lion", sound="roar", family=self.animal_family) def test_animals_can_speak(self): """Animals that can speak are correctly identified""" lion = Animal.objects.get(name="lion") self.assertEqual(lion.speak(), 'The mammal lion says "roar"') Basically, I want to pass in the animal_family parameter into my test, or something similar at least from my terminal. Something like this python manage.py test myapp.tests.AnimalTestCase 'mammal' Obviously, the above command does not work. I want to send the 'mammal' as the animal_family to the __init__ method in my test class. Help would be greatly appreciated. -
cv2.imshow() function is opening a window for face recognition after recognition it not close in Django- python opencv
cv2.imshow() function is opening a window for face recognition after recognition it closes in Django but the problem is if I click face recognition button again cv2.imshow() is not workenter image description here. If I restart my Django server Then close otherwise my laptop webcam light on. And camera is busy.- python opencv -
Django password validators
How could I change the password restrictions? I edited setting.py with this example: AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.form.password_validation.MinimumLengthValidator', 'OPTIONS': { 'min_length': 4, } }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] But the warning message doesn't change (always 8 chars for example). Is it enough to change the length options?