Admin Functionality Enhancement

2006-05-05 Thread Chris Moffitt

I know there's been talk about changing/enhancing the admin interface 
but I'm not sure where my idea would fit.  One thing I've noticed is 
that as you add more models to the interface, it can get a little more 
confusing about how they're categorized.  What if we created the 
capability to define the category for each module, then displayed a menu 
in the admin to allow the users to select a specific category/option for 
viewing/editing the modules.

Using something like __category__ = "Blogs" in each model would add a 
link (along the menu bar?) to a blogs category which would contain all 
models related to blogs.  I think this would be useful but am curious 
what others think?  Obviously, it could default to the current behavior 
so it wouldn't be an issue for those that don't need it.  I suspect 
though that there are people out there with a dozen (or more) models 
that could benefit from this kind of feature to help make the admin site 
more manageable as it gets more complex.

I don't think I have the skills/knowledge to submit a patch but I could 
submit a ticket if folks think it might be helpful.  Let me know what 
you think.

-Chris

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Error creating SQL with string field containing a single quote.

2006-05-05 Thread evenrik

Using pre magic removal I got this error:

Exception Type: ProgrammingError
Exception Value:ERROR: unterminated quoted string at or near
"'F28T8/841 T8 4'' " at character 419 select count(a.id) from
uv2_applications as a inner join uv2_rebatableobjects as r on
a.ro_id=r.id inner join uv2_ro_lowwatt_cms as lwt on r.id=lwt.ro_id
inner join uv2_customers as c on a.c_id=c.id where a.objstate != 600
and a.id != 268 and c.address_hash = '46d2b9507ea1f13455675013b6cb0504'
and c.address_hash != '' and (lwt.model) = 'F28T8/841 T8 4''
Exception Location:
/usr/lib/python2.3/site-packages/django/core/db/base.py in execute,
line 9

The "model" field has the data F28T8/841 T8 4' that is creating the
error.
Has anyone a fix for this? For now I just changed the quote to ft in
the DB.


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django + fastCGI + bluehost

2006-05-05 Thread Rick

Hi,

James Crasta, over at django-developers talks about a patch he wrote to
django 0.95 for making  django work easily in a fastcgi environment.

See:
http://groups.google.com/group/django-developers/browse_thread/thread/eb7ddd45ec78883f/b3914435747e139c

He's intending to do a write up on it (hopefully soon).

Rick


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: auto_now_add bug with MySQL

2006-05-05 Thread Fernando Gutierrez Honorio

Petar,

how was your object added? I had that problem when using the create 
function and save, for example using the model:

class B(models.Model):
date = models.DateField(auto_now_add=True)
a = models.ForeignKey(A)

doing this considering "object" is an object of class A, this produces 
the error,

object.b_set.create().save()


but:


object.b_set.create()


does the trick, i think that the first one shouldn't be used, i left it 
like that while changing code to use the Magic-Removal version of 
django. I hope this also helps you.

--
Fernando Gutierrez H.
http://www.aureal.com.pe


Petar Marić wrote:
> class Paper(models.Model):
> # ...
> submited_on = models.DateField(
> auto_now_add=True,
> )
> # ...
>
> The above will spit out:
> Exception Type:   ValueError
> Exception Value:  year is out of range
> Exception Location:
>   C:\Dev\Python24\lib\site-packages\MySQLdb\connections.py in
> defaulterrorhandler, line 33
>
> The saved value of submited_on for the corresponding Paper is
> '-00-00' which is horribly wrong ;)
>
> I'm using MySQL 4.1.12a-nt and freshly baked django svn copy
> --
> Petar Marić
> *e-mail: [EMAIL PROTECTED]
> *mobile: +381 (64) 6122467
>
> *icq: 224720322
> *skype: petar_maric
> *web: http://www.petarmaric.com/
>
> >
>   


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



"Este DVD se autodestruirá en 48 horas"

2006-05-05 Thread stallone

"Este DVD se autodestruirá en 48 horas"

DVDs que se autodestruyen en 48 horas

Este viernes ha desembarcado en Italia un nuevo invento de la industria
cinematográfica para combatir las descargas ilegales en Internet. Es
un DVD en el que su información se borra pasadas 48 desde que se abre
la caja.  http://tuyyo.esp.cc El disco tiene un aspecto igual al
de los DVDs al uso, aunque en realidad contiene sustancias químicas
que en contacto con el aire, desatan un proceso de deterioro de la
superficie que contiene los datos y que finaliza pasadas 48 horas.
 http://tuyyo.esp.cc 
