adding stored procedures / postgres functions to db?

2006-05-10 Thread mazurin
Hi, I'm trying to implement a complicated sequence of updates inside a form-handling view, and I realized that it might be best to do it inside a Postgresql function. In fact, I've already found sample code for a postgres function that's almost exactly what I need. My question is, how do I

Re: adding stored procedures / postgres functions to db?

2006-05-10 Thread mazurin
Malcolm and Adrian, Thanks so much for your quick replies! I thought of that, but I didn't know if it was the Djangoic way of doing it. Follow up question -- are _all_ the files in the sql/ directory executed, or just those that have the same names as the models? mikah -- --~--~-

Re: adding stored procedures / postgres functions to db?

2006-05-11 Thread mazurin
Hi Malcolm, Got it. That's all I need to know. Thanks! Mikah -- --~--~-~--~~~---~--~~ 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 uns

integrating complex SQL updates with manipulators?

2006-05-18 Thread mazurin
Hi, I'm currently implementing a table of nested sets using Django, based on Joe Celko's discussion of the subject. For those of you not familiar with it, the only really relevant part of the problem is that when you modify certain database fields, the corresponding fields in some other records

Re: integrating complex SQL updates with manipulators?

2006-05-18 Thread mazurin
Hi, I'd like to clarify with some sample code. I hope this makes my question clearer. My question is about the line marked with an uppercase comment. Mikah # def modify(request, item_id): ''' View to modify a single node. ''' try: manipulator = nodes.ChangeManipulator(ite

Re: integrating complex SQL updates with manipulators?

2006-05-19 Thread mazurin
Ivan Sagalaev wrote: > Is it necessery that moveNode is called before get_validation_errors? > If not, I think this should go into manipulator.save(). If yes, why? No it's not necessary ... I see, so I should override manipulator.save() then? Does this mean subclassing manipulator? --~--~-

Re: integrating complex SQL updates with manipulators?

2006-05-22 Thread mazurin
rs. X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.11.88.14 with SMTP id l14mr38175cwb; Mon, 22 May 2006 00:16:38 -0700 (PDT) X-Google-Token: cIbVuQwAAABVBaVwX0NXnl9vMy0nHoSt Received: from 203.131.108.202 by i40g2000cwc.googlegroups.com with HTTP; Mon, 22 May 2006 07:16:38 +000

MyFormWrapper.myfield works in {{}} but not {%%} ?

2006-06-07 Thread mazurin
Hi all, I have a short question, it's probably a stupid one but I can't quite figure out why Django behaves this way. I am using limoudou's 'expr' tag, btw. In a template html file, why can I do this (very simplified example): {{ form.somefield }} but not this: {% expr fo

Re: Context as Stack?

2006-06-07 Thread mazurin
Hi Eugene, Thanks for this example. I think it'll be helpful for me. I'm working on something like this right now, where I need to generate a whole bunch of small and simple subtemplates inside of a main layout template. I was worried that I might have to write a custom tag -- I can, but it

Re: MyFormWrapper.myfield works in {{}} but not {%%} ?

2006-06-13 Thread mazurin
Thanks. I think I figured it out. It's not the expr tag, it's {%%}. It seems that {%%} doesn't cause a form field to render into HTML the way {{}} does. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

ManyToMany in a custom manipulator?

2006-06-13 Thread mazurin
Hi, I'm writing a custom change manipulator for a model. I'm not using the default because there's some special processing that has to happen on each save. Now, this model has a ManyToMany relationship. How do I add a form field that will update that relationship? In effect, it has to work on t

Re: ManyToMany in a custom manipulator?

2006-06-13 Thread mazurin
Hi again, I think I found the answer to my own question, here: http://code.djangoproject.com/wiki/ManipulatorScript I hope this is useful to someone. mikah -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: put some initial data in the db

2006-09-01 Thread mazurin
Another option, which may or may not be acceptable, is to write an SQL script containing the necessary INSERTs and run it using your database's command line client, after syncdb has run. I do this because syncdb seems to break when running myapp/sql/mymodel.sql files when they contain newlines (n

Re: Creating a menu structure

2006-03-03 Thread mazurin
I'm going to try to do the same thing as well. I have a vague idea that I have to write a custom view for it, but I'm still trying to figure out the right way to do it. Any pointers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the