Уведомления

Группа в Telegram: @pythonsu

#1 Май 20, 2013 10:38:39

romankrv
От:
Зарегистрирован: 2008-05-23
Сообщения: 513
Репутация: +  0  -
Профиль   Отправить e-mail  

Расширение класса User и UserCreationForm

lov3catch
I got the error

Exception at /registration

Could you please share this full list of the Exception if you got on it, UI of course. It has a more detail what happened was.

Luck you man.

Офлайн

#2 Май 20, 2013 11:59:06

barabansheg
От:
Зарегистрирован: 2011-10-16
Сообщения: 114
Репутация: +  2  -
Профиль   Отправить e-mail  

Расширение класса User и UserCreationForm

Попробуй так:

class MyRegisterForm(UserCreationForm):
    print "OK!"
    nick_name = forms.CharField(max_length=30, required=True, widget=forms.TextInput)
    print "Ook"
    class Meta:
        model = UserProfile
        exclude = (user, )
    def save(self, commit=True):
        if not commit:
            raise NotImplementedError("Can't create User and UserProfile without database save")
        print "Saving..."
        user = super(MyRegisterForm, self).save(commit=False)
        user.nick_name = self.cleaned_data["nick_name"]
        user_profile = UserProfile(user=user, nick_name=self.cleaned_data['nick_name'])
        user_profile.save()
        print "Saving complete"
        return user, user_profile



Fidonet. Nod 2:5034/10. Идет набор. Подробности в личку.
Мой блог

Офлайн

#3 Май 20, 2013 14:43:33

lov3catch
Зарегистрирован: 2012-07-15
Сообщения: 43
Репутация: +  0  -
Профиль  

Расширение класса User и UserCreationForm

Like this?

Exception at /registration
<ul class=“errorlist”><li>nick_name<ul class=“errorlist”><li>This field is required.</li></ul></li><li>user<ul class=“errorlist”><li>This field is required.</li></ul></li></ul>
Request Method: POST
Request URL: http://127.0.0.1:8000/registration
Django Version: 1.4.1
Exception Type: Exception
Exception Value:
<ul class=“errorlist”><li>nick_name<ul class=“errorlist”><li>This field is required.</li></ul></li><li>user<ul class=“errorlist”><li>This field is required.</li></ul></li></ul>
Exception Location: E:\kavyarnya\registration\views.py in reg, line 67
Python Executable: c:\python27\python.exe
Python Version: 2.7.3
Python Path:
['E:\\kavyarnya',
‘c:\\python27\\lib\\site-packages\\grab-0.4.8-py2.7.egg’,
‘c:\\python27\\lib\\site-packages\\ply-3.4-py2.7.egg’,
‘c:\\python27\\lib\\site-packages\\flask-0.9-py2.7.egg’,
‘C:\\WINDOWS\\system32\\python27.zip’,
‘c:\\python27\\DLLs’,
‘c:\\python27\\lib’,
‘c:\\python27\\lib\\plat-win’,
‘c:\\python27\\lib\\lib-tk’,
‘c:\\python27’,
‘c:\\python27\\lib\\site-packages’,
‘c:\\python27\\lib\\site-packages\\PIL’,
‘c:\\python27\\lib\\site-packages\\win32’,
‘c:\\python27\\lib\\site-packages\\win32\\lib’,
‘c:\\python27\\lib\\site-packages\\Pythonwin’]
Server time: Mon, 20 May 2013 14:53:30 +0400

And I don`t see form for input nick-name in my template. Preview in screenshot
(Также не отображается форма для ввода ника в шаблоне. Пример на скриншоте.)



Прикреплённый файлы:
attachment Безымянный.JPG (66,8 KБ)

Офлайн

#4 Май 20, 2013 14:44:14

lov3catch
Зарегистрирован: 2012-07-15
Сообщения: 43
Репутация: +  0  -
Профиль  

Расширение класса User и UserCreationForm

barabansheg
Попробуй так:
Спасибо, но не получилось.



Офлайн

#5 Май 20, 2013 14:58:32

romankrv
От:
Зарегистрирован: 2008-05-23
Сообщения: 513
Репутация: +  0  -
Профиль   Отправить e-mail  

Расширение класса User и UserCreationForm

lov3catch
Exception Location: E:\kavyarnya\registration\views.py in reg, line 67
Please, display us one.
Did you analyzed the E:\kavyarnya\registration\views.py in string sixty seven and around here?
Exemption tells you about it.
Let's look here.

Likely the problem grows from here.

Please share this.

Have a nice time.

Отредактировано romankrv (Май 20, 2013 14:58:46)

Офлайн

#6 Май 20, 2013 16:32:09

lov3catch
Зарегистрирован: 2012-07-15
Сообщения: 43
Репутация: +  0  -
Профиль  

Расширение класса User и UserCreationForm

In sixty seven line just:

raise Exception(form.errors)



Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version