Al término de ese plazo, el DVD resulta ilegible en cualquier aparato
y podrá tirarse a la basura tranquilamente ya que es ecológico. La
cuenta atrás comienza en el momento en el que el comprador abre la
caja hermética de cartón, y a partir de ahí el disco comienza a
autodestruirse. Está previsto que se vendan las películas por unos 9
euros, y el público al que van dirigidos estos DVDs es precisamente la
gente que no tiene tiempo o ganas para ir al cine y que no están
suscritos a ningún videoclub. La idea ha sido llevada a cabo en
América y es  http://tuyyo.esp.cc en Italia el primer país
europeo en el que se empezarán a vender estos discos.
 P.D.: y digo yo, ¿quién se gasta 9 euros en algo que no
sirve para más de 2 días? no entiendo nada


--~--~-~--~~~---~--~~
Ha recibido este mensaje porque está suscrito a Grupos de Google "Django users" 
grupo.
 Si quiere publicar en este grupo, mande un correo electrónico a 
django-users@googlegroups.com
 Para anular la suscripción a este grupo, envíe un mensaje a [EMAIL PROTECTED]
 Para visualizar más opciones, visite este grupo 
enhttp://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Project Organization

2006-05-05 Thread Miles

Hi -

I'm relatively new to Django, and have a question about site & project
organization.

I have several sites that I'd like to develop using Django. Some of
these sites are "top-level" (site1.domain.com, site2.domain.com) and
some that fall under an existing hostname (site1.domain.com/subsite).

Most of the sites will be sharing the database.  Some of the tables
within the database will be shared among the sites, some tables will be
site-specific.

My first question is how to organize django projects and apps.  I'm
thinking of setting up each top-level site as a separate project,
duplicating db connection info in the various settings.py files, and
putting the site directories on the python path so one site can have
access to another site's models.  Does that make sense, or is there a
better way?

Second question - are there any resources on running multiple sites out
of one Django installation?  I see the sites table and site_id setting,
but haven't seen much about how best to use them.

thanks in advance,

Miles


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



auto_now_add bug with MySQL

2006-05-05 Thread Petar Marić
class Paper(models.Model):
# ...
submited_on = models.DateField(
auto_now_add=True,
)
# ...

The above will spit out:
Exception Type: ValueError
Exception Value:year is out of range
Exception Location:
C:\Dev\Python24\lib\site-packages\MySQLdb\connections.py in
defaulterrorhandler, line 33

The saved value of submited_on for the corresponding Paper is
'-00-00' which is horribly wrong ;)

I'm using MySQL 4.1.12a-nt and freshly baked django svn copy
--
Petar Marić
*e-mail: [EMAIL PROTECTED]
*mobile: +381 (64) 6122467

*icq: 224720322
*skype: petar_maric
*web: http://www.petarmaric.com/

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Jeremy Dunck

On 5/5/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> This is drifting waaay off topic but here's the short answer :)
> http://wiki.opendarwin.org/index.php/DarwinPorts:Getting_Started#Adding_DarwinPorts_to_your_Terminal.27s_path
> http://wiki.opendarwin.org/index.php/DarwinPorts:manually_setting_shell

And one more:
Unix Power Tools (explains path and loads more.)
http://www.amazon.com/gp/product/0596003307

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, jbrewer <[EMAIL PROTECTED]> wrote:
>
> How do I get things "on my path"?  Where is the file that points all
> this stuff together?

This is drifting waaay off topic but here's the short answer :)
http://wiki.opendarwin.org/index.php/DarwinPorts:Getting_Started#Adding_DarwinPorts_to_your_Terminal.27s_path
http://wiki.opendarwin.org/index.php/DarwinPorts:manually_setting_shell

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread jbrewer

How do I get things "on my path"?  Where is the file that points all
this stuff together?

Thanks for all the help guys


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Erro on access svn repository

2006-05-05 Thread Amit Upadhyay
On 5/6/06, Victor Godoy Poluceno <[EMAIL PROTECTED]> wrote:
Hello,This error occurred when having access the repository snv of developmentof django, for download of the current version of django.[[EMAIL PROTECTED] Django]$ svn co 
http://code.djangoproject.com/svn/django_src/svn: Requisição REPORT falhou em '/svn/!svn/vcc/default'svn: REPORT de '/svn/!svn/vcc/default': 400 Bad Request
(http://code.djangoproject.com)I'm sorry about my english.You are probably behind a (transparent?) proxy that does not  support HTTP REPORT required by svn. 
Get the latest code from http://www.amitu.com/django_mr.tar.gz, updated few minutes back. [I update this file every 12 hours from latest svn for my personal use, feel free to use this link.]
www.djangoprojects.com admins, can we have nightly svn builds please? -- Amit UpadhyayBlog: http://www.rootshell.be/~upadhyay
+91-9867-359-701
--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Max Battcher

Jeremy Dunck wrote:
> On 5/5/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> ...
> #Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.

You can thank Trac for that.  Apparently somebody forgot to tell them 
that it might be a good idea to truncate after so many characters just 
so that URLs don't get out of hand...  not to mention all the wasted 
characters sent in your HTTP responses and emails mentioning 
unrealistically long URLs.

-- 
--Max Battcher--
http://www.worldmaker.net/
"I'm gonna win, trust in me / I have come to save this world / and in 
the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track)

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Model Inheritance

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, Jason F. McBrayer <[EMAIL PROTECTED]> wrote:
>
> "Joseph Kocherhans" <[EMAIL PROTECTED]> writes:
>
> > Yeah, it hasn't been implemented yet. I'd be (pleasantly) surprised to
> > see it finished before the end of the summer. Your best bet is to use
> > ForeignKey and/or OneToOneField. It's probably not exactly what you
> > want, but it should work. Note that the semantics of OneToOneField are
> > going to change by the time inheritence is implemented, so you may
> > want to use ForeignKey instead.
>
> This is kind of painful for me, since one of my projects depends on
> overriding auth.User (to do ldap authentication).  I've been putting
> off my update to MR in order to think about what I want to do about
> this.
>
> It seems like for now my main options are to implement my own
> authentication scheme that doesn't integrate fully with Django's and
> which doesn't work with the auth pages (not _terribly_ important for
> this particular project), or to monkeypatch auth.User anywhere it
> might be used (evil).  Is that true, or is there something that I'm
> missing?

That sounds about right. I've been developing a new authentication
system for django since PyCon that allows for different or even
multiple backends... the api has been pretty unstable so far, but it's
getting close. I've written some docs, but I'm sure they could use
some more work. Now that magic-removal has been merged I'm going to
request a branch to finish it up. If you're interested in going that
route and providing feedback, I'll speed up my efforts. I have a patch
available you could use, but maintaining a patched version of django
is a PITA to put it lightly.

> Does it make more sense to base this project on the Floating Sargasso
> branch, or to take one of those desperate measures?

That would also work. It'd be better than mokeypatching IMO. If you
aren't using the admin system you're probably best off just rolling
your own authentication.

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Model Inheritance

2006-05-05 Thread Jason F. McBrayer

"Joseph Kocherhans" <[EMAIL PROTECTED]> writes:

> Yeah, it hasn't been implemented yet. I'd be (pleasantly) surprised to
> see it finished before the end of the summer. Your best bet is to use
> ForeignKey and/or OneToOneField. It's probably not exactly what you
> want, but it should work. Note that the semantics of OneToOneField are
> going to change by the time inheritence is implemented, so you may
> want to use ForeignKey instead.

This is kind of painful for me, since one of my projects depends on
overriding auth.User (to do ldap authentication).  I've been putting
off my update to MR in order to think about what I want to do about
this.

It seems like for now my main options are to implement my own
authentication scheme that doesn't integrate fully with Django's and
which doesn't work with the auth pages (not _terribly_ important for
this particular project), or to monkeypatch auth.User anywhere it
might be used (evil).  Is that true, or is there something that I'm
missing?

Does it make more sense to base this project on the Floating Sargasso
branch, or to take one of those desperate measures?

-- 
++
| Jason F. McBrayer [EMAIL PROTECTED]  |
|  "If you wish to make Pythocles wealthy, don't give him more   |
|   money; rather, reduce his desires."-- Epicurus   |

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Erro on access svn repository

2006-05-05 Thread Victor Godoy Poluceno

Hello,

This error occurred when having access the repository snv of development
of django, for download of the current version of django.

