These are chat archives for codingjoe/django-vies

24th
May 2016
Denis
@Godod
May 24 2016 07:21
Hello all. When I installed the latest version (3.0) from pip, I've found a bug. At the pip version there is no forms folder. But on github - forms folder isset. Please provide a forms folder to pip and upgrade package.
Sorry for my bad English
Johannes Hoppe
@codingjoe
May 24 2016 07:44
ah s**t
@Godod thanks, yes, I didn’t package it
I’m on it
Denis
@Godod
May 24 2016 07:44
@codingjoe Thanks
Johannes Hoppe
@codingjoe
May 24 2016 08:07
released in 3.0.1
@Godod thanks again!
Denis
@Godod
May 24 2016 08:08
@codingjoe np. And thanks to you for cool tool :clap:
Johannes Hoppe
@codingjoe
May 24 2016 08:09
@Godod you’re welcome. Be aware of the breaking changes tho. By default the new VATINField doesn’t do VIES API validation.
I wrote a section about that into the readme file
Denis
@Godod
May 24 2016 08:13
@codingjoe Ok thanks. I've see. Can you write a CHANGELOG file to github repository? It'll be beautiful to see what change from previous update without compare commits.
Johannes Hoppe
@codingjoe
May 24 2016 09:35
hm… yeah, I shoud, but sooo lazy
Denis
@Godod
May 24 2016 11:43

@codingjoe I understand :) It seems, I've found another bug...
I've simple model:

from django.db import models
from vies.models import VATINField

class TestModel(models.Model):
    vat = VATINField()

Then, a have simple ModelForm

from django import forms
from .models import TestModel

class TestForm(forms.ModelForm):
    class Meta:
        model = TestModel
        fields = '__all__'

And than, I've simple view:

from django.views.generic import FormView
from .forms import TestForm

class TestView(FormView):
    template_name = 'order/test.html'
    form_class = TestForm

And I get error (stack trace):

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/test/

Django Version: 1.9.6
Python Version: 3.5.1
...

Template error:
In template /home/godod/marketplace/order/templates/order/test.html, error at line 8
   'NoneType' object is not subscriptable   1 : <!DOCTYPE html>
   2 : <html lang="en">
   3 : <head>
   4 :     <meta charset="UTF-8">
   5 :     <title>Title</title>
   6 : </head>
   7 : <body>
   8 :  {{ form.as_p }} 
   9 : 
   10 : </body>
   11 : </html>

Traceback:
...
File "/home/godod/venv/lib/python3.5/site-packages/django/utils/html.py" in <lambda>
  390.         klass.__str__ = lambda self: mark_safe(klass_str(self))

File "/home/godod/venv/lib/python3.5/site-packages/django/forms/boundfield.py" in __str__
  43.         return self.as_widget()

File "/home/godod/venv/lib/python3.5/site-packages/django/forms/boundfield.py" in as_widget
  101.         return force_text(widget.render(name, self.value(), attrs=attrs))

File "/home/godod/venv/lib/python3.5/site-packages/django/forms/widgets.py" in render
  832.             value = self.decompress(value)

File "/home/godod/venv/lib/python3.5/site-packages/vies/forms/widgets.py" in decompress
  48.         return value[:2], value[2:]

Exception Type: TypeError at /test/
Exception Value: 'NoneType' object is not subscriptable

Django 1.9.6. Python 3.5.1. Do you know why this error happen?

Johannes Hoppe
@codingjoe
May 24 2016 12:06
it seems to be in decompress
lets see
Johannes Hoppe
@codingjoe
May 24 2016 12:18
found the bug, I’m working on a fix
Denis
@Godod
May 24 2016 12:18
@codingjoe Thank you
Johannes Hoppe
@codingjoe
May 24 2016 12:18
I should have released an RC ;)
Denis
@Godod
May 24 2016 12:18
;)
Johannes Hoppe
@codingjoe
May 24 2016 12:20
@Godod codingjoe/django-vies#30
Denis
@Godod
May 24 2016 12:23
@codingjoe It seems, ok. Thank you for fix bug :clap:
Johannes Hoppe
@codingjoe
May 24 2016 12:31
released in 3.0.2
Denis
@Godod
May 24 2016 12:33
:clap:
:sparkles: