Re: Can Django template use relative path in 'include' tag?

2006-06-01 Thread Ivan Sagalaev
Wei Litao wrote: > I have a template which reside in 'myapp/tmpl1.html'. In this template > I want to 'include' another template which reside in > 'myapp/tmpl2.html'. But I don't want to use the syntax as '{% include > "myapp/tmpl2.html" %}' . Instead, i want simply use something like '{% > i

Re: Can Django template use relative path in 'include' tag?

2006-06-01 Thread Wei Litao
On 6/2/06, James Bennett <[EMAIL PROTECTED]> wrote: On 6/1/06, Wei Litao <[EMAIL PROTECTED]> wrote:> I have a template which reside in 'myapp/tmpl1.html'. In this template I> want to 'include' another template which reside in 'myapp/tmpl2.html'. But I > don't want to use the syntax as '{% include "

Re: Can Django template use relative path in 'include' tag?

2006-06-01 Thread James Bennett
On 6/1/06, Wei Litao <[EMAIL PROTECTED]> wrote: > I have a template which reside in 'myapp/tmpl1.html'. In this template I > want to 'include' another template which reside in 'myapp/tmpl2.html'. But I > don't want to use the syntax as '{% include "myapp/tmpl2.html" %}' . > Instead, i want simply

Can Django template use relative path in 'include' tag?

2006-06-01 Thread Wei Litao
I have a template which reside in 'myapp/tmpl1.html'. In this template I want to 'include' another template which reside in 'myapp/tmpl2.html'. But I don't want to use the syntax as '{% include "myapp/tmpl2.html" %}' . Instead, i want simply use something like '{% include " tmpl2.html" %}' , becaus

Re: A little help with a filter

2006-06-01 Thread DavidA
Chris, If I understand your problem, its that you want to do an "and" across multiple rows, which is not a simple query (and I'm not sure how to do in the model API). To be more clear, your Sub_Item table relates through a many-to-many relationship to ObjectItem so the SQL to get all Sub_Items wi

Django models question

2006-06-01 Thread Cornel Nitu
Hi, My application have three main models: Restaurant, Hotel, Theather. The fourth model is Reservation. I don't figure out to link the Reservation with the others, because everyone needs a reservation. :) PS. I don't want to duplicate the attributes/methods from the Reservation. Thanks --~--

Re: A little help with a filter

2006-06-01 Thread Chris Moffitt
> Try going into the interactive interpretter (python manage.py shell) > and importing your models, then try: > > query=item1.sub_item_set.filter(options__name__exact="Small").filter(options__name__exact="Blue") > > then inspect the resulting SQL query components by executing: > > print query._ge

Re: User Defined Fields in django

2006-06-01 Thread [EMAIL PROTECTED]
I consider, user defined fields maybe can use one large text field of XML --~--~-~--~~~---~--~~ 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 u

Re: running django from ssh login?

2006-06-01 Thread Matt Wilkie
Thank you very much! That nailed it, the ssh shell was using a different python version. -- -matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: running django from ssh login?

2006-06-01 Thread Honza Král
Hi, try which python and env python -V on both terminal and SSH if they differ try playing around with your environment settings (PATH) On 6/2/06, maphew <[EMAIL PROTECTED]> wrote: > > Hi there, (newbie warning!) > > I've installed django from svn on an Ubuntu linux box. When I'm at the > local

running django from ssh login?

2006-06-01 Thread maphew
Hi there, (newbie warning!) I've installed django from svn on an Ubuntu linux box. When I'm at the local machine, I can run django-admin.py and myproject/manage.py just fine, but when I ssh in from remote I get error messages like: -- $ django-admin.py: /home/matt/src/django/django/core/m

Re: Please help with project setup

2006-06-01 Thread DavidA
Kristoffer wrote: > So, I have decided to use Docutils now, but I am a bit lost. > How do I do this http://code.djangoproject.com/wiki/UsingMarkup with > Docutils? > > Thanks, > Kristoffer Kristoffer, I think that document is a little misleading. Its more about saving the post-processed HTML out

Re: Wiki or Blogs done with django

2006-06-01 Thread DavidA
Jarek Zgoda wrote: > I second that. Actual code may vary, but domain model (and its > representation as Django data model) would remain constant, as long as > software will be performing similar tasks. Well, maybe. I think its really hard in any real application to have a one-size-fits-all data

Re: update_object and preserving fields

2006-06-01 Thread Honza Král
You can also try and have a look on the follow parametr of manipulators, note that the generic views do pass this parameter on from their kwargs... On 6/1/06, Michael Radziej <[EMAIL PROTECTED]> wrote: > > Hi, > > I've followed your discussion only in parts. But I usually handle > everything that

Re: A little help with a filter

2006-06-01 Thread wam
Chris Moffitt wrote: > If I try this: >item1.sub_item_set.filter(options__name__exact="Small").filter(options__name__exact="Blue") > I get an empty list. > > I've tried this using Q objects and some other things but I can't get it > to work. Anyone have ideas of what I'm doing wrong? > Try goin

Re: how to use instance method in the validator_list of a field in model?

2006-06-01 Thread Luke Plant
On Thursday 01 June 2006 08:38, favo wrote: > > However, you can override the 'validate' method on a model, and you > > might be able to use that to do what you want (you will probably > > want a validate method that looks like this: > > > > class Category(models.Model): > > ## fields etc here

Re: Controlling Display of Foreign Key Input Fieldsets in Admin

2006-06-01 Thread Luke Plant
On Thursday 01 June 2006 13:55, Paul Childs wrote: > Thanks Luke. > > I'm sure problem one is just a side effect of why two and three won't > work. > I'm still loving Django though! I should have mentioned that you can provide your own version of the admin templates, and do so on a per model bas

Re: Rich Text Editor for BBCOde?

2006-06-01 Thread Jan Claeys
Op do, 01-06-2006 te 11:05 +, schreef [EMAIL PROTECTED]: > Does anyone know of a "fancy" rich text editor component which > generates BBCode instead of HTML (or is customizable so that it can be > tailored to generate BBCode)? Maybe even one for which there is a > Django integration "Howto"?

Re: Using a relational DB but no ORM

2006-06-01 Thread Filipe
hmm, good point! :) I assumed they were included by default in python installation (like in PHP). thanks, Filipe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: Using a relational DB but no ORM

2006-06-01 Thread Jay Parlar
On 6/2/06, Filipe <[EMAIL PROTECTED]> wrote: > > Hi > > I'm trying to use django for a web application which will be searching > in an existing database. I won't really need models as the most part of > business logic will be running on the database (in the form of pretty > large sql queries). > >

Using a relational DB but no ORM

2006-06-01 Thread Filipe
Hi I'm trying to use django for a web application which will be searching in an existing database. I won't really need models as the most part of business logic will be running on the database (in the form of pretty large sql queries). What is the best way to issue a sql query to the database by

Re: Small error with debug magi-removal with Komodo

2006-06-01 Thread Michael Radziej
mamcxyz wrote: > Pay attention to this hack: > > dispatcher.disconnect(create_superuser, sender=auth_app, > signal=signals.post_syncdb) Hey, what a cool idea. I resorted to redirect sys.stdin to skip superuser creation. Could it be that you call this for each unit test? Than it's bound

Small error with debug magi-removal with Komodo

2006-06-01 Thread mamcxyz
Ok, with the help of http://www.petersblog.org/node/1051 I was able to setup a decent debug sesion + unit testing setup I do this: #Clase sobre la cual basar los test... import unittest import sys import os SETTINGS_MODULE = 'settings' project_dir = os.path.abspath('../') sys.path.append(os.

Re: A little help with a filter

2006-06-01 Thread Chris Moffitt
> > Any chance that you're having a case problem? __exact is case > sensitive, while __iexact is case insensitive. > Thanks for the thought. I get the same behavior with iexact. If I run any of the 2 queries by themeselves, they return results. When chained together they do not. I also forgot

Re: A little help with a filter

2006-06-01 Thread Jay Parlar
On 6/2/06, Chris Moffitt <[EMAIL PROTECTED]> wrote: > > I feel like this should be simple but I'm struggling getting this to work > like I think it should. > > Here's the relevant model parts: > > class Item(models.Model): > category = models.ForeignKey(Category) > verbose_name = models.Ch

Re: Please help with project setup

2006-06-01 Thread Kristoffer
So, I have decided to use Docutils now, but I am a bit lost. How do I do this http://code.djangoproject.com/wiki/UsingMarkup with Docutils? Thanks, Kristoffer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djang

FREE sing up now .THE BEST

2006-06-01 Thread [EMAIL PROTECTED]
Dear member Looking for games,hardware,software, PCs, LAPTOPs, priders, Xbox, PS 2, 3, DS http://www.clubshop.com/cgi/appx.cgi/3440162 Sign up now for free and find the best prices and spesial offers. http://www.clubshop.com/cgi/appx.cgi/3440162 >1000 companies. DELL APPLE store HP SONY A

A little help with a filter

2006-06-01 Thread Chris Moffitt
I feel like this should be simple but I'm struggling getting this to work like I think it should. Here's the relevant model parts: class Item(models.Model): category = models.ForeignKey(Category) verbose_name = models.CharField("Full Name", maxlength=255) class OptionItem(models.Model):

import a model from a legacy database

2006-06-01 Thread coldas57
Hi all, I have recently added a legacy database on mysql to use with django. Now, I run python manage.py shell in order to become familiar with the database api. I am trying to run the first sentence: switch.get_list() and I receive the following error AtributeError: type object 'switch' has

Re: Rich Text Editor for BBCOde?

2006-06-01 Thread [EMAIL PROTECTED]
Scott Anderson wrote: > You're going to have to filter on the server side no matter what the browser > editor produces. ie. if you want to allow someone to post a link, you'll > still have to filter the href of the link posted via BBCode or someone can > just bypass the editor and post the cod

Re: Rich Text Editor for BBCOde?

2006-06-01 Thread Scott Anderson
On Thu, 2006-06-01 at 11:43 +, [EMAIL PROTECTED] wrote: > > All this may sound a bit (very?) paranoid for a small community portal > site. The large number of comment spamming, SPAM and exploits against > phpBB sites, etc. show that some people just don't play fair. You don't > really want th

Re: Improper quoting using extra() in Postgres

2006-06-01 Thread Scott Anderson
Great, thanks Adrian! Works perfectly, and man that was quick. ;-) Regards, -scott On Wed, 2006-05-31 at 23:49 -0500, Adrian Holovaty wrote: > On 5/31/06, Scott Anderson <[EMAIL PROTECTED]> wrote: > > The problem is that either Django or the driver is quoting the function > > instead of inserti

Re: update_object and preserving fields

2006-06-01 Thread Michael Radziej
Hi, I've followed your discussion only in parts. But I usually handle everything that is outside of the scope of the normal generic views inside the manipulator, and I have patched some generic views so that they accept a manipulator instance as additional parameter. (see ticket 1563 for patch).

Re: Controlling Display of Foreign Key Input Fieldsets in Admin

2006-06-01 Thread Paul Childs
Thanks Luke. I'm sure problem one is just a side effect of why two and three won't work. I'm still loving Django though! Cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: update_object and preserving fields

2006-06-01 Thread Marcin Kaszynski
viestards <[EMAIL PROTECTED]> writes: > I think this can help: > http://code.djangoproject.com/wiki/CookBookManipulatorWithPostpopulatedFields Not really. I know how to do this using my own view, but I was hoping to get another freebie from the generic views :) I guess I should simply patch th

Re: update_object and preserving fields

2006-06-01 Thread viestards
I think this can help: http://code.djangoproject.com/wiki/CookBookManipulatorWithPostpopulatedFields also look at Django Forms documentation On 5/30/06, Marcin Kaszynski <[EMAIL PROTECTED]> wrote: > > > Hello, > > is there a way to make update_object preserve values of some fields > without putt

Re: Wiki or Blogs done with django

2006-06-01 Thread Jarek Zgoda
Guillermo Fernandez Castellanos wrote: > I've been following the discussion with interest. I've seen that many > of you have concentrated on the actual code. But something I would > find also helpful/interesting is a "standard" model of blog. Or, to > push the idea further, a djangoforge of model

Re: Rich Text Editor for BBCOde?

2006-06-01 Thread [EMAIL PROTECTED]
Todd O'Bryan wrote: > Is it not sufficient to just look for

Re: Wiki or Blogs done with django

2006-06-01 Thread Guillermo Fernandez Castellanos
Hi, I've been following the discussion with interest. I've seen that many of you have concentrated on the actual code. But something I would find also helpful/interesting is a "standard" model of blog. Or, to push the idea further, a djangoforge of models. Often, the model is one of the parts th

Re: Rich Text Editor for BBCOde?

2006-06-01 Thread Todd O'Bryan
On Jun 1, 2006, at 7:05 AM, [EMAIL PROTECTED] wrote: > > I like the Django integration for the various rich text editors, and I > want to give my users the ability to post styled text -- i just don't > want to open the floodgates for all kinds of embedded HTML, with all > the potential exploitable

Rich Text Editor for BBCOde?

2006-06-01 Thread [EMAIL PROTECTED]
Hi. Does anyone know of a "fancy" rich text editor component which generates BBCode instead of HTML (or is customizable so that it can be tailored to generate BBCode)? Maybe even one for which there is a Django integration "Howto"? I like the Django integration for the various rich text editors,

Re: Admin password field

2006-06-01 Thread Todd O'Bryan
On May 30, 2006, at 9:58 AM, James Bennett wrote: > > On 5/30/06, stane <[EMAIL PROTECTED]> wrote: >> to create password open python shell >> import md5 >> md5.new('password').hexdigest() >> >> copy string into password field > > Or use the 'set_password' function defined in Django's au

Re: how to use instance method in the validator_list of a field in model?

2006-06-01 Thread favo
Luke Plant wrote: > On Wednesday 31 May 2006 07:36, favo wrote: > > somebody know how to use instance method in the validator_list of a > > field in model? I can't get the "self". > > > > class Category(models.Model): > > """ Inhert Category """ > > > > title_en = models.CharField(maxleng