[EMAIL PROTECTED] Django]$ svn co http://code.djangoproject.com/svn/ 
django_src/
svn: Requisição REPORT falhou em '/svn/!svn/vcc/default'
svn: REPORT de '/svn/!svn/vcc/default': 400 Bad Request 
(http://code.djangoproject.com)

I'm sorry about my english.

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Andy Dustman

On 5/4/06, jbrewer <[EMAIL PROTECTED]> wrote:
>
> I have tried to install the MySQLdb and keep getting this error:
>
> error: command 'gcc' failed with exit status 1
>
> at the end of a bunch of stuff.

Yeah, that "bunch of stuff" just might be important. ya know. Keep in
mind you also would need MySQL installed, and that mysql_config must
be on your default PATH before building MySQLdb. Once you do that, it
seems to build correctly on Mac OS X.
--
The Pythonic Principle: Python works the way it does
because if it didn't, it wouldn't be Python.

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, jbrewer <[EMAIL PROTECTED]> wrote:
>
> If I just run "port install py-sqlite" I get a -bash: port - command
> not found. But if I use PortAuthority (GUI) then it does it.
>
> I am wondering if the darwin port folder is located in /opt/local/bin
> and the other stuff (svn, fcgi) is in /usr/local/bin how are these guys
> talking to eachother?

Yes, but I wouldn't stress about the details. darwinports keeps stuff
in /opt/local/bin so it doesn't clash with the existing system.

port didn't work because it's probably not on your path. The install
instructions for darwinports tell you how to fix that, but if you are
more comforatble with PortAuthority than with the terminal, I'd just
stick with PortAuthority.

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django + fastCGI + bluehost

2006-05-05 Thread [EMAIL PROTECTED]

Hi,

I ave the exact same problem.
I have also setup mod_fastcgi on my home box and then fired up my site
locally. Got the same error.

Please help


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread jbrewer

If I just run "port install py-sqlite" I get a -bash: port - command
not found. But if I use PortAuthority (GUI) then it does it.

I am wondering if the darwin port folder is located in /opt/local/bin
and the other stuff (svn, fcgi) is in /usr/local/bin how are these guys
talking to eachother?

Help!


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
>
> On Fri, May 05, 2006 at 06:23:48PM -, jbrewer wrote:
> > But when I used DarwinPorts of SQLite it installed Python 2.4 here:
> >
> > /opt/local/bin - and located here also is sqlite3
>
> Remember, I said to look at ALL of the comments from
> http://www.djangoproject.com/documentation/install/
>
> which includes:
>
> "Additional note on pysqlite 2.1.3 on Mac OSX. If you installed the
> newest sqlite3 via darwin ports, your header files and libraries are
> in /opt/local/include and /opt/local/lib respectively. Before you
> build/install pysqlite manually, you need to modify pysqlite's
> setup.cfg accordingly so that it will pick up on the new library
> instead of OSX's default sqlite 3.1.3 installation."

I just installed pysqlite via darwinports and it works fine. I don't
see any reason to build it from source unless you absolutely have to.

port install py-sqlite

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Glenn Tenney

On Fri, May 05, 2006 at 06:23:48PM -, jbrewer wrote:
> But when I used DarwinPorts of SQLite it installed Python 2.4 here:
> 
> /opt/local/bin - and located here also is sqlite3

Remember, I said to look at ALL of the comments from
http://www.djangoproject.com/documentation/install/

which includes:

"Additional note on pysqlite 2.1.3 on Mac OSX. If you installed the
newest sqlite3 via darwin ports, your header files and libraries are
in /opt/local/include and /opt/local/lib respectively. Before you
build/install pysqlite manually, you need to modify pysqlite's
setup.cfg accordingly so that it will pick up on the new library
instead of OSX's default sqlite 3.1.3 installation."

There are other comments about Mac OS X, and darwin ports of
sqllite... etc.  

Have you tried everything noted in all of those comments?


p.s.   This shows that a Mac OS X install section would sure be nice...

-- 
Glenn

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Jeremy Dunck

On 5/5/06, Steven Armstrong <[EMAIL PROTECTED]> wrote:
> > How do I remap this?

As well as Steven's suggestions, Learning Python covers module pathing
issues nicely.  :)

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Davide Bertola

Victor : in that post it says that _post_save() is called twice, I
tryed to create that _post_save() but I see nobody calls it.


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Jeremy Dunck

On 5/5/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
...
#Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.

Does the Guinness  book of records have an entry for "longest anchor"?  ;-)

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Steven Armstrong

On 05/05/06 20:23, jbrewer wrote:
> Okay when I am looking at the sitepath I have all my python stuff
> coming from here:
> 
> /System/Library/Frameworks/Python.framework/...
> 
> But when I used DarwinPorts of SQLite it installed Python 2.4 here:
> 
> /opt/local/bin - and located here also is sqlite3
> 
> How do I remap this?
> 

The file /opt/local/bin/sqlite3 is probably just the command line 
client, not the library.

Try searching your filesystem for a folder named 'pysqlite2'.

e.g.
find / -type d -name pysqlite2


Then create a path file in the systems python installation that points 
to your sqlite3 installation.

e.g. create a file:
/System/Library/Frameworks/Python.framework/pysqlite2.pth

which contains a line that points to the folder you found before. e.g.:
/path/to/folder/pysqlite2

hth
Steven

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, Davide Bertola <[EMAIL PROTECTED]> wrote:
>
> Victor : in that post it says that _post_save() is called twice, I
> tryed to create that _post_save() but I see nobody calls it.

_post_save is a hook method that was used before the magic-removal
branch was merged. Now you just override save() and call
super(MyModel, self).save() if necessary. See this for details:
http://code.djangoproject.com/wiki/RemovingTheMagic#Addedamorepowerfulwayofoverridingmodelmethodsremovedhardcoded_pre_save_post_saveetc.

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: create models from the admin page?

2006-05-05 Thread Glenn Tenney

On Fri, May 05, 2006 at 12:20:35PM -0500, James Bennett wrote:
> Keep in mind that's a wiki that *anyone* can contribute to, not just
> "official" developers ;)

And... because it's a wiki... have their contributions deleted too.
(mine were)

-- 
Glenn

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Detect SSL/HTTPS

2006-05-05 Thread Jakub Labath

Hi,

I have web server that is accessed both via http and https is there a
way for me to tell which is used?

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 group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Tutorial for MR

2006-05-05 Thread Luke Plant

On Friday 05 May 2006 11:39, Honza Král wrote:
> I agree, but at least it works...
> it would be nice to have this at least at a module level...

Yeah, I was thinking about doing that, or some other nice solution. 
Ideally it would handle it invisibly, but once you get into it, it's a 
slightly tricky problem...

Luke

-- 
"I think you ought to know I'm feeling very depressed." (Marvin the 
paranoid android)

Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread jbrewer

Okay when I am looking at the sitepath I have all my python stuff
coming from here:

/System/Library/Frameworks/Python.framework/...

But when I used DarwinPorts of SQLite it installed Python 2.4 here:

/opt/local/bin - and located here also is sqlite3

How do I remap this?


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread Victor Kropp

dade wrote:

> In my model I have something like this :
> 
> def Image(modes.Model):
> ...
> 
> def save(self):
> print "I've been called"
> ...
> super(Image, self).save()
> 
> I see in the console the print is executed 2 times when I upload the
> image from the admin interface. Is that a bug ? known one ?

Yes, it's a known bug (ticket #639). Same problem was discussed on this 
list just some hours ago. Take a look at 
http://groups.google.com/group/django-users/browse_thread/thread/21acd8811b94d8b6/34bcfd67fec8c444#34bcfd67fec8c444

-- 
VK

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: save() called 2 times.

2006-05-05 Thread arthur debert

yes this is a known bug.

see ticket 639
http://code.djangoproject.com/ticket/639

currently I'm using an ugly work around such as

def save(self):
if self.imagefield :
#do whetever, files does exist...

also this seems to cause problems withe DateFields with auto_now...


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



save() called 2 times.

2006-05-05 Thread dade

In my model I have something like this :

def Image(modes.Model):
...

def save(self):
print "I've been called"
...
super(Image, self).save()

I see in the console the print is executed 2 times when I upload the
image from the admin interface. Is that a bug ? known one ?


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: create models from the admin page?

2006-05-05 Thread falcon

