Re: textarea, max_length and \r\n

2010-06-25 Thread eka (Esteban)
By now I made my own TextAreaField that will replace('\r\n', '\n') in
the to_python method



On Jun 25, 11:34 pm, "eka (Esteban)"  wrote:
> Hi all
>
> I created a form with a textarea that has a max_length of 1024, this
> textarea is rendered in frontend with a Javascript character counter,
> what is odd is that the counter was giving the right length, in this
> case 1024 and the form was failing in the max_length... debugging I
> came to see that the Form is receiving the \n as \r\n in the POST data
> for it.
> So the length if failing cause '\r\n' counts as 2 intead of 1.
>
> Searching on the internet I found out that it seems that the textarea
> sends \r\n instead of \n. Is there any way to deal with this in
> Django?
>
> For now I will remove the max_length and make my own clean method for
> this case.
>
> Regards
>
> Esteban

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



genstatic - Generate and maintain static HTML files with Django templates

2010-06-25 Thread Aaron Maxwell
Hi all,

Here is a GPLed software tool I made recently:

http://github.com/redsymbol/genstatic

Hope some of you find it useful and interesting.  Please let me know if you 
have any feedback.

Cheers,
Aaron

-- 
Aaron Maxwell
http://redsymbol.net/

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial problems

2010-06-25 Thread Michael Schade
As Gabriel mentioned, make sure you reran the server after making the
changes (though if using runserver, it should handle that for you). Also
make sure you did not miss this bit in the tutorial:

"Wait a minute.  is, utterly, an unhelpful representation
of this object. Let's fix that by editing the polls model (in the
polls/models.py file) and adding a
__unicode__()
method
to both Poll and Choice:"

class Poll(models.Model):
# ...
def __unicode__(self):
return self.question

Sincerely,
Michael Schade
Spearhead Development LLC

On Fri, Jun 25, 2010 at 5:54 PM, Gabriel Gayan wrote:

> Have you tried re-running the server after saving the changes?
> the tutorial worked perfectly for me.
>
> On Fri, Jun 25, 2010 at 1:16 PM, zippzom  wrote:
>
>> So, i'm working through the tutorial, but i'm having a problem with
>> the unicode method in the part 1 writing your own apps. I've copied
>> the code to the letter, but it still only returns 
>> instead . Any ideas why this could be happening?
>>
>> Sorry if this is the wrong place to post 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-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Gabriel Gayan
>
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



textarea, max_length and \r\n

2010-06-25 Thread eka (Esteban)
Hi all

I created a form with a textarea that has a max_length of 1024, this
textarea is rendered in frontend with a Javascript character counter,
what is odd is that the counter was giving the right length, in this
case 1024 and the form was failing in the max_length... debugging I
came to see that the Form is receiving the \n as \r\n in the POST data
for it.
So the length if failing cause '\r\n' counts as 2 intead of 1.

Searching on the internet I found out that it seems that the textarea
sends \r\n instead of \n. Is there any way to deal with this in
Django?

For now I will remove the max_length and make my own clean method for
this case.

Regards

Esteban

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial problems

2010-06-25 Thread Gabriel Gayan
Have you tried re-running the server after saving the changes?
the tutorial worked perfectly for me.

On Fri, Jun 25, 2010 at 1:16 PM, zippzom  wrote:

> So, i'm working through the tutorial, but i'm having a problem with
> the unicode method in the part 1 writing your own apps. I've copied
> the code to the letter, but it still only returns 
> instead . Any ideas why this could be happening?
>
> Sorry if this is the wrong place to post 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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Gabriel Gayan

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Looking for unavailable table?

2010-06-25 Thread Mark Linsey
I don't quite understand what changes you made before producing this error,
and I'm totally unfamiliar with sqllite.

But I do know that for many (really, most) different model changes, just
running syncdb will not make the appropriate changes to your tables.  You
probably need to look into south migrations.

On Fri, Jun 25, 2010 at 2:09 PM, Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:

> P.S. Renaming the (SQLite) database file and running syncdb again produces
> (basically) the same behavior. I had to do some initialization things again,
> but outside of that I got equivalent behavior to what I pasted below.
>
> What I am trying to do is create a few instances of the Entity model
> defined in my [directory/]models.py. So far I have managed to get them to
> show up as an option to manage in the admin interface, but not yet to save
> one.
>
> Should it be looking for directory_models_entity instead of
> directory_entity? "entity" seems not to be populated; from the command line
> sqlite3:
>
> sqlite> .tables
> auth_group  auth_user_user_permissions
> auth_group_permissions  django_admin_log
> auth_messagedjango_content_type
> auth_permission django_session
> auth_user   django_site
> auth_user_groups
>
> On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward <
> christos.jonathan.hayw...@gmail.com> wrote:
>
>> I received the error below from the admin interface; I thought it was
>> because I needed to run a syncdb, but stopping the server, running a syncdb,
>> and restarting has generated the same error:
>>
>> OperationalError at /admin/directory/entity/
>>
>> no such table: directory_entity
>>
>>  Request Method:GET Request URL:http://linux:8000/admin/directory/entity/ 
>> Exception
>> Type:OperationalError Exception Value:
>>
>> no such table: directory_entity
>>
>> Exception 
>> Location:/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py
>> in execute, line 193 Python Executable:/usr/bin/python Python Version:
>> 2.6.5 Python Path:['/home/jonathan/directory',
>> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
>> '/home/jonathan/store/src/satchmo/satchmo/apps',
>> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
>> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
>> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
>> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
>> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
>> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
>> '/usr/lib/python2.6/dist-packages/PIL',
>> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
>> '/usr/lib/python2.6/dist-packages/gtk-2.0',
>> '/usr/lib/pymodules/python2.6/gtk-2.0',
>> '/usr/local/lib/python2.6/dist-packages'] Server time:Fri, 25 Jun 2010
>> 14:56:26 -0500
>>
>> I have an Entity class/model defined in my models.py and want to manually
>> create some dummy data in the table. Any suggestions?
>>
>> --
>> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
>> → An Orthodox Christian author: theology, literature, et cetera.
>> → My award-winning collection is available for free reading online:
>> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>>
>
>
>
> --
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Why is ModelAdmin to Model a 1-1 relationship?

2010-06-25 Thread patjenk
In our application, we have a Model that has a boolean field named
"deleted". When the delete() method is called, we set the deleted
field to 1 and then save the model. We would like to create an admin
site where we can manage the deleted and non deleted instances
separately.

We could accomplish our goal by defining a queryset function for the
ModelAdmin that restricts the instances returned to deleted=0.
However, AFAIK this would eliminate the ability to undelete instances
via the admin. Another option is to allow all instances to be shown
and include delete as a value in the list_filter list for the admin
but that clutters up our UI and requires an extra click. It would be
nice if we could specify that the default admin view for this model
has a list_filter of deleted=0 but I don't think this is currently
possible.

I think a good solution would be to create two ModelAdmins. One to
display active instances and one to display deleted instances. With
this approach we could define a queryset function for each ModelAdmin
and when an instance is deleted it would automatically move to the
correct ModelAdmin. This is explicitly denied in django/contrib/admin/
sites.py. Simply removing this check does not solve our problem but
overwrites the first ModelAdmin for the model with the second via the
dictionary "_registered" in the AdminSite class. From my brief dive
into the admin site, there doesn't appear to be a real need for a one
to one relationship between ModelAdmins and Models. If you allowed
ModelAdmins to specify their own name I think it would be possible to
have more than one ModelAdmin for a Model. I am not a Django expert
but I don't see a reason that this scenario should be excluded.

Can anyone recommend a way to accomplish either of the approaches I
outlined above or propose a new approach that does not violate the
AdminSite rules? Also, if anyone knows why the ModelAdmin needs to
have a one to one relationship with Model please let me know.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tutorial problems

2010-06-25 Thread Bradley Hintze
Hi all,

I just installed Django using MacPorts on snow leopard and
django-admin.py cannot be found anywhere on my computer, thus I cant
do the tutorial. Also, the recommendation was given to place
/opt/local/lib/python2.4/site-packages/django/bin in a $PATH but that
given path is non-existant on my computer.

any idea?

-- 
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Looking for unavailable table?

2010-06-25 Thread Oleg Lomaka
Actually it depends on your PYTHONPATH. syncdb scans all modules from 
INSTALLED_APPS looking for models.py in them to populate database. So if you 
access you Entity model (for example at views.py) as 
from directory.models import Entity
then add 'directory' to INSTALLED_APPS.


On Jun 26, 2010, at 1:49 AM, Jonathan Hayward wrote:

> No; that sounds like the issue then?
> 
> If my project directory is named "directory", and I want to access the 
> "Entity" model in "models.py", what do I add to INSTALLED_APPS? I'm guessing 
> something like "directory", but I briefly searched online and couldn't tell.
> 
> On Fri, Jun 25, 2010 at 5:35 PM, Oleg Lomaka  wrote:
> 
> Did you add your application to INSTALLED_APPS before running syncdb?
> 
> On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote:
> 
> > P.S. Renaming the (SQLite) database file and running syncdb again produces 
> > (basically) the same behavior. I had to do some initialization things 
> > again, but outside of that I got equivalent behavior to what I pasted below.
> >
> > What I am trying to do is create a few instances of the Entity model 
> > defined in my [directory/]models.py. So far I have managed to get them to 
> > show up as an option to manage in the admin interface, but not yet to save 
> > one.
> >
> > Should it be looking for directory_models_entity instead of 
> > directory_entity? "entity" seems not to be populated; from the command line 
> > sqlite3:
> >
> > sqlite> .tables
> > auth_group  auth_user_user_permissions
> > auth_group_permissions  django_admin_log
> > auth_messagedjango_content_type
> > auth_permission django_session
> > auth_user   django_site
> > auth_user_groups
> >
> > On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward 
> >  wrote:
> > I received the error below from the admin interface; I thought it was 
> > because I needed to run a syncdb, but stopping the server, running a 
> > syncdb, and restarting has generated the same error:
> >
> > OperationalError at /admin/directory/entity/
> > no such table: directory_entity
> > Request Method:   GET
> > Request URL:  http://linux:8000/admin/directory/entity/
> > Exception Type:   OperationalError
> > Exception Value:
> > no such table: directory_entity
> > Exception Location:   
> > /usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py in execute, 
> > line 193
> > Python Executable:/usr/bin/python
> > Python Version:   2.6.5
> > Python Path:  ['/home/jonathan/directory', 
> > '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg', 
> > '/home/jonathan/store/src/satchmo/satchmo/apps', 
> > '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
> >  
> > '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
> >  '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg', 
> > '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', 
> > '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', 
> > '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', 
> > '/usr/lib/python2.6/dist-packages/PIL', 
> > '/usr/lib/python2.6/dist-packages/gst-0.10', 
> > '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', 
> > '/usr/lib/pymodules/python2.6/gtk-2.0', 
> > '/usr/local/lib/python2.6/dist-packages']
> > Server time:  Fri, 25 Jun 2010 14:56:26 -0500
> >
> > I have an Entity class/model defined in my models.py and want to manually 
> > create some dummy data in the table. Any suggestions?
> >
> 
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> 
> -- 
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
No; that sounds like the issue then?

If my project directory is named "directory", and I want to access the
"Entity" model in "models.py", what do I add to INSTALLED_APPS? I'm guessing
something like "directory", but I briefly searched online and couldn't tell.

On Fri, Jun 25, 2010 at 5:35 PM, Oleg Lomaka  wrote:

>
> Did you add your application to INSTALLED_APPS before running syncdb?
>
> On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote:
>
> > P.S. Renaming the (SQLite) database file and running syncdb again
> produces (basically) the same behavior. I had to do some initialization
> things again, but outside of that I got equivalent behavior to what I pasted
> below.
> >
> > What I am trying to do is create a few instances of the Entity model
> defined in my [directory/]models.py. So far I have managed to get them to
> show up as an option to manage in the admin interface, but not yet to save
> one.
> >
> > Should it be looking for directory_models_entity instead of
> directory_entity? "entity" seems not to be populated; from the command line
> sqlite3:
> >
> > sqlite> .tables
> > auth_group  auth_user_user_permissions
> > auth_group_permissions  django_admin_log
> > auth_messagedjango_content_type
> > auth_permission django_session
> > auth_user   django_site
> > auth_user_groups
> >
> > On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward <
> christos.jonathan.hayw...@gmail.com> wrote:
> > I received the error below from the admin interface; I thought it was
> because I needed to run a syncdb, but stopping the server, running a syncdb,
> and restarting has generated the same error:
> >
> > OperationalError at /admin/directory/entity/
> > no such table: directory_entity
> > Request Method:   GET
> > Request URL:  http://linux:8000/admin/directory/entity/
> > Exception Type:   OperationalError
> > Exception Value:
> > no such table: directory_entity
> > Exception Location:
> /usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py in execute,
> line 193
> > Python Executable:/usr/bin/python
> > Python Version:   2.6.5
> > Python Path:  ['/home/jonathan/directory',
> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
> '/home/jonathan/store/src/satchmo/satchmo/apps',
> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
> '/usr/lib/python2.6/dist-packages/PIL',
> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
> '/usr/lib/python2.6/dist-packages/gtk-2.0',
> '/usr/lib/pymodules/python2.6/gtk-2.0',
> '/usr/local/lib/python2.6/dist-packages']
> > Server time:  Fri, 25 Jun 2010 14:56:26 -0500
> >
> > I have an Entity class/model defined in my models.py and want to manually
> create some dummy data in the table. Any suggestions?
> >
>
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Looking for unavailable table?

2010-06-25 Thread Oleg Lomaka

Did you add your application to INSTALLED_APPS before running syncdb?

On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote:

> P.S. Renaming the (SQLite) database file and running syncdb again produces 
> (basically) the same behavior. I had to do some initialization things again, 
> but outside of that I got equivalent behavior to what I pasted below.
> 
> What I am trying to do is create a few instances of the Entity model defined 
> in my [directory/]models.py. So far I have managed to get them to show up as 
> an option to manage in the admin interface, but not yet to save one.
> 
> Should it be looking for directory_models_entity instead of directory_entity? 
> "entity" seems not to be populated; from the command line sqlite3:
> 
> sqlite> .tables
> auth_group  auth_user_user_permissions
> auth_group_permissions  django_admin_log  
> auth_messagedjango_content_type   
> auth_permission django_session
> auth_user   django_site   
> auth_user_groups  
> 
> On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward 
>  wrote:
> I received the error below from the admin interface; I thought it was because 
> I needed to run a syncdb, but stopping the server, running a syncdb, and 
> restarting has generated the same error:
> 
> OperationalError at /admin/directory/entity/
> no such table: directory_entity
> Request Method:   GET
> Request URL:  http://linux:8000/admin/directory/entity/
> Exception Type:   OperationalError
> Exception Value:  
> no such table: directory_entity
> Exception Location:   
> /usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py in execute, 
> line 193
> Python Executable:/usr/bin/python
> Python Version:   2.6.5
> Python Path:  ['/home/jonathan/directory', 
> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg', 
> '/home/jonathan/store/src/satchmo/satchmo/apps', 
> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
>  
> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg', 
> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg', 
> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', 
> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', 
> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', 
> '/usr/lib/python2.6/dist-packages/PIL', 
> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', 
> '/usr/lib/python2.6/dist-packages/gtk-2.0', 
> '/usr/lib/pymodules/python2.6/gtk-2.0', 
> '/usr/local/lib/python2.6/dist-packages']
> Server time:  Fri, 25 Jun 2010 14:56:26 -0500
> 
> I have an Entity class/model defined in my models.py and want to manually 
> create some dummy data in the table. Any suggestions?
> 

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
P.S. Renaming the (SQLite) database file and running syncdb again produces
(basically) the same behavior. I had to do some initialization things again,
but outside of that I got equivalent behavior to what I pasted below.

What I am trying to do is create a few instances of the Entity model defined
in my [directory/]models.py. So far I have managed to get them to show up as
an option to manage in the admin interface, but not yet to save one.

Should it be looking for directory_models_entity instead of
directory_entity? "entity" seems not to be populated; from the command line
sqlite3:

sqlite> .tables
auth_group  auth_user_user_permissions
auth_group_permissions  django_admin_log
auth_messagedjango_content_type
auth_permission django_session
auth_user   django_site
auth_user_groups

On Fri, Jun 25, 2010 at 3:00 PM, Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:

> I received the error below from the admin interface; I thought it was
> because I needed to run a syncdb, but stopping the server, running a syncdb,
> and restarting has generated the same error:
>
> OperationalError at /admin/directory/entity/
>
> no such table: directory_entity
>
>  Request Method:GET Request URL:http://linux:8000/admin/directory/entity/ 
> Exception
> Type:OperationalError Exception Value:
>
> no such table: directory_entity
>
> Exception 
> Location:/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py
> in execute, line 193 Python Executable:/usr/bin/python Python Version:
> 2.6.5 Python Path:['/home/jonathan/directory',
> '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
> '/home/jonathan/store/src/satchmo/satchmo/apps',
> '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
> '/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
> '/usr/lib/python2.6/dist-packages/PIL',
> '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
> '/usr/lib/python2.6/dist-packages/gtk-2.0',
> '/usr/lib/pymodules/python2.6/gtk-2.0',
> '/usr/local/lib/python2.6/dist-packages'] Server time:Fri, 25 Jun 2010
> 14:56:26 -0500
>
> I have an Entity class/model defined in my models.py and want to manually
> create some dummy data in the table. Any suggestions?
>
> --
> → Jonathan Hayward, christos.jonathan.hayw...@gmail.com
> → An Orthodox Christian author: theology, literature, et cetera.
> → My award-winning collection is available for free reading online:
> ☩ I invite you to visit my main site at http://JonathansCorner.com/
>



-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
I received the error below from the admin interface; I thought it was
because I needed to run a syncdb, but stopping the server, running a syncdb,
and restarting has generated the same error:

OperationalError at /admin/directory/entity/

no such table: directory_entity

Request Method:GETRequest
URL:http://linux:8000/admin/directory/entity/Exception
Type:OperationalErrorException Value:

no such table: directory_entity

Exception 
Location:/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py
in execute, line 193Python Executable:/usr/bin/pythonPython Version:2.6.5Python
Path:['/home/jonathan/directory',
'/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg',
'/home/jonathan/store/src/satchmo/satchmo/apps',
'/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/django_signals_ahoy-0.1_1-py2.6.egg',
'/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg',
'/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.6/gtk-2.0',
'/usr/local/lib/python2.6/dist-packages']Server time:Fri, 25 Jun 2010
14:56:26 -0500

I have an Entity class/model defined in my models.py and want to manually
create some dummy data in the table. Any suggestions?

-- 
→ Jonathan Hayward, christos.jonathan.hayw...@gmail.com
→ An Orthodox Christian author: theology, literature, et cetera.
→ My award-winning collection is available for free reading online:
☩ I invite you to visit my main site at http://JonathansCorner.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Change password form doesn't work in Admin page

