access the state of a Model object prior to it's modification ?

2012-07-14 Thread Nicolas Emiliani
e save button on the admin form ? or should I use a second model attribute and hide it on the form to keep the previous state ? is there a "Django" way to do this ? It's my first post, be gentle :P Thanks ! -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien

Re: Query Distance from User

2012-07-15 Thread Nicolas Emiliani
ost 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. > -- Nicolas Emiliani Lo unico

Re: Query Distance from User

2012-07-15 Thread Nicolas Emiliani
e (lat,long) that belongs to the user position yo can then ask for a radius in blocks, meters o whatever. So, now you can get the surface of a circle and with some basic math you go through your db checking if any artist are inside the limit of that circle. > Thanks so much! > > JJ &g

unable to override widget

2012-07-15 Thread Nicolas Emiliani
Hi! I'm trying to override the AdminFileWidget with no success. The idea is to get a thumbnail next to the uploaded files in a tabular view of the admin site. I did the following : class AdminImageWidget(AdminFileWidget): def render(self, name, value, attrs=None): -- Nicolas Emilian

Re: unable to override widget

2012-07-15 Thread Nicolas Emiliani
3 fieldsets = [ (None, { 'fields' : [ ('image','description','name','height','width'), ] } ), ] But the widget still shows itself as the AdminFileWidget, A

Re: access the state of a Model object prior to it's modification ?

2012-07-15 Thread Nicolas Emiliani
I know if he is republishing or he modified some other field that has nothing to do with that attribute ? I would be republishing only if it's previous state was not published. But how can I acces that previous state ? Sounds waky :P > On Sun, Jul 15, 2012 at 1:49 AM, Nicolas Emiliani

Re: access the state of a Model object prior to it's modification ?

2012-07-16 Thread Nicolas Emiliani
.) > > Yes, you are right, but you are clearing the date, the thing is that I don't want to clear it. That's why I thought of having an attribute in the model that does not render in the form, that would allow me to keep the previous state unchanged and use that in my logic. >

Re: Why am I getting an error when send e-mail from hosting?

2012-07-16 Thread Nicolas Emiliani
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/-/pI8qXk50AaEJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this gro

Re: unable to override widget

2012-07-17 Thread Nicolas Emiliani
On Sunday, July 15, 2012 6:16:42 PM UTC-3, Nicolas Emiliani wrote: > > Crap, hit the send key, there it goes. Sorry. > > > Hi! >> >> I'm trying to override the AdminFileWidget with no success. The idea is >> to get a thumbnail >> next to the uploaded

can_add TabularInline ?

2012-07-21 Thread Nicolas Emiliani
Hi, so.. I have a TabularInline admin view that displays '+ Add another' and I would like to remove it, like can_delete = False but for the add option. sadly can_add doesn't exist, so how do I achieve this ? Thanks! -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe

Re: Overriding save to create and save related entity

2012-07-25 Thread Nicolas Emiliani
ps.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. > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received

Re: access the state of a Model object prior to it's modification ?

2012-07-30 Thread Nicolas Emiliani
oups.google.com/d/msg/django-users/-/NM39pkUyvG4J. > > 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/gro

Re: Dynamic forms

2012-07-30 Thread Nicolas Emiliani
ail 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. > > -- Nicolas Emiliani Lo unico instantaneo en la vida es

Re: access the state of a Model object prior to it's modification ?

2012-07-31 Thread Nicolas Emiliani
o 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. > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You receiv

dynamic fildsets on ModelAdmin

2012-08-05 Thread Nicolas Emiliani
eAdminForm gets called after the constructor for HomeAdmin, so all the added fields are not there yet when HomeAdmin.__init__ is called. Is what I'm trying do ok ?, Is there any way to fix this ? Thanks dudes, -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien f

Re: dynamic fildsets on ModelAdmin

2012-08-05 Thread Nicolas Emiliani
On Sun, Aug 5, 2012 at 5:40 PM, Melvyn Sopacua wrote: > On 5-8-2012 20:16, Nicolas Emiliani wrote: > > Hi, I've been struggling with dynamic forms and until now I'm loosing the > > battle :S > > > So, now I want the HomeAdmin to render all this stuff into the f