It looks like I'm not the only one thinking about these ideas, Django
devs themselves have proposed  this as one of the ideas for SOC coders:
"create a project and super user with one command line statement, fire
up the development web server, and import/create/refine your model
using live data from directly within the django auto admin."
(http://code.djangoproject.com/wiki/SummerOfCode2006)


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Reminder: Summer of Code application period closes May 8th

2006-05-05 Thread Jacob Kaplan-Moss

Howdy folks --

A quick note: the Summer of Code application period closes in only  
three days!  We haven't received all that many applications yet, so  
if you turn in a good one you've got a very good chance that you'll  
be accepted.

So what are you waiting for? Get those applications in!

Jacob

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: syncdb

2006-05-05 Thread arthur debert

yes, syncdb is for current trunk (post magic removal).

please notice that if you're using 0.91, you can use the old
documentation from here:
http://www.djangoproject.com/documentation/0_91/

but if you're just getting started updating to the dev version is your
best bet.

cheers
arthur


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: syncdb

2006-05-05 Thread [EMAIL PROTECTED]

I am currently using 0.91.  I am going to get the latest Dev version
with sub version.  Then it should all work better?


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: list_filter not working properly?

2006-05-05 Thread arthur debert

yes, same thing here.

strangely enough, I have a model with a foreign key acting as a
list_fillter and it's fine.

another model (same app) list filters wont't work (foreign key or not)
.

this was working a little while ago.
still looking into it...


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: syncdb

2006-05-05 Thread Joseph Kocherhans

On 5/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I'm new so bear with me :)  What should I be using instead of
> "manage.py syncdb" for the DB stuff?  I am attempting to do the
> Tutorial on the site but i have noticed there have been changes to the
> Framework since the tutorial was made.

manage.py syncdb is actually new as of early this week. It replaces
manage.py init and manage.py install APP_NAME What version of Django
are you using?

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Model Inheritance

2006-05-05 Thread Joseph Kocherhans

On 5/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I want to use Model Inheritance, so I read this article
> http://code.djangoproject.com/wiki/ModelInheritance
> but it seems that it's only a proposal and has not been implemented,
> right?
> Does it mean that I can't use it at this time? What should I do?  TIA.

Yeah, it hasn't been implemented yet. I'd be (pleasantly) surprised to
see it finished before the end of the summer. Your best bet is to use
ForeignKey and/or OneToOneField. It's probably not exactly what you
want, but it should work. Note that the semantics of OneToOneField are
going to change by the time inheritence is implemented, so you may
want to use ForeignKey instead.

Joseph

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: standalone ORM

2006-05-05 Thread Todd O'Bryan

Excellent! Thanks!

Todd

On May 5, 2006, at 8:58 AM, [EMAIL PROTECTED] wrote:

>
> If you wish to use your Django ORM outside of Django context,
> you will need refine your PYTHONPATH and
> DJANGO_SETTINGS_MODULE env variables. From your outside-django
> script, you can do the following:
>
> import sys, os
> os.environ['DJANGO_SETTINGS_MODULE'] =
> 'your_django_project.settings'
> sys.path.append('path_to_your_django_projects_root')
>
> Basically 3 lines.


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



syncdb

2006-05-05 Thread [EMAIL PROTECTED]

Hey guys,

I'm new so bear with me :)  What should I be using instead of
"manage.py syncdb" for the DB stuff?  I am attempting to do the
Tutorial on the site but i have noticed there have been changes to the
Framework since the tutorial was made.

Thanks

Christopher


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: standalone ORM

2006-05-05 Thread [EMAIL PROTECTED]

If you wish to use your Django ORM outside of Django context,
you will need refine your PYTHONPATH and
DJANGO_SETTINGS_MODULE env variables. From your outside-django
script, you can do the following:

import sys, os
os.environ['DJANGO_SETTINGS_MODULE'] =
'your_django_project.settings'
sys.path.append('path_to_your_django_projects_root')

Basically 3 lines.

> On 5/5/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
> >
> > How possible is it to use the ORM part of Django separate from
> > everything else?
> You can freely use your apps in every way you need: web,
cli, gui or smth. else.
> Just instal django as usual, make your app, manage it with
manage.py,
> put it somewhere near python's sys.path and you can use that
nice
> models from everywhere in your python world just as you do
this in
> views.
> 
> > 
> 

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: standalone ORM

2006-05-05 Thread wiz
On 5/5/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>
> How possible is it to use the ORM part of Django separate from
> everything else?
You can freely use your apps in every way you need: web, cli, gui or smth. else.
Just instal django as usual, make your app, manage it with manage.py,
put it somewhere near python's sys.path and you can use that nice
models from everywhere in your python world just as you do this in
views.

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



standalone ORM

2006-05-05 Thread Todd O'Bryan

How possible is it to use the ORM part of Django separate from  
everything else?

I'm planning to use Django for a webapp, but I'm also working on a  
GUI app that has to connect to remote server for database access and  
other stuff. Can I leverage the Django ORM in the GUI server/client  
app, or is there just too much webapp overhead to bother trying it?

If the former, what do I need to make everything work?

Todd

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: list_filter not working properly?

2006-05-05 Thread Petar Marić
Hi Malcolm,

If you wish I could give you Trac access to my code - just e-mail me.

Regards,
PS: I too am using the latest svn code (rev. 2847 at this moment)
--
Petar Marić
*e-mail: [EMAIL PROTECTED]
*mobile: +381 (64) 6122467

*icq: 224720322
*skype: petar_maric
*web: http://www.petarmaric.com/

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Tutorial for MR

2006-05-05 Thread Honza Král
I agree, but at least it works...
it would be nice to have this at least at a module level...

On 5/5/06, DavidA <[EMAIL PROTECTED]> wrote:
>
> But for every model? Sounds a little kludgy to have to add that to
> every model just to break them into separate files.
>
>
> >
>


--
Honza Král
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: manipulate dictionnary in django's templates

2006-05-05 Thread Malcolm Tredinnick

On Fri, 2006-05-05 at 12:16 +0200, [EMAIL PROTECTED] wrote:
> > {% for data in mydict.items %}
> > key: {{ data.0 }}
> > value: {{ data.1 }}
> > {% endfor %}
> 
> Thanks for you answer ... but I still have a problem : how to do a real 
> dictionnary lookup.
> 
> Here is an example of what I'm trying to do : 
> 
> parent = {4 : 'parent1', 5 : 'parent2' }
> childs = { 4 : ['child1', child2], 5 : ['child3', 'child4'] }
> 
> {% for data in parent.items %}
> key: {{ data.0 }}
> value: {{ data.1 }}
>   
> {% endfor %}

Ah, now I see what you are trying do. You can't do this sort of thing
(indirectly using one variables value as a parameter to another). This
is intentional in Django in order to keep anything like "programming"
out of the templates and in your view function. If you need to combine
the "parent" and "child" dictionaries in some fashion, that munging
should occur in the Python code in your view.

Now, at this point, you are either thinking "that's insane" or "that
isn't an unreasonable thing to do to stop people going overboard in
templates". I happen to be in the latter camp (having worked with
languages that are more like PHP in the power they let you put in the
template and the maintenance hassle that results). But others are very
much in the former camp and that point of view has some validity, too.
If you really want to do this in a template, you could write a custom
template tag for it, or have a look at some existing custom tags
(limodou often posts custom tags to this list, and also have a look at
http://code.djangoproject.com/wiki/CookBookTemplateTags , in particular,
the CallTag).