2010-06-25 Thread Pedro I. Sanchez

Hello,

When I visit the User change form in the admin pages I get a link under 
the password field that says:


Use '[algo]$[salt]$[hexdigest]' or use the 

 is a link to 
http://127.0.0.1:8000/admin/auth/user/6/password/ and when I click on it 
I get the error:


"user object with primary key u'6/password' does not exist."

I am not sure if it is related but I am using user profiles as follows:

1. In mysite.profile.models

from django.db import models
from django.contrib.auth.models import User

class UserProfile(models.Model):
user = models.OneToOneField(User)
other_stuff = models.CharField(max_length=255)

2. In mysite.app.admin.py

from django.contrib import admin
from django.contrib.auth.models import User
from mysite.profile.models import UserProfile

class UserProfileInline(admin.StackedInline):
model = UserProfile

class UserProfileAdmin(admin.ModelAdmin):
inlines = [UserProfileInline]

admin.site.unregister(User)
admin.site.register(User, UserProfileAdmin)

I would appreciate any suggestions on how to fix this problem.

Thank you,

--
Pedro

--
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Rendering the Admin app list?

2010-06-25 Thread raj

> Before I "pass the variable app_list"; do I not need to create what is
> in this variable first?  If so, how?

That template is rendered by the view, AdminSite.index() found at
django.contrib.admin.sites. Please Check it to know how it's done.

Rajeesh.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Localized admin and date field formats

2010-06-25 Thread Jeliuc Alexandr
Yes, You are right it was this patch.

On un 25, 3:36 pm, "Danny W. Adair"  wrote:
> Hi Alexander,
>
> On Jun 15, 9:54 am, Alexander Jeliuc  wrote:
>
> > Thank You, I found a patch for that. My version is already 1.2.1
> > After pathching fields.py and widgets.py it start working fine
>
> It helps others if you mention where they can find such a patch.
> I assume it was this:http://code.djangoproject.com/ticket/13621
>
> Cheers,
> Danny
>
>
>
>
>
> > On Tue, Jun 15, 2010 at 12:49 AM, D3f0  wrote:
> > > Hi
> > > There's been a slighty change in 1.2, take a look at:
> > >http://docs.djangoproject.com/en/dev/ref/settings/#date-input-formats
>
> > > Nahuel
>
> > > On 13 jun, 09:00, Jeliuc Alexandr  wrote:
> > > > Hello.
> > > > I'm using django1.2.1 with i18n and l10n enabled...
>
> > > > standart django admin date format is mm-dd-
> > > > when it changes to Spain it becomes dd/mm/
> > > > Not problem it is possible to choice date and save it...
> > > > But if I want to edit row it becomes like standart mm-dd-...
> > > > No problem... but if I edit row and want to save. I got error - wrong
> > > > date format...
>
> > > > Question is: How can I change date field format in admin edit form
> > > > action? to be like it should be dd/mm/?
> > > > Is it bug?
>
> > > --
> > > 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...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com > >  groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



manytomany relationships based on primary keys

2010-06-25 Thread thusjanthan
I have the following relationship between student and course:

class Student(models.Model):
crse_id = models.CharField(max_length=18,primary_key=True)
crse_offer_nbr = models.IntegerField(primary_key=True)
strm = models.CharField(max_length=12,primary_key=True)
class_section = models.CharField(max_length=12,primary_key=True)
student = models.CharField(max_length=15)

class Meta:
db_table = u'class_stdnts'

class Course(models.Model):
crse_id = models.CharField(max_length=18, primary_key=True)
crse_offer_nbr = models.IntegerField(primary_key=True)
strm = models.CharField(max_length=12, primary_key=True)
class_section = models.CharField(max_length=12, primary_key=True)

   #many to many fields
students = models.ManyToManyField(Student)

class Meta:
db_table = u'class_tbl'

When I do a query to get all the students such as follows:


>>> course = sims.Course.objects.filter(...)
>>> for c in course:
... for s in c.students.all():
... print s.student

I get the following error:

DatabaseError: (1146, "Table 'class_tbl_students' doesn't exist")

I figure doing a manytomany join will automatically join based on the
primary keys but when I also look at the query its running its doing
something like this:

Query:
SELECT `class_stdnts`.`crse_id`, `class_stdnts`.`strm`,
`class_stdnts`.`class_section`, `class_stdnts`.`student` FROM
`class_stdnts` INNER JOIN `class_tbl_students` ON
(`class_stdnts`.`crse_offer_nbr` = `class_tbl_students`.`student_id`)
WHERE `class_tbl_students`.`course_id` = 1


Any Thoughts?
Nathan.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django csrf

2010-06-25 Thread thusjanthan
The quick answer is you have to put the following in your template
right after the  declaration:

 {% csrf_token %}

Cheers,
Nathan.


On Jun 25, 2:48 am, Li Hui  wrote:
> When I add enctype="text/plain" to a post form like  method="post" enctype="text/plain">, there is a "CSRF verification
> failed." error.
> But when I remove it, all is right.
> Who can tell me why?

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tutorial problems

2010-06-25 Thread zippzom
So, i'm working through the tutorial, but i'm having a problem with
the unicode method in the part 1 writing your own apps. I've copied
the code to the letter, but it still only returns 
instead . Any ideas why this could be happening?

Sorry if this is the wrong place to post 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



New project, debating postgresql or MySQL (Amazon RDS), does it matter to Django?

2010-06-25 Thread Eric Chamberlain
Hello,

We have a new project and are debating whether to use postrgresql (Amazon EC2) 
or MySQL with InnoDB tables (Amazon RDS).  It looks like our TCO would be much 
lower using Amazon RDS.

Our past Django experience has been with postgresql, does MySQL InnoDB have any 
problems with Django's transaction middleware?

We aren't using any custom fields, are there functional differences between the 
two databases that would impact how we use Django?  

--
Eric Chamberlain






-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: can't adapt type 'Decimal'

2010-06-25 Thread poupou
Yes I'm running two sites on the same server.  Only difference with
you is that I'm running it with virtual host.

I modifier my Apache config, now it looks like this :


  ServerName  site1.com
  WSGIDaemonProcess site1
  WSGIScriptAlias / /var/www/site1.wsgi process-group=site1
application-group=%{GLOBAL}




  ServerName  site2.com
  WSGIDaemonProcess site2
  WSGIScriptAlias / /var/www/site2.wsgi process-group=site2
application-group=%{GLOBAL}



It will take a little to make sure it's working, I will report on this
thread if everything is ok.

Thank you!

On 25 juin, 10:51, Stuart  wrote:
> On Jun 25, 8:06 am, poupou  wrote:
>
>
>
> >   Of the 2 web site that I have, It only happens where I make request
> > using the the Q objects.
>
> If you have two django sites/projects on the same server 
> (e.g.http://myserver/app1andhttp://myserver/app2) and you are using
> mod_wsgi, I bet you're having the same problem I was. To fix it,
> upgrade to the latest version of mod_wsgi and run it in daemon mode.
> See here for 
> details:http://groups.google.com/group/satchmo-users/msg/a9b22c236d63c323
>
> Hope that helps,
>
> --Stuart

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



list_editable and save changes to individual row/cell

2010-06-25 Thread Jason Wang
Hi all,

Does anyone know if there is a way to save changes on a per row/cell
basis for forms with list_editable in django admin? I would like to
have a button for each row and each cell to do that.

Thanks a lot!

Jason

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Jaspersoft or Pentaho with Django?

2010-06-25 Thread zweb
Has anyone used Jaspersoft or Pentaho with DJango or Python in
production?

Are there any Python equivalent of Jaspersoft/Pentaho?

Any experiences?

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: generate localized message

2010-06-25 Thread Felippe Bueno
I think you need to install gettext package.

On Fri, Jun 25, 2010 at 1:23 PM, Thomas Lionel Smets wrote:

> My django application root directory on my Mac is :
> /Users/tsmets/Documents/python//
> Under that folder I have the following directory structure :
>
> Thomas-SMETSs-MacBook-Pro: tsmets$ find .  -d 1
>
> ./.svn
> ./__init__.py
> ./Base
> ./clean_unused.sh
> ./constants.py
> ./fixtures
> ./formats
> ./Health
> ./InfoAndNews
> ./load_data.sh
> ./locale
> ./logging.conf
> ./manage.py
> ./scripts
> ./settings.py
> ./Sport
> ./templates
> ./test_constants.py
> ./urls.py
> ...
>
> with as Django module : Base / Health / InfoAndNews / Sport
>
>
> After struggling a bit (it is always good), I exported teh following
> variable :
> DJANGO_SETTINGS_MODULE=/Users/tsmets/Documents/python//
>
>
> Now, when I run the command to generate the message
>
> 
> Thomas-SMETSs-MacBook-Pro: tsmets$ django-admin.py  makemessages -v 2
> -a
> examining files with the extensions: .html
> processing language ca
> ignoring file all-wcprops in ./.svn
> ignoring file entries in ./.svn
> ignoring file __init__.py.svn-base in ./.svn/prop-base
> ignoring file clean_unused.sh.svn-base in ./.svn/prop-base
> ignoring file constants.py.svn-base in ./.svn/prop-base
> ignoring file load_data.sh.svn-base in ./.svn/prop-base
> ignoring file logging.conf.svn-base in ./.svn/prop-base
> ignoring file manage.py.svn-base in ./.svn/prop-base
> ignoring file settings.py.svn-base in ./.svn/prop-base
> ignoring file urls.py.svn-base in ./.svn/prop-base
> ignoring file __init__.py.svn-base in ./.svn/text-base
> ignoring file clean_unused.sh.svn-base in ./.svn/text-base
> ignoring file constants.py.svn-base in ./.svn/text-base
> ignoring file load_data.sh.svn-base in ./.svn/text-base
> ignoring file logging.conf.svn-base in ./.svn/text-base
> ignoring file manage.py.svn-base in ./.svn/text-base
> ignoring file settings.py.svn-base in ./.svn/text-base
> ignoring file urls.py.svn-base in ./.svn/text-base
> processing file __init__.py in .
> Error: errors happened while running xgettext on __init__.py
> /bin/sh: xgettext: command not found
>
> Thomas-SMETSs-MacBook-Pro: tsmets$ xgettext
> xgettext.plxgettext5.10.0.pl  xgettext5.8.9.pl
>
> 
>
>
>
>
> Any idea ... what's wrong  ?
>
> \T,
>
>
>
>
> --
> Thomas SMETS
> rue J. Wytsmanstraat 62
> 1050 Brussels
> m. : +32 497 44 68 12
> W : http://genealogy.tsmets.lautre.net
> skype : tsmets
>
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



generate localized message

2010-06-25 Thread Thomas Lionel Smets
My django application root directory on my Mac is :
/Users/tsmets/Documents/python//
Under that folder I have the following directory structure :

Thomas-SMETSs-MacBook-Pro: tsmets$ find .  -d 1

./.svn
./__init__.py
./Base
./clean_unused.sh
./constants.py
./fixtures
./formats
./Health
./InfoAndNews
./load_data.sh
./locale
./logging.conf
./manage.py
./scripts
./settings.py
./Sport
./templates
./test_constants.py
./urls.py
...

with as Django module : Base / Health / InfoAndNews / Sport


After struggling a bit (it is always good), I exported teh following variable :
DJANGO_SETTINGS_MODULE=/Users/tsmets/Documents/python//


Now, when I run the command to generate the message


Thomas-SMETSs-MacBook-Pro: tsmets$ django-admin.py  makemessages -v 2 -a
examining files with the extensions: .html
processing language ca
ignoring file all-wcprops in ./.svn
ignoring file entries in ./.svn
ignoring file __init__.py.svn-base in ./.svn/prop-base
ignoring file clean_unused.sh.svn-base in ./.svn/prop-base
ignoring file constants.py.svn-base in ./.svn/prop-base
ignoring file load_data.sh.svn-base in ./.svn/prop-base
ignoring file logging.conf.svn-base in ./.svn/prop-base
ignoring file manage.py.svn-base in ./.svn/prop-base
ignoring file settings.py.svn-base in ./.svn/prop-base
ignoring file urls.py.svn-base in ./.svn/prop-base
ignoring file __init__.py.svn-base in ./.svn/text-base
ignoring file clean_unused.sh.svn-base in ./.svn/text-base
ignoring file constants.py.svn-base in ./.svn/text-base
ignoring file load_data.sh.svn-base in ./.svn/text-base
ignoring file logging.conf.svn-base in ./.svn/text-base
ignoring file manage.py.svn-base in ./.svn/text-base
ignoring file settings.py.svn-base in ./.svn/text-base
ignoring file urls.py.svn-base in ./.svn/text-base
processing file __init__.py in .
Error: errors happened while running xgettext on __init__.py
/bin/sh: xgettext: command not found

Thomas-SMETSs-MacBook-Pro: tsmets$ xgettext
xgettext.plxgettext5.10.0.pl  xgettext5.8.9.pl






Any idea ... what's wrong  ?

\T,




--
Thomas SMETS
rue J. Wytsmanstraat 62
1050 Brussels
m. : +32 497 44 68 12
W : http://genealogy.tsmets.lautre.net
skype : tsmets

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: can't adapt type 'Decimal'

2010-06-25 Thread Stuart
On Jun 25, 8:06 am, poupou  wrote:
>
>   Of the 2 web site that I have, It only happens where I make request
> using the the Q objects.
>

If you have two django sites/projects on the same server (e.g.
http://myserver/app1 and http://myserver/app2) and you are using
mod_wsgi, I bet you're having the same problem I was. To fix it,
upgrade to the latest version of mod_wsgi and run it in daemon mode.
See here for details: 
http://groups.google.com/group/satchmo-users/msg/a9b22c236d63c323


Hope that helps,

--Stuart

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Using PostgreSQL Blob from Django

2010-06-25 Thread SlafS
Lately i found the django-storages app and DatabaseStorage[1]
Haven't test it though. But using custom storage along with Django
FileField seems like a good idea.

Regards

Sławek

[1] http://code.welldev.org/django-storages/wiki/DatabaseStorage

On 25 Cze, 04:26, Kenneth Gonsalves  wrote:
> On Friday 25 June 2010 05:19:36 Daniel Espinosa Ortiz wrote:
>
> > I have a PHP application using PostgreSQL backend. I'm storing files
> > on the database. I have different tables with a file (OID), filename
> > and mime to detect the row's associated file. I'm trying to port this
> > application to django.
>
> > How Can Use this blob with django? Exist some suggestions about it?
>
> a. write a script to store the blobs on the file system and insert the 
> filename
> into the db which is how django handles blobs
>
> b. write a custom field to handle this
>
> I suggest you do 'a' as then all the django and django addon file/image
> handling functions will be available to you.
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Admin Media output order?

2010-06-25 Thread ringemup

Hehe, I'm actually using a bastardized custom admin class to handle
the actual display of the app list.

It seems odd to me that there's no way to control the order in which
admin media are output, since javascript is sensitive to the order in
which it's specified.  It means that in order to override the behavior
of a widget, you have to either override the template or jump through
hoops to delay when your javascript runs, rather than just adding a
custom script to your ModelAdmin.

On Jun 25, 3:32 am, iliveinapark 
wrote:
> Ha, I think I missed the point of that question...
>
> See the admin templates part of my answer, ignore the rest - I don't
> think it applies to your question, but it's a nifty trick anyways.
>
> Brenton.
>
> On Jun 25, 11:37 am, iliveinapark 
> wrote:
>
> > Gday,
>
> > Overriding the admin templates is the only way to do 
> > this:http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#overriding-ad...
>
> > You can either try listing the items how you want (this will mean a
> > change to the templates everytime you register something new), or
> > doing it using JS (you'll prolly have to change this whenever you
> > register something new as well).
>
> > I generally opt to set verbose_names on my models, so that they get
> > listed into groups, eg:
>
> > Offer Banners
> > Offer Sidebar Banners
> > Referers - Domain Referers
> > Referers - Search Engine Referers
> > Referers - URL Referers
>
> > It's the cleanest way I've found to do such a thing.
>
> > Cheers,
> > Brenton
>
> > On Jun 25, 5:18 am, ringemup  wrote:
>
> > > Is there any way to change the order in which admin media are output
> > > (e.g. outputting a ModelAdmin-level javascript after a widget-level
> > > script)?
>
> > > 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: can't adapt type 'Decimal'

2010-06-25 Thread Stuart
On Jun 25, 8:06 am, poupou  wrote:
>
>   Of the 2 web site that I have, It only happens where I make request
> using the the Q objects.
>

Your problem sounds like the problem I just went through. I assume you
are using mod_wsgi. Are the two sites on the same server? For example,
you have one at http://myserver/app1 and the other at http://myserver/app2
-- is that right?

If that's your scenario, upgrade to the latest version of mod_wsgi and
set it to run in daemon mode. For details on how to do that, see here:
http://groups.google.com/group/satchmo-users/msg/a9b22c236d63c323


Hope that helps,

--Stuart

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Rendering the Admin app list?

2010-06-25 Thread derek
On Jun 25, 9:07 am, "euan.godd...@googlemail.com"
 wrote:
> Do you mean that you want to include this code in your own app or want
> to alter the structure of the admin app?
>
> Either of these actions will require the view that renders the page to
> pass the variable app_list into the context as }% if app_list %} will
> always be False as Django's templating system treats missing variable
> as None effectively.
>
> On 25 June, 07:47, derek  wrote:
> > Working with Django 1.2.1
>
> > The default index page for Django admin contains:
>
> > {% if app_list %}
> >     {% for app in app_list %}
> > ...
> >     {% endfor %}
> > {% else %}
> >     {% trans "You don't have permission to edit anything." %}
> > {% endif %}
>
> > I'd like to move this snippet to a separate page; however, when I do
> > so, nothing shows up (well, the page template "wrapper" is there, but
> > no listing of models etc.)
>
> > What do I need to do to enable this?

