'Vlan' object has no attribute 'name'
Request Method: | POST |
---|---|
Request URL: | http://127.0.0.1:8000/admin/networks/vlan/add/ |
Django Version: | 1.6.6 |
Exception Type: | AttributeError |
Exception Value: | 'Vlan' object has no attribute 'name' |
Exception Location: | D:\Scripts\Mercury\networks\models.py in __str__, line 10 |
Python Executable: | C:\Python\Main\Scripts\python.exe |
Python Version: | 2.7.8 |
Hi Przemek,
I'm not sure there's a name attribute for Field and its subclasses.
Does removing the name attribute work?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/50470bc3-c7a0-4afd-b655-f7a3cf8304a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Your problem is in the add view. Post your view code
--
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHqTbj%3DNk8DTt5UNGktqkGb6-Lwqvt8-g2sSW9EpbMZ_8YPRSQ%40mail.gmail.com.
'Vlan' object has no attribute 'name'
Request Method: | POST |
---|---|
Request URL: | http://127.0.0.1:8000/admin/networks/vlan/add/ |
Django Version: | 1.6.6 |
Exception Type: | AttributeError |
Exception Value: | 'Vlan' object has no attribute 'name' |
Exception Location: | C:\Scripts\Test1\networks\models.py in __unicode__, line 11 |
---|
Python Executable: | C:\Python\Main\Scripts\python.exe |
---|---|
Python Version: | 2.7.8 |
Python Path: | ['C:\\Scripts\\Test1', 'C:\\Scripts\\Test1', 'C:\\Windows\\SYSTEM32\\python27.zip', 'C:\\Python\\Main\\DLLs', 'C:\\Python\\Main\\lib', 'C:\\Python\\Main\\lib\\plat-win', 'C:\\Python\\Main\\lib\\lib-tk', 'C:\\Python\\Main\\Scripts', 'C:\\Python27\\Lib', 'C:\\Python27\\DLLs', 'C:\\Python27\\Lib\\lib-tk', 'C:\\Python\\Main', 'C:\\Python\\Main\\lib\\site-packages'] |
---|---|
Server time: | Tue, 26 Aug 2014 14:12:06 +0200 |
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/01dd14d6-43d7-4519-bffb-b6d33a083f54%40googlegroups.com.
On 26 Aug 2014 14:38, "James Schneider" <jrschn...@gmail.com> wrote:
>
> Try changing the 'name' argument to 'verbose_name' like so:
>
> name = models.CharField(max_length=30, verbose_name='Vlan name')
>
> I don't believe model fields accept 'name' as a keyword arg.
This would also explain the slightly confusing error due to the overlap of 'name' appearing in multiple spots.
>
Just like I pointed out in my earlier mail. Remove the name argument or change it to verbose_name as recommended by James
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWRN00qpz1SRvzgC_k0av92MQyPsN0TSU1CBdBh-QFbWw%40mail.gmail.com.
On 25 Aug 2014 23:32, "Babatunde Akinyanmi" <tunde...@gmail.com> wrote:
>
> Hi Przemek,
> I'm not sure there's a name attribute for Field and its subclasses.
> Does removing the name attribute work?
>
Oops. I meant argument not attribute
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.