Sunday, March 27, 2011

Re: Seeking Django Counsel when adding a new model using South and a custom field for my ProtectedFileField subclass

On Sun, Mar 27, 2011 at 1:47 PM, Matteius <matteius@gmail.com> wrote:
> add_introspection_rules([], ["^student_portal\.fields
> \.ProtectedFileField"])
...
>  ! Cannot freeze field 'student_portal.assignment.provided_files'
>  ! (this field has class
> classcomm.student_portal.fields.ProtectedFileField)


Without looking too carefully at whether your introspection rules are
correct, the first thing that jumps out at me is that South sees the
field class as "classcomm.student_portal.fields.ProtectedFileField",
while you have registered an introspection rule for
"^student_portal\.fields\.ProtectedFileField".

The "^" at the beginning of your regex anchors the expression to the
start of the string, so it will only match if your class name begins
with "student_portal".

Try changing the regex in your add_introspection_rules call to either:

"student_portal\.fields\.ProtectedFileField" -- removing the "^" so
that it can match anywhere within the string, or

"^classcomm\.student_portal\.fields\.ProtectedFileField" -- preserving
the "^", but adding the "classcomm." that South sees as the start of
the full class name.

--
Regards,
Ian Clelland
<clelland@gmail.com>

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate