Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-02-05 Thread mrts
Patch has been uploaded to http://code.djangoproject.com/ticket/12780 . After applying the patch you can override def formsets_are_valid(self, formsets, form, form_is_valid, instance, request): and do any complex validation you like. As it's rather arcane, I've provided an

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-02-04 Thread mrts
See http://code.djangoproject.com/ticket/12780 . I will upload a patch and provide an example, but I can't yet say when. Best, Mart Sõmermaa On Jan 15, 8:10 pm, Gabriel Reis wrote: > Hey Marcos, > > In the clean() method of my ClipModelForm class I couldn't manage how to

Re: overriding save() for ManyToManyFields

2009-09-24 Thread mrts
On Sep 24, 12:52 am, "Daniele Procida" wrote: > Don't I need to run some sort of save for those? Otherwise, what happens > to the attributes once I have set them? Sorry, I responded too hastily and erroneously. Here's the proper, longer explanation. Assume the

Re: overriding save() for ManyToManyFields

2009-09-23 Thread mrts
On Sep 23, 10:40 am, "Daniele Procida" wrote: > So, obviously I need another stage, to save the many-to-many relations > once theo bject is saved. Call super(Event, self).save(), then update the many-to-many relations.

Re: QuerySet - filter through related objects

2009-09-17 Thread mrts
On Sep 17, 2:39 pm, filippo wrote: > Is it an official feature? I can't find it anywhere in > documentation... http://docs.djangoproject.com/en/dev/topics/db/queries/#chaining-filters --~--~-~--~~~---~--~~ You received this message because

Re: need help for a realted queryset

2009-09-17 Thread mrts
On Sep 17, 1:04 pm, andreas schmid wrote: > hi, > > i have 3 models topic, project, technology. a topic contains projects > and projects have technolgies. > the 3 models are related to each other by foreignkeys in the project model. > > in the topic detail view i need to

Re: return related objects from a queryset

2009-09-17 Thread mrts
On Sep 17, 8:21 am, Milan Andric wrote: > So is there a way I can query on Alumni.objects.filter(**query_params) > but then return the Profile objects related to the Alumni objects > rather than the Alumni objects? >>> query_params = {'grad_year': 2008, 'third_year': True}

Re: Check whether a model has a field with given name

2009-09-17 Thread mrts
On Sep 17, 9:55 am, Dmitry Risenberg wrote: > Is it by-design not to add fields to Model's __dict__? Yes. If you want to know the design better, you may find more insight in e.g. "Pro Django" book by Marty Alchin, Malcolm Tredinnick's "Inside the ORM" DjangoCon 2008

Re: Aggregate using extra() fields

2009-09-17 Thread mrts
On Sep 16, 11:30 pm, Kathleen Benitez wrote: > I am attempting to evaluate some generalization schemes using Django. > In particular, I'd like to create a new field (generalized race), and > then find a total population using the values() function as follows:

Re: Check whether a model has a field with given name

2009-09-16 Thread mrts
On Sep 16, 9:31 pm, Dmitry Risenberg wrote: > try: > field_attribute = getattr(self.model, self.field_name) > except AttributeError: try: self.model._meta.get_field_by_name(self.field_name) except models.FieldDoesNotExist: ...

Re: Django critter helps us code at the speed of light.

2009-03-16 Thread mrts
On Mar 16, 3:53 pm, Torsten Bronger wrote > No, I mean "contained in the original critter".  As far as I can > see, you added the glory.  I simply wonder why. Ah, sorry for the misunderstanding :). It looked nice, conveys the "helpful fellow" message and -- last

Re: Django critter helps us code at the speed of light.

2009-03-16 Thread mrts
On Mar 16, 2:55 pm, Torsten Bronger <bron...@physik.rwth-aachen.de> wrote: > Hallöchen! > > mrts writes: > > On Mar 15, 5:56 pm, mrts <m...@mrts.pri.ee> wrote: > > >> I don't, therefore I'm all for the critter and my (styled) take > >> is here:htt

Re: Django critter helps us code at the speed of light.

2009-03-16 Thread mrts
On Mar 15, 5:56 pm, mrts <m...@mrts.pri.ee> wrote: > I don't, therefore I'm all for the critter and my (styled) take is > here:http://mrts-foo.appspot.com/ For anyone still interested in the critter, there are some banners now at http://mrts-foo

Re: Django critter helps us code at the speed of light.

2009-03-15 Thread mrts
I prefer the Critter to the Pony... I takes a brave man to identify himself with the grrly Pony, so thumbs up to everybody who have that much bravado in themselves :) I don't, therefore I'm all for the critter and my (styled) take is here: http://mrts-foo.appspot.com/ (Created with Inkscape, but

Re: Feel free to test queryset-refactor branch

2008-04-14 Thread mrts
Big cheers and big thanks! Has anyone tried merging qs-rf and nf-admin already? MS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to