> You changed it to a OneToOneKey (OneToMany is another way of saying > ForeignKey). OneToOneKey relationships are modelled as a single > attribute, not a set, so it would simply be > > snarveier = bruker.brukersnarvei > > Using "python manage.py shell" you can explore what attributes your > objects have. Create a user and run dir(user_instance). > > Cheers > > Tom
ahh. i thought _set was meant as a werb. now it makes a lot more sence to me. but alas, it still wont work. Here is what i found through the terminal. --------------------------------------------------------------- (InteractiveConsole) >>> from django.contrib.auth.models import User >>> User.objects.all() [<User: itss>] >>> user = User.objects.get(id=1) >>> dir(user) ['DoesNotExist', 'MultipleObjectsReturned', '__class__', '__delattr__', '__dict_ _', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__ ', '__metaclass__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_e x__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_ _unicode__', '__weakref__', '_base_manager', '_collect_sub_objects', '_default_m anager', '_deferred', '_get_FIELD_display', '_get_message_set', '_get_next_or_pr evious_by_FIELD', '_get_next_or_previous_in_order', '_get_pk_val', '_get_unique_ checks', '_message_set', '_meta', '_perform_date_checks', '_perform_unique_check s', '_set_pk_val', '_state', 'brukersnarvei', 'check_password', 'clean', 'clean_ fields', 'date_error_message', 'date_joined', 'delete', 'email', 'email_user', ' first_name', 'full_clean', 'get_absolute_url', 'get_all_permissions', 'get_and_d elete_messages', 'get_full_name', 'get_group_permissions', 'get_next_by_date_joi ned', 'get_next_by_last_login', 'get_previous_by_date_joined', 'get_previous_by_ last_login', 'get_profile', 'groups', 'has_module_perms', 'has_perm', 'has_perms ', 'has_usable_password', 'id', 'is_active', 'is_anonymous', 'is_authenticated', 'is_staff', 'is_superuser', 'last_login', 'last_name', 'logentry_set', 'message _set', 'objects', 'password', 'pk', 'prepare_database_save', 'save', 'save_base' , 'serializable_value', 'set_password', 'set_unusable_password', 'unique_error_m essage', 'user_permissions', 'username', 'validate_unique'] ------------------------------------------------------------------------------------------ i can fin "brukersnarvei" in the attributes, so what am i missing? the error message: Brukersnarvei matching query does not exist. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.