The short of it is that you should probably subclass the picklefield to add some new validation (basically is_integer_two_tuple_list), and write a custom widget for it that does what you want on the html side. The long of it needs not being written from a phone
-----Mensaje original-----
De: Alphydan
Enviados: 24/10/2012 19:58:29
Asunto: Re: Displaying a custom field (PickledObjectField) in the admin
Hi Tomas & John,
Thank you for your reply. Basically I'm trying to save curves which I
chose to format as:
[[0,0],[1,0],[2,1],[3,1], ... ,[40,0]]
To see what I tried before (models, etc) you can see the stackoverflow
question<
http://stackoverflow.com/questions/13034922/storing-a-curve-in-a-django-model-as-manytomany>I asked previously.
and when the users completes *some of them*, I save it as a string:
"[[0,0],[1,1],[2,3],[10,20],[20,20],[40,0]]"
Eventually I want to retrieve them and calculate things (like area under
the curve or make a graph).
Any ideas are appreciated,
Thank you,
Alvaro
On Wednesday, 24 October 2012 20:14:16 UTC+1, Tomas Neme wrote:
>
> Just by the way, I'm looking at django-picklefield code and README
>
https://github.com/gintas/django-picklefield and it says NOTHING about
> a widget, or an admin representation, so.. maybe it's not DESIGNED to
> be shown on the admin? it'd make sense, too, since it's.. well, it can
> be ANYTHING....
>
> On Wed, Oct 24, 2012 at 3:03 PM, Tomas Neme <
lacry...@gmail.com<javascript:>>
> wrote:
> > maybe restate the problem, give some more code, show your models, and
> > your admin files, and someone may be able to help a little
> >
> > --
> > "The whole of Japan is pure invention. There is no such country, there
> > are no such people" --Oscar Wilde
> >
> > |_|0|_|
> > |_|_|0|
> > |0|0|0|
> >
> > (\__/)
> > (='.'=)This is Bunny. Copy and paste bunny
> > (")_(") to help him gain world domination.
>
>
>
> --
> "The whole of Japan is pure invention. There is no such country, there
> are no such people" --Oscar Wilde
>
> |_|0|_|
> |_|_|0|
> |0|0|0|
>
> (\__/)
> (='.'=)This is Bunny. Copy and paste bunny
> (")_(") to help him gain world domination.
>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/6RtZPEgjgFsJ.