Regards,
Malcolm


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: manipulate dictionnary in django's templates

2006-05-05 Thread zeuxis

> {% for data in mydict.items %}
> key: {{ data.0 }}
> value: {{ data.1 }}
> {% endfor %}

Thanks for you answer ... but I still have a problem : how to do a real 
dictionnary lookup.

Here is an example of what I'm trying to do : 

parent = {4 : 'parent1', 5 : 'parent2' }
childs = { 4 : ['child1', child2], 5 : ['child3', 'child4'] }

        {% for data in parent.items %}
            key: {{ data.0 }}
            value: {{ data.1 }}

        {% endfor %}

Regards,

Z.

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: manipulate dictionnary in django's templates

2006-05-05 Thread Malcolm Tredinnick

On Fri, 2006-05-05 at 11:46 +0200, [EMAIL PROTECTED] wrote:
> Hi all,
> 
> I've trouble to understand how it is possible to deal (i.e. work) with
> python dictionnaries in django templates
> 
> Say I have a dictionnary that is called mydict, how can I iterate
> through it's keys/values : I can get the keys ... 
> 
> {% for keys in mydict%}
> 
> {{ keys }}
> 
> {% endfor %}
> 
> ... but how can I get the values ? mydict.keys does not because (I
> guess) the lookup is for mydict['keys'] ...

Somebody else asked this exact question earlier today (and got an
answer). You use the "items" function to get back a tuple (assuming you
want both keys and values) and then reference the first and second
elements of the tuple:

{% for data in mydict.items %}
key: {{ data.0 }}
value: {{ data.1 }}
{% endfor %}

Regards,
Malcolm


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: list_filter not working properly?

2006-05-05 Thread Malcolm Tredinnick

Hi Petar,

On Fri, 2006-05-05 at 11:32 +0200, Petar Marić wrote:
> Anyone?

Sorry for the delay in responding; it can be frustrating when you're
beating your head against a problem like this.

Using the latest svn code (post magic-removal merge) and something based
on your example (DjangoUser is now User and imported from a different
location, was the main one), I saw filtering for the date-based field,
but nothing for the foreign key. So I am somewhere between what you are
seeing and what you expect to see. I should probably have time over the
weekend to look into this a bit more, particularly the lack of
ForeignKey filter display.

I'll post something more when I work out what's happening.

Regards,
Malcolm


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



manipulate dictionnary in django's templates

2006-05-05 Thread zeuxis

Hi all,

	I've trouble to understand how it is possible to deal (i.e. work) with python dictionnaries in django templates
	Say I have a dictionnary that is called mydict, how can I iterate through it's keys/values : I can get the keys ... 

{% for keys in mydict%}
{{ keys }}
{% endfor %}

	... but how can I get the values ? mydict.keys does not because (I guess) the lookup is for mydict['keys'] ...

Z.

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---



Re: list_filter not working properly?

2006-05-05 Thread Petar Marić
Anyone?

--
Petar Marić
*e-mail: [EMAIL PROTECTED]
*mobile: +381 (64) 6122467

*icq: 224720322
*skype: petar_maric
*web: http://www.petarmaric.com/

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Three models linked together: how do i do (...) ?

2006-05-05 Thread [EMAIL PROTECTED]