Before I "pass the variable app_list"; do I not need to create what is
in this variable first?  If so, how?

Thanks
Derek

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



can't adapt type 'Decimal'

2010-06-25 Thread poupou
Hi,

  I'm getting the error "can't adapt type 'Decimal'"  from time to
time in my Django web site.  Once I restart Apache it will works for
few hours, then some users will start to get this error.

  Of the 2 web site that I have, It only happens where I make request
using the the Q objects.

  For example this request :

projets = Projet.objects.filter(Q(termine = u'Non') |
Q(heure_difference__gt = 0 |
Q(termine = u'Oui') &
Q(base_renumeration = u'Forfait'))
for projet in projets:


Wich will end up and with the following traceback :

Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
  92. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/auth/
decorators.py" in __call__
  78. return self.view_func(request, *args, **kwargs)
File "/var/www/django/defitek/gestion/views.py" in projet_en_cours
  128. for projet in projets:
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in
_result_iter
  106. self._fill_cache()
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in
_fill_cache
  692.
self._result_cache.append(self._iter.next())
File "/usr/lib/python2.4/site-packages/django/db/models/query.py" in
iterator
  238. for row in self.query.results_iter():
File "/usr/lib/python2.4/site-packages/django/db/models/sql/query.py"
in results_iter
  287. for rows in self.execute_sql(MULTI):
File "/usr/lib/python2.4/site-packages/django/db/models/sql/query.py"
in execute_sql
  2369. cursor.execute(sql, params)
File "/usr/lib/python2.4/site-packages/django/db/backends/util.py" in
execute
  19. return self.cursor.execute(sql, params)

Exception Type: ProgrammingError at /projet_en_cours/
Exception Value: can't adapt type 'Decimal'

Here are the value that it tryed to use in the request :

return self.cursor.execute(sql, params) ...
▶ Local vars
Variable
Value
params
  (u'Non', Decimal("0"), u'Oui', u'Forfait')
  self
  
  sql
  None
  start
  1277468406.010195
  stop
  1277468406.010242

I'm using : Django 1.1.1, CentOS 5.5, Python-2.4.3-27, mod_wsgi 3.2
and psycopg2-2.2.1

I read many thread that had a can't adapt error, it seems to be
something wrong with psycopg2.  But I have yet to figure out how to
fix this.

Please help.  Thank you.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django csrf

2010-06-25 Thread Tom Evans
On Fri, Jun 25, 2010 at 10:48 AM, Li Hui  wrote:
> When I add enctype="text/plain" to a post form like  method="post" enctype="text/plain">, there is a "CSRF verification
> failed." error.
> But when I remove it, all is right.
> Who can tell me why?
>

Because that is not how HTML user agents work. The post parameters are
not encoded in a format that the server can understand, and so there
is no CSRF token found, hence the error.

http://www.w3.org/TR/html401/interact/forms.html#h-17.3

Use either "application/x-www-form-urlencoded", which is the default
value if you omit enctype. Use "multipart/form-data" if you have file
inputs in your form.

Cheers

Tom

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django csrf

2010-06-25 Thread Li Hui
When I add enctype="text/plain" to a post form like , there is a "CSRF verification
failed." error.
But when I remove it, all is right.
Who can tell me why?

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Localized admin and date field formats

2010-06-25 Thread Danny W. Adair
Hi Alexander,

On Jun 15, 9:54 am, Alexander Jeliuc  wrote:
> Thank You, I found a patch for that. My version is already 1.2.1
> After pathching fields.py and widgets.py it start working fine

It helps others if you mention where they can find such a patch.
I assume it was this:
http://code.djangoproject.com/ticket/13621

Cheers,
Danny


>
> On Tue, Jun 15, 2010 at 12:49 AM, D3f0  wrote:
> > Hi
> > There's been a slighty change in 1.2, take a look at:
> >http://docs.djangoproject.com/en/dev/ref/settings/#date-input-formats
>
> > Nahuel
>
> > On 13 jun, 09:00, Jeliuc Alexandr  wrote:
> > > Hello.
> > > I'm using django1.2.1 with i18n and l10n enabled...
>
> > > standart django admin date format is mm-dd-
> > > when it changes to Spain it becomes dd/mm/
> > > Not problem it is possible to choice date and save it...
> > > But if I want to edit row it becomes like standart mm-dd-...
> > > No problem... but if I edit row and want to save. I got error - wrong
> > > date format...
>
> > > Question is: How can I change date field format in admin edit form
> > > action? to be like it should be dd/mm/?
> > > Is it bug?
>
> > --
> > 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...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
LOL. Yeah bpython is interesting. Some of the features were pretty
nice last time i tried it, but it was a bit flaky so I stuck with
iPython. Could have well improved since then though.

On Jun 25, 12:26 pm, Kenneth Gonsalves  wrote:
> On Friday 25 June 2010 16:48:49 euan.godd...@googlemail.com wrote:
>
> > > The latter, as I don't have to do at across 200 different boxes, I
> > > just edit one file in my NFS home directory?
>
> > That was joke btw. But for one person running on a single machine with
> > plenty of resources, I honestly think that iPython is the best option.
> > I had a read of the link you posted and can't see anyway to replicate
> > everything iPython does. Given that the original author seemed to be
> > asking about a single development machine I stand by iPython being the
> > best choice, but thanks for the interesting read.
>
> btw, someone mentioned bpython as being even better
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread Kenneth Gonsalves
On Friday 25 June 2010 16:48:49 euan.godd...@googlemail.com wrote:
> > The latter, as I don't have to do at across 200 different boxes, I
> > just edit one file in my NFS home directory?
> 
> That was joke btw. But for one person running on a single machine with
> plenty of resources, I honestly think that iPython is the best option.
> I had a read of the link you posted and can't see anyway to replicate
> everything iPython does. Given that the original author seemed to be
> asking about a single development machine I stand by iPython being the
> best choice, but thanks for the interesting read.
> 

btw, someone mentioned bpython as being even better
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deployment hesitation after James Bennett's post, WSGI or ...?

2010-06-25 Thread lzantal


On Jun 25, 2010, at 1:55, Dave E  wrote:


I'll certainly share my observations.


I just did my first django deploy with nginx+fcgi with ssl and I have
to say it was much easier to set it up and configure it than nginx
+apache2+wsgi
It also uses way less ram and CPU then the other deploy. Also I am
using supervisord to manage the django fcgi.


That's a great alternative, especially when VPS memory is costly.
Since I love condensing lengthy instructions to the absolute minimum,
and Django deployment guidelines are all - well - wordy, how about
writing that up somewhere? If you have time, that is :-)