Dynamic form field type.

2012-08-05 Thread Nicolas Emiliani
an relate each HomeAttributeType to what they should render to. Since I have a variable number of HomeAttributeTypes, I need to set a variable number of hidden fields in the form. I was reading about FormSets but I can't find the way to add one to the ModelForm that the HomeAdmin is using.

Re: Dynamic form field type.

2012-08-06 Thread Nicolas Emiliani
On Sun, Aug 5, 2012 at 9:08 PM, Melvyn Sopacua wrote: > Hi, > > On 6-8-2012 0:09, Nicolas Emiliani wrote: > > > I have three Models, > > > > Home, HomeAttributeType and HomeAttributeValue. HomeAttributeValue has > > an FK to HomeAttributeType and one to Home. &

ManyToMany through parameter bug workaround.

2012-08-18 Thread Nicolas Emiliani
foo = ForeingKey(Foo) value = DateField Here I can store the value for the relationship when saving the Model in the DB. If anyone has a better solution, suggestion, comment or thinks this is going to make me rot in hell please let me know. Thanks. -- Nicolas Emiliani Lo unico instantane

Re: ManyToMany through parameter bug workaround.

2012-08-18 Thread Nicolas Emiliani
Hope it saves some headaches. > -- > Nicolas Emiliani > > Lo unico instantaneo en la vida es el cafe, y es bien feo. > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received this message because you are subscribed to the Google Groups "Djang

Re: ManyToManyField errors.

2012-08-21 Thread Nicolas Emiliani
tle','code','is_active') > model = Adversite.image_many.through > > Please help me. > > Well, this is just a guess, but you are setting the model in the form as the through attribute of an M2M relationship and that might the problem, have you tried explic

ModelMultipleChoiceField with MultiWidget ?

2012-08-26 Thread Nicolas Emiliani
what has been driving me nuts! u'attrs': [ u'2'], As you can see it only passes the id of the attribute, not the id and the value. What I need is something like u'attrs': [ (u'2','500')], Any ideas on how to fix this ? Thanks! -- Nicolas Em

Re: ModelMultipleChoiceField with MultiWidget ?

2012-08-26 Thread Nicolas Emiliani
d widget inheriting > directly from MultiWidget? > I think you would need to override the methods: __init__, render, > decompress > Yes also, > > But I'm no expert ;-( > > Well, you are closer than I am :) Thanks for the help. > > On Sun, Aug 26, 2012 at 7:42 PM, Nic

Re: expand fieldset by choice

2012-08-26 Thread Nicolas Emiliani
le 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/dja

widget construction issue

2012-08-26 Thread Nicolas Emiliani
e queryset changes the widget gets 'obsolete'. Is this some cache issue ? is there any way to force the widget construction each time i access the form containing it ? -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received this message because y

Re: widget construction issue

2012-08-27 Thread Nicolas Emiliani
On Mon, Aug 27, 2012 at 3:54 AM, Melvyn Sopacua wrote: > On 27-8-2012 1:21, Nicolas Emiliani wrote: > > > The thing is that the GridWidget.__init__ method does not get executed > > each time I access the form that contains it, so if the queryset changes > the >

Re: Column widths in TabularInline

2012-08-27 Thread Nicolas Emiliani
web, there is a __LOT__ of info on this. Vikas > > -- > 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

Re: expand fieldset by choice

2012-08-27 Thread Nicolas Emiliani
ta: > db_table = u'mailbox' > verbose_name = _('Mailbox') > verbose_name_plural = _('Mailboxes') > ordering = ['localpart'] > unique_together = ('localpart', 'localdomainfk') >

Re: expand fieldset by choice

2012-08-27 Thread Nicolas Emiliani
On Mon, Aug 27, 2012 at 10:51 AM, Axel Rau wrote: > > Am 27.08.2012 um 15:04 schrieb Nicolas Emiliani: > > > > > Through JS, you need to implement a script that binds to the change event > > and then changes the collapse css call for the specific div. You may wan

