On Mon, Jul 14, 2014 at 12:44 PM, Tom Evans <tevans...@googlemail.com>
wrote:

>
>
> Have you ruled out that this is simply a mid air collision? IIRC,
> django admin has no mid air collision detection system
>
> Cheers
>
> Tom
>
> Eg if user A loads Item i, user B loads Item i, user A changes
> i.foo='hi' and saves item i, user B sets i.foo='bar', i.wibble='quuz'.
> User A complains that "admin is not saving my data".
>
>
Thanks Tom.  I haven't had a chance to work on this yet.  However, I can
reproduce it on my development machine with just one user.
Even on the production machine we only have 3 - 5 users at a time and they
are assigned different tasks and aren't likely to be editing the same entry.


I guess the obvious place that this would occur if no one else has the
problem is in the get_form.  It really doesn't do much except check a
boolean and determine if some fields should be readonly.

Example:

    def get_form(self, request, obj=None, **kwargs):
        try:
            if obj.published:
                self.readonly_fields =
['prj_name','published','lang','schema_code','data_name','valid_trues','valid_falses','description','sem_attr','resource_uri','asserts',]

        except (AttributeError, TypeError) as e:
            self.readonly_fields = ['published','schema_code','r_code',]

        return super(DvBooleanAdmin, self).get_form(request, obj, **kwargs)


The try/except was added at one point to see if I could prevent this issue.
 It didn't make a difference so I'll probably take it out when I go back to
working on it.

I do have some actions defined but I can't see how they could cause this
since it is happening during the standard  edit/save process.


I don't recall if I said before: Django 1.6.5 (as well as earlier versions)
PostgreSQL 9.2 and now 9.3 on Ubuntu 14.04 and previously CentOS 6.5



============================================
Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.org

-- 
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/CA%2B%3DOU3Vf4HE5DUpPnCk1XO%3D%3DP6-%3DJh9T9v2gUT4jjK5miXmSZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to