Let me refine the situation:
[model A] -> foreign key on [model B] -> foreign key on [model C]

When I create [Model A], it may only refer to any [model B]
that is attached to a specific [model C].

If I get it right, I should create a custom AddManipulator,
with  a [model C] as its parameter. A bit like this:

-
class MyAddManipulator(ModelA.AddManipulator):
  def __init__(self, model_c_id):
ModelA.AddManipulator.__init__(self)
for f in self.fields:
  if f.field_name == 'model_a_fk':
# Do specific query to create the custom SelecField
...
-

If this is the right way to do it:
- (how) may I make this manipulator the default AddManipulator
of my [model A] ?
- is it not a bit redundant? Initiating the default
manipulator with the list of [model B], then restricting that
list to a subset of [model B] ?

What is the 'coolest (django-like)' way to do it?
Documentation lacks information about
Models->Manipulators->Forms, I think.

Thanks for reading to that point...

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Field options validation only occur in admin interface?

2006-05-05 Thread Kilian CAVALOTTI

On Thursday 04 May 2006 18:41, James Bennett wrote:
> Per the model documentation, 'blank=False' does only apply when
> entering a value in the admin[1]. 

Well, "If a field has blank=True, validation on Django's admin site will allow 
entry of an empty value." was not explicit enough for me to understand that 
it was only the case in the admin interface. I assumed it would occur 
unconditionally, according to models properties, no matter what application 
objects are created in. Perhaps it would be worth to mention explicitly that 
this option has effect (for now) in the admin interface only.

> But that's not a very satisfying 
> answer, so here's a fuller explanation of what's going on in your
> examples:
>
> The key difference here is between 'blank=False', which applies only
> to the admin app, and 'null=False', which applies to the database. By
> default, a field's 'null' attribute is False, which means the DB
> column generated from the model will not accept a value of NULL. You'd
> think this would result in an error when you try to save any field
> with a null value, but this is actually dependent on the *type* of
> field, which is why there's an apparent inconsistency.
>
> A CharField translates to a Python string, which means that when you
> don't enter a value it translates to an empty string. Which, because
> it's not the value NULL, is accepted by the DB. An IntegerField,
> however, translates to a Python int, which does not have an "empty"
> variation as strings do, so I'd imagine that not filling it in results
> in conversion to... NULL. Which the DB rejects.

I had such an intuition, but your detailed explanation clarified it to me.  
Thanks.

> So long as you're only using the admin app to create objects, this
> will be fine, but if objects are going to be created from other views
> you'll want to set up a custom manipulator which raises an exception
> when the CharField is left blank or, if you're going to be creating
> objects programmatically as in your examples with the Python
> interpreter, you'll want to override the model's save() method to make
> it raise an exception when the incoming value for the CharField is an
> empty string

Right, it makes sense. However, I would continue to think that enforcing 
objects 'limitations' in the admin interface only could lead to mistakes. And 
that creating custom validation procedures for other views is an unneeded 
overhead for the developer: it could be done in the framework, since models 
already have many different types of properties, each with its own kind of 
limitation. So I would found natural to validate properties values when you 
do save() rather than only implement them in a specific application.

Don't misinterpret me here, it's not moronic criticism, I'm really amazed by 
django possibilities, and I'd only like to highlight the 'perfectionist' side 
of the motto. :)

Best regards,
-- 
Kilian CAVALOTTI  Administrateur réseaux et systèmes
UPMC / CNRS - LIP6 (C870)
8, rue du Capitaine Scott  Tel. : 01 44 27 88 54
75015 Paris - France   Fax. : 01 44 27 70 00

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: create models from the admin page?

2006-05-05 Thread julián

A web-based model editor is not an easy task. I think vi is the right
modeller tool (after a paper/pencil session)  or emacs if you're a
pianist.

For GUI-tools-aficionados I'd rather devote the effort to write code
generators for apps like umbrello
[http://uml.sourceforge.net/index.php]. A lot easier. A lot more
useful. 

j.


--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Field options validation only occur in admin interface?

2006-05-05 Thread Kilian CAVALOTTI

On Thursday 04 May 2006 18:29, Clint Ecker wrote:
> Check these threads out.  The short answer is, "it's coming." :)

Hey, great to know! 
Having recently dived into django, I was not aware of these discussions. 
Thanks for having pointed them out to me.

-- 
Kilian CAVALOTTI  Administrateur réseaux et systèmes
UPMC / CNRS - LIP6 (C870)
8, rue du Capitaine Scott  Tel. : 01 44 27 88 54
75015 Paris - France   Fax. : 01 44 27 70 00

--~--~-~--~~~---~--~~
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 to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---