Re: Column widths in TabularInline

2012-08-28 Thread Nicolas Emiliani
age 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

Re: Django IMAGESTORE app help to - create a photo album

2012-08-29 Thread Nicolas Emiliani
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. > -- Nicolas Emiliani Lo unico

Re: Automatically create an InlineForm object inside an admin page

2012-08-30 Thread Nicolas Emiliani
ngo-users/-/YvGlPmf_HtEJ. > 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

display thousand separator.

2012-09-30 Thread Nicolas Emiliani
= True So now I can input for example: 5.000.000 but after saving it it shows 500 Any solutions besides doing some javascript tampering? Thanks! -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received this message because you are subscribed to t

Re: django-guardian 404 on save.

2012-10-06 Thread Nicolas Emiliani
On Sat, Oct 6, 2012 at 4:41 PM, Nicolas Emiliani wrote: > Hi, > > I'm implementing django-guardian within the admin site and I'm having the > following issue. > If I create a model instance through the admin panel and then try to > modify it > (even using the

django-guardian + field permissions ?

2012-10-07 Thread Nicolas Emiliani
ific group being able to change his own objects permissions. It would be somewhat of field permission over object permissions. Any way to accomplish this ? Thanks in advance. -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received this message becau

Re: Adding a new row to the database in user form

2012-10-15 Thread Nicolas Emiliani
nsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received this message because you are subscribed to the Google Groups &

Only one profile type of multiple user profiles types gets created.

2012-10-22 Thread Nicolas Emiliani
it to create an AuditorProfile not even by setting the agency field on the form. Any ideas what is going on? I'm clueless Thanks! -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received this message because you are subscribed to the Google Groups

a way to display a model formset in a ModelAdmin ?

2012-10-24 Thread Nicolas Emiliani
): class VerificationAdminForm(forms.ModelForm): class VerificationAdmin(admin.ModelAdmin): form = VerificationAdminForm model = Verification fieldsets = [ ... ] Any ideas would be greatly appreciated. Thanks in advance. -- Nicolas Emiliani Lo unico

Re: Only one profile type of multiple user profiles types gets created.

2012-10-24 Thread Nicolas Emiliani
nly one profile class with an profile type attribute. Nasty but it works. > > Thanks! > > -- > Nicolas Emiliani > > Lo unico instantaneo en la vida es el cafe, y es bien feo. > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo. -- You received

Re: a way to display a model formset in a ModelAdmin ?

2012-10-25 Thread Nicolas Emiliani
to display. I'm starting to think that maybe using a many-to-many field with a custom widget might do the job. > On Thu, Oct 25, 2012 at 3:51 AM, Nicolas Emiliani wrote: > >> Hi, >> >> As the subject states, is there a way to display a model formset in a >> Mod

Re: django-ajax giving 403

2012-10-30 Thread Nicolas Emiliani
ups.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. > -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo.

Re: Extend Django UserProfile

2012-11-01 Thread Nicolas Emiliani
ps://groups.google.com/d/msg/django-users/-/x4UAl7Mc-w8J. > 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/g

Re: Extend Django UserProfile

2012-11-01 Thread Nicolas Emiliani
web visit > https://groups.google.com/d/msg/django-users/-/J0DJKVoy-wcJ. > > 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://g

Best way to create an advanced search bar for the admin app.

2012-11-20 Thread Nicolas Emiliani
to present that and somehow, I do not know how yet, override the search method at the admin site. Does it sound good? Has anyone done this? Is there another approach? Any comments will be highly appreciated. Thanks! -- Nicolas Emiliani Lo unico instantaneo en la vida es el cafe, y es bien feo

Django + Raspberry PI

2013-03-01 Thread Nicolas Emiliani
Hey guys! Has anyone tried to run django + sqlite on a raspberry pi ? Any performance issues ? I'm about to start an app that provides a restful api and has to run on RPI, it's going to manage an automation service, so load is going to be pretty low. Cheers. -- Nicolas Emiliani

Re: Django + Raspberry PI

2013-03-01 Thread Nicolas Emiliani
up 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?hl=en. > For more options, visit https://grou