I sure will once I get around it and get some free time:) I can also  
use a write up for my own documentation so it will happen for sure. I  
am running a satchmo store with 4300+ product on it using virtualenv.


lzantal


--
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...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en 
.




--
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
> The latter, as I don't have to do at across 200 different boxes, I
> just edit one file in my NFS home directory?

That was joke btw. But for one person running on a single machine with
plenty of resources, I honestly think that iPython is the best option.
I had a read of the link you posted and can't see anyway to replicate
everything iPython does. Given that the original author seemed to be
asking about a single development machine I stand by iPython being the
best choice, but thanks for the interesting read.

Euan

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread Tom Evans
On Fri, Jun 25, 2010 at 11:55 AM, euan.godd...@googlemail.com
 wrote:
>> To be a bit pedantic, python itself supports many of these features
>> (tab completion, history) if you tell it to.
>
> What's easier, sudo easy_install iPython, or making alterations to the
> existing python interpreter and still not having colour :) ?
>

The latter, as I don't have to do at across 200 different boxes, I
just edit one file in my NFS home directory?

Cheers

Tom

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread Kenneth Gonsalves
On Friday 25 June 2010 16:25:22 euan.godd...@googlemail.com wrote:
> > To be a bit pedantic, python itself supports many of these features
> > (tab completion, history) if you tell it to.
> 
> What's easier, sudo easy_install iPython, or making alterations to the
> existing python interpreter and still not having colour :) ?
> 

yum install ipython is easier still
-- 
Regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
> To be a bit pedantic, python itself supports many of these features
> (tab completion, history) if you tell it to.

What's easier, sudo easy_install iPython, or making alterations to the
existing python interpreter and still not having colour :) ?

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deployment hesitation after James Bennett's post, WSGI or ...?

2010-06-25 Thread Antoni Aloy
Hi,

WSGI is the best option. For that we're using ngnix+cherrypy (just the
wsgi adapter) and it works like a charm. Recently we've start testing
gunicorn as well, as the deployment is really easy.

This kind of configuration allows you to reduce drastically the memory
consumption, so you can deploy small applications on cheap vps. But
programing Django is addictive and for sure you'll finish with a
dedicated server :)

Best regards,

-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread Tom Evans
On Fri, Jun 25, 2010 at 4:13 AM, Shawn Milochik  wrote:
> Install ipython.
>
> It has a lot of great features, including retaining history.
>
> If it's installed, Django will use it by default if you run manage.py shell.
>
> Shawn
>
> Sent from my iPhone 4, for which I waited in line for six hours like a fool 
> on release day.
>

To be a bit pedantic, python itself supports many of these features
(tab completion, history) if you tell it to.

http://docs.python.org/tutorial/interactive.html

Cheers

Tom

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Deployment hesitation after James Bennett's post, WSGI or ...?

2010-06-25 Thread Dave E
I'll certainly share my observations.

> I just did my first django deploy with nginx+fcgi with ssl and I have  
> to say it was much easier to set it up and configure it than nginx
> +apache2+wsgi
> It also uses way less ram and CPU then the other deploy. Also I am  
> using supervisord to manage the django fcgi.

That's a great alternative, especially when VPS memory is costly.
Since I love condensing lengthy instructions to the absolute minimum,
and Django deployment guidelines are all - well - wordy, how about
writing that up somewhere? If you have time, that is :-)

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Admin Media output order?

2010-06-25 Thread iliveinapark
Ha, I think I missed the point of that question...

See the admin templates part of my answer, ignore the rest - I don't
think it applies to your question, but it's a nifty trick anyways.

Brenton.

On Jun 25, 11:37 am, iliveinapark 
wrote:
> Gday,
>
> Overriding the admin templates is the only way to do 
> this:http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#overriding-ad...
>
> You can either try listing the items how you want (this will mean a
> change to the templates everytime you register something new), or
> doing it using JS (you'll prolly have to change this whenever you
> register something new as well).
>
> I generally opt to set verbose_names on my models, so that they get
> listed into groups, eg:
>
> Offer Banners
> Offer Sidebar Banners
> Referers - Domain Referers
> Referers - Search Engine Referers
> Referers - URL Referers
>
> It's the cleanest way I've found to do such a thing.
>
> Cheers,
> Brenton
>
> On Jun 25, 5:18 am, ringemup  wrote:
>
>
>
> > Is there any way to change the order in which admin media are output
> > (e.g. outputting a ModelAdmin-level javascript after a widget-level
> > script)?
>
> > 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ModelChoiceField

2010-06-25 Thread Tran Cao Thai
Thank you very much. I missed that part in the documentation

On Fri, Jun 25, 2010 at 4:54 PM, Oleg Lomaka  wrote:

>  On 6/25/10 8:25 AM, Tran Cao Thai wrote:
>
>> is there any way to use the ModelChoiceField without any value in it? I
>> tried to set query = None but it gave an error while rendering the html page
>>
>
> Use EmptyQuerySet.
> field = ModelChoiceField(queryset=YouMode.objects.none())
>
> http://docs.djangoproject.com/en/1.2/ref/models/querysets/#none
>
> --
> 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...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Admin Media output order?

2010-06-25 Thread euan.godd...@googlemail.com
You could possibly alter the metaclass for the media for your model,
but I suspect this would lead to a whole world of hurt.

On 24 June, 20:18, ringemup  wrote:
> Is there any way to change the order in which admin media are output
> (e.g. outputting a ModelAdmin-level javascript after a widget-level
> script)?
>
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Rendering the Admin app list?

2010-06-25 Thread euan.godd...@googlemail.com
Do you mean that you want to include this code in your own app or want
to alter the structure of the admin app?

Either of these actions will require the view that renders the page to
pass the variable app_list into the context as }% if app_list %} will
always be False as Django's templating system treats missing variable
as None effectively.

On 25 June, 07:47, derek  wrote:
> Working with Django 1.2.1
>
> The default index page for Django admin contains:
>
> {% if app_list %}
>     {% for app in app_list %}
> ...
>     {% endfor %}
> {% else %}
>     {% trans "You don't have permission to edit anything." %}
> {% endif %}
>
> I'd like to move this snippet to a separate page; however, when I do
> so, nothing shows up (well, the page template "wrapper" is there, but
> no listing of models etc.)
>
> What do I need to do to enable this?
>
> Thanks
> Derek

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: reloading in shell

2010-06-25 Thread euan.godd...@googlemail.com
iPython is great for this sort of thing, especially the code
completion with tab.

You could also use the reload statement. This only works when you do:

import foo.bar.MyClass

and doesn't always work correctly, but it might save a bit of typing.

On 25 June, 06:24, Kenneth Gonsalves  wrote:
> On Friday 25 June 2010 08:43:08 Shawn Milochik wrote:
>
> > Install ipython.
>
> > It has a lot of great features, including retaining history.
>
> > If it's installed, Django will use it by default if you run manage.py
> >  shell.
>
> thanks - that with django-extensions has just made my life much easier.
>
> --
> Regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS at AU-KBC

-- 
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...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.