Re: template code in tinymce editor

2010-02-18 Thread Matías Costa
In general no, but in this simple usage it is posible. Writing from memory, the names will be wrong: class Info(models.Model) ...fields def article_context_rendered(self): t = templates.from_string(self.article_context) return t.render({'info':self}; And in the template

Re: Queryset inspection in models.Manager not possible without breaking

2009-10-23 Thread Matías Costa
On Fri, Oct 23, 2009 at 9:25 AM, Gerard wrote: > > Hi All, > > I'm trying to find a way to filter on a certain field (myowner) in my views. > If the field in the returned queryset is not unique then raise an exception. > The code in my manager: > > class

Re: how to not saving models

2009-06-23 Thread Matías Costa
ion data. There > is no request/response loop right? > > PS: Monkey patching... very nice this :) > > On 23 Jun., 13:38, Matías Costa <m.costac...@gmail.com> wrote: > > Monkey patch django.db.model.save > > Where? in manage.py? > > > > On Tue, Jun 23, 2

Re: how to not saving models

2009-06-23 Thread Matías Costa
Monkey patch django.db.model.save Where? in manage.py? On Tue, Jun 23, 2009 at 12:56 PM, ReneMarxis wrote: > > what i forgot to say: Of course i don't like to change all models- > code. Some 'global' solution is what i am looking for. > > >

Re: Getting Key Error at /search/

2009-04-22 Thread Matías Costa
2009/4/22 Matías Costa <m.costac...@gmail.com> > On Wed, Apr 22, 2009 at 12:12 PM, srini <srinivas...@gmail.com> wrote: > >> >> Hi, >> Matías Costa >> >> well in the document it says either we can use sorl or whoosh, >> >> i did not hea

Re: Getting Key Error at /search/

2009-04-22 Thread Matías Costa
On Wed, Apr 22, 2009 at 12:12 PM, srini <srinivas...@gmail.com> wrote: > > Hi, > Matías Costa > > well in the document it says either we can use sorl or whoosh, > > i did not heard about pysorl anywhere in the document > > so, if pysorl is the one which is neede

Re: Getting Key Error at /search/

2009-04-21 Thread Matías Costa
On Tue, Apr 21, 2009 at 1:29 PM, srini wrote: > Exception Location: /usr/lib/python2.5/site-packages/ > Whoosh-0.1.13- > py2.5.egg/whoosh/fields.py in name_to_number, line 339 > That django_ct_s seems pysolr related, and you are using woosh. May be there is a

Re: replace admin login

2009-03-24 Thread Matías Costa
On Tue, Mar 24, 2009 at 1:55 PM, benjamin.wins...@googlemail.com < benjamin.wins...@googlemail.com> wrote: > > Hello > > I have created a more robust login mechanism for my site, using > username and password but then also other information, specific to > each user. My main login works fine, but

Re: Upload an ImageField from the Python shell

2009-03-24 Thread Matías Costa
On Tue, Mar 24, 2009 at 4:10 PM, Rit wrote: > > How can I set an ImageField of a model from within the Python shell? > > > ImageField and FileField are just strings. They get special treatment in forms, OK, but your model instance attribute is just a string.

Re: Lookup across relations

2009-03-18 Thread Matías Costa
On Tue, Mar 17, 2009 at 9:28 PM, 3xM <3...@detfalskested.dk> wrote: > I'll upgrade to Ubuntu 8.10 (with django 1.0) as soon as possible and > get back to tell if solved the problem. > I imagine you can upgrade django without upgrade the whole OS. Try to uninstall 0.96 (apt-get), download 1.1 and

Re: Lookup across relations

2009-03-16 Thread Matías Costa
2009/3/16 Matías Costa <m.costac...@gmail.com> > On Sun, Mar 15, 2009 at 2:54 PM, 3xM <3...@detfalskested.dk> wrote: > >> >> Gees... It messed with my link. I'll try again: >> http://blackfin.cannedtuna.org/django-testcase.tar.gz >> >> >

Re: Lookup across relations

2009-03-16 Thread Matías Costa
On Sun, Mar 15, 2009 at 2:54 PM, 3xM <3...@detfalskested.dk> wrote: > > Gees... It messed with my link. I'll try again: > http://blackfin.cannedtuna.org/django-testcase.tar.gz > > > It works OK here. I have added __rerpr__ method to models to get a clear output: for p in Project.objects.all():

Re: How to handle an error that throws an alert box and make it show an AJAX error message instead?

2009-02-09 Thread Matías Costa
I love lightboxes http://particletree.com/features/lightbox-gone-wild/ If you enable the auth middleware you can do: {% if user.is_authenticated %} {% else %} {% endif %} or in the view return a 400 forbidden and just in javascript (jquery code): $.ajax({ url:"do_vote_url",

Re: in what namespace do widgets reside?

2009-01-27 Thread Matías Costa
On Tue, Jan 27, 2009 at 6:42 PM, JonUK wrote: > > Apologies for the daft question, but after 10 mins of trawling through > the official docs and various random google articles, I cannot find > thyis info. django.forms.widgets

Re: django template language + greater than? does it exist?

2009-01-13 Thread Matías Costa
> > http://www.djangosnippets.org/snippets/12/ > > On Tue, Jan 13, 2009 at 11:03 AM, Matías Costa <m.costac...@gmail.com> > wrote: >> >> Fast answer: No >> >> Better awswer: No, but you can get one on djangosnippets.org >> >> On Mon, Jan 12, 2009 at 2:44 PM, rabbi

Re: django template language + greater than? does it exist?

2009-01-13 Thread Matías Costa
Fast answer: No Better awswer: No, but you can get one on djangosnippets.org On Mon, Jan 12, 2009 at 2:44 PM, rabbi wrote: > > is there a greater than method in the template language? > > > --~--~-~--~~~---~--~~ You received this

Re: ModelForm: exclude fields missing in request

2009-01-09 Thread Matías Costa
On Fri, Jan 9, 2009 at 9:59 AM, Flo Ledermann wrote: >> No. Don't ask the form class to read your mind. Create a form that knows >> which fields it expects so that errors can be raised correctly and >> validation will occur normally. > > I am not asking the form class

debugging with eric4

2009-01-02 Thread Matías Costa
Someone debugs django with eric4? How? Thanks! --~--~-~--~~~---~--~~ 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

Re: swapping out request.user in views

2009-01-02 Thread Matías Costa
On Thu, Jan 1, 2009 at 11:30 PM, nbv4 wrote: > > I have a webapp that is accessed by the following urls (among others): > > example.com/foobar-page-23 > example.com/preferences > example.com/barfoo > > etc. > > When these URL's are access, the page is displayed using data from

Re: Incorrect date value: '%2008-10-10%' while searching

2009-01-02 Thread Matías Costa
On Fri, Jan 2, 2009 at 7:48 AM, Praveen wrote: > > > >By product name : > >By date approval : > > > > > views.py > import Q > > def proreport(request): >query = request.GET.get('q', '') >query1 = request.GET.get('p', '') >print

Re: Getting SQL from QuerySet

2008-12-31 Thread Matías Costa
On Tue, Dec 30, 2008 at 9:11 PM, Info Cascade wrote: > > Hi -- > > I am getting intermittent errors on certain database queries on our > production server. > I am having a hard time duplicating them (most of the time they run > okay, only sometimes on the production

Re: multiple models in object_list

2008-11-04 Thread Matías Costa
On Tue, Nov 4, 2008 at 8:37 PM, John M <[EMAIL PROTECTED]> wrote: > > I'm trying to figure out how I can use more than one model with a call > to object_list generic view. > http://www.djangosnippets.org/snippets/1103/ --~--~-~--~~~---~--~~ You received this

Re: Overriding update in models

2008-11-04 Thread Matías Costa
On Tue, Nov 4, 2008 at 9:58 PM, Antonio Volpon <[EMAIL PROTECTED]>wrote: > > Hello. > > I am very new to Django and I'm having some problems in overriding the > save method for a simple class. In particular, the following code > (models.py) used against a Mysql database doesn't change the value

Re: Triggering a custom signal

2008-10-27 Thread Matías Costa
On Mon, Oct 27, 2008 at 5:52 PM, redmonkey <[EMAIL PROTECTED]>wrote: > > h. Yeah, That's pretty simple. > > I could even get a reference to the Job number using -v with at, > storing that in the DB and then removing and recreating another at-job > if the user changes the time. > Do you mean

Re: reusing generic settings dependent on the project folder

2008-10-27 Thread Matías Costa
On Mon, Oct 27, 2008 at 1:07 PM, Frank Malina @ vizualbod.com < [EMAIL PROTECTED]> wrote: > > Hi all, > in my projects I use a set of settings conventions that are the same > from project to project. I want to separate them because I don't want > to repeat myself. > > I am also reusing a big deal

Re: Triggering a custom signal

2008-10-27 Thread Matías Costa
ute(self.end_date, 15) super(Auction, self).save() On Mon, Oct 27, 2008 at 1:06 PM, Matías Costa <[EMAIL PROTECTED]> wrote: > I have the exact problem. I round end and start dates to 15 minutes. I > mean, user enters 12:10, I write 12:15. So each 15 minutes cron runs a > scri

Re: Triggering a custom signal

2008-10-27 Thread Matías Costa
I have the exact problem. I round end and start dates to 15 minutes. I mean, user enters 12:10, I write 12:15. So each 15 minutes cron runs a script with django-commands-extensions runscript. Is a balance between accuracy and load. The perfect should be finding the next success to happen (easy)

Re: Ordering M2M field?

2008-10-25 Thread Matías Costa
On Sat, Oct 25, 2008 at 7:26 AM, Russell Keith-Magee <[EMAIL PROTECTED] > wrote: > > On Fri, Oct 24, 2008 at 10:16 PM, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > > > OK, I have a model with a many to many relationship.. pretty > > straightforward pre-1.0 code: > > > > class

Re: max_length for TextField is not respected

2008-10-24 Thread Matías Costa
Any reason? Seems pretty basic and easy to limit TextField length. On code and db level. On Fri, Oct 24, 2008 at 5:09 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 10:24 AM, omat <[EMAIL PROTECTED]> wrote: > >> >> Hi, >> >> I have a form class derived from a model using

Re: aggregation filter?

2008-10-24 Thread Matías Costa
Sure exists a better way. Get the tags (using django-tagging) used by more than 3 items: Tag.objects.extra(where=["id in (select tag_id from tagging_taggeditem group by tag_id having count(tag_id)>3)"] On Fri, Oct 24, 2008 at 4:37 PM, kbs <[EMAIL PROTECTED]> wrote: > > Hello all, > > is it