Hi Liam,
No I didn't try, but when the form is loaded empty (to create a new record) 
I can see the Multiple Select List widget with all the users (order by 
username) and I can even save one or more of them as viewers of the asset.

Do you think I should try it anyway? I mean should I expect some sort of 
error or do other test on the returned value ?

Il giorno mercoledì 2 aprile 2014 16:22:05 UTC+2, Liam Thompson ha scritto:
>
> Hi Alex
>
> Your code is way more advanced that my skill level. Was wondering if you 
> had tried to run that query
>
> viewers = ModelMultipleChoiceField(queryset = User.objects.all().order_by(
> 'username'))
>
> from the shell ?
>
> Liam
>
>
>
>
> On Wednesday, 2 April 2014 15:12:42 UTC+2, Alessandro Caruso wrote:
>>
>> Hi all.
>>
>>
>> the code:
>> models.py https://gist.github.com/karuso/9766764
>> views.py (edit function) https://gist.github.com/karuso/9766806
>>
>> the problem:
>> When editing a Videoconference record through the VideoconferenceForm, 
>> Django returns an error: "Cannot resolve keyword 'videoconference' into 
>> field. Choices are:" followed by the list of the fields of the User object.
>>
>>
>> Oddly the problem shows only when:
>> - running the code under Apache with DEBUG=False (it all works great when 
>> DEBUG=True or when running under Django dev server regardless of DEBUG 
>> Value)
>> - I try to edit the form (i.e. it works as aspected when inserting a new 
>> record with no Videoconference instance passed to the form)
>>
>> If I remove the viewers filed from the Videoconference class the problem 
>> disappears (in that case the class is no different from Room, 
>> PersonalComputer or Projector classes)
>> I've tried to use related_name with both managers field of the Asset 
>> class and viewers of the Videoconference class but with no success.
>>
>> I hope I've been clear enough.
>>
>> Thanks in advance,
>> Alex
>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/f5b9f57f-5ea0-48f1-88f4-aa1d7c51c4f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to