Re: site/admin/doc error in django's model_detail.html using "filter escape" VS "autoescape"

2008-10-17 Thread Scott SA
> You've apparently layered a recent version of Django on top of an older one > without first deleting the older one.  This file > 'django/contrib/admin/templates/admin_doc/model_detail.html' no longer > exists in the source tree, it has been moved to under > 'django/contrib/admindoc/templates'.  

QuerySet extra() duplicate table

2008-10-17 Thread Rares Vernica
Hello, I am using QuerySet "extra()" function. For the "tables" parameter I need to specify the same table multiple times, so I included an alias for each table. Unfortunately Django quotes the table names and everything is messed up. The "tables" parameter for the "extra()" is: tables

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread Eric Abrahamsen
On Oct 18, 2008, at 3:42 AM, KillaBee wrote: > > I keep getting this error that says ViewDoesNotExist: Could not > import intranet.timesheets.views. Error was: No module named User. No > i do not have a User module, I don't want nor need one. How do I find > out Where it is being call at? I

Re: Get External IP Address

2008-10-17 Thread Dj Gilcrease
request.META.get('REMOTE_ADDR') Dj Gilcrease OpenRPG Developer ~~http://www.openrpg.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Custom template tag problem: "No module named models"

2008-10-17 Thread Chris Amico
I think it's fixed now. After much refreshing (I'm editing in Coda) a bookmarks.pyc file appeared. Once that was gone, the tag library did load correctly. I have a different error coming up now, which I'll try to fix or post separately if I can't. Thanks for the help and patience, folks. On Oct

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread Eric Abrahamsen
On Oct 18, 2008, at 4:38 AM, timc3 wrote: > > Thanks for the help. Yeah, my terminology is quite often wrong, to > much context switching with other things. > > Unfortunately I am never sure what will go in to that field, just data > that's sourced from various types of media, and populated

Re: Highlight current active page

2008-10-17 Thread Nathaniel Whiteinge
A slight variation that doesn't require repeating the whole navigation div in each base_SECTION.html template: # base.html {% block content %}...{% endblock %} {% block navigation %} Section 1

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread Ned Batchelder
If you are going to use eval, and the data comes from somewhere else, you should try safe_eval (http://code.activestate.com/recipes/364469/) as a way to get the convenience of unpacking Python literals, but without the danger of full evaluation. If a malicious user could get data into that

Re: cheeserater css reference

2008-10-17 Thread coderb
forgot to mention that I did actually change the template css references to match settings.py, but obviously still got it wrong. I'm using django 1.0 on win XP. thanks On Oct 18, 1:16 am, coderb <[EMAIL PROTECTED]> wrote: > hi all, > > I'm learning django using a downloaded copy of cheeserater  

cheeserater css reference

2008-10-17 Thread coderb
hi all, I'm learning django using a downloaded copy of cheeserater (thanks Jacob) but am stuck at an early hurdle. The template base.html has the following css references: http://media.jacobian.org/cheeserater/ reset.css" type="text/css"> http://media.jacobian.org/cheeserater/

Re: Get External IP Address

2008-10-17 Thread Jeff Johnson
I stumbled on this a while back. It may only work on Linux because of the fcntl. import socket import fcntl import struct def get_ip_address(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl( s.fileno(), 0x8915, #

Re: Figuring out prefork v. worker

2008-10-17 Thread Doug Van Horn
On Oct 16, 5:31 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Oct 17, 7:14 am, Doug Van Horn <[EMAIL PROTECTED]> wrote: > What is the mod_wsgi configuration you are using and how many > processes/threads are you using for Apache child processes and > mod_wsgi daemon processes? For what

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread KillaBee
On Oct 17, 4:25 pm, ryan <[EMAIL PROTECTED]> wrote: > "I do have A feild in my times > model named user" > > Is it a ForeignKey to Django's User model? > If so you need to import that at the top of your models.py file > > -ryan > > On Oct 17, 3:42 pm, KillaBee <[EMAIL PROTECTED]> > wrote: > > >

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread ryan
no, i just checked yr code. that's not it. On Oct 17, 5:25 pm, ryan <[EMAIL PROTECTED]> wrote: > "I do have A feild in my times > model named user" > > Is it a ForeignKey to Django's User model? > If so you need to import that at the top of your models.py file > > -ryan > > On Oct 17, 3:42 pm,

Re: Get External IP Address

2008-10-17 Thread Jeff Anderson
Ty wrote: > I'd like to grab the users external IP address. I'm using it for a > spam catching class that I'm porting over to Django/Python. Is this > possible? > > This person outlines how to 'hack' it, but I'd rather not depend on an > external site. >

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread ryan
"I do have A feild in my times model named user" Is it a ForeignKey to Django's User model? If so you need to import that at the top of your models.py file -ryan On Oct 17, 3:42 pm, KillaBee <[EMAIL PROTECTED]> wrote: > I keep getting this error that says ViewDoesNotExist:  Could not > import

Get External IP Address

2008-10-17 Thread Ty
I'd like to grab the users external IP address. I'm using it for a spam catching class that I'm porting over to Django/Python. Is this possible? This person outlines how to 'hack' it, but I'd rather not depend on an external site.

Json Serialization / Form Validation error

2008-10-17 Thread [EMAIL PROTECTED]
Hello, I'm having a hard time understanding why Django won't let me serialize a dictionary of form errors. Can anyone explain why Django throws an error if I try to serialize someform.errors, even if I copy it into a plain dictionary? #!/usr/bin/env python from django.utils import simplejson

Re: Named URL Patterns

2008-10-17 Thread Karen Tracey
On Fri, Oct 17, 2008 at 3:30 PM, dkadish <[EMAIL PROTECTED]> wrote: > > Okay. I think the issue is that I am trying to use reverse( ) in the > URLConf file. According to the django docs, "the reverse() function > has to import all of your URLConf files and examine the name of each > view". My

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread timc3
Thanks for the help. Yeah, my terminology is quite often wrong, to much context switching with other things. Unfortunately I am never sure what will go in to that field, just data that's sourced from various types of media, and populated from another system. I do know that it will almost always

Re: Add foreign key name to admin's list_display?

2008-10-17 Thread Ty
Great! Changing the list_display to 'post' and changing the return value of Post's __unicode__ worked perfectly. Thanks for your help! On Oct 17, 4:16 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 17, 2008 at 3:21 PM, Ty <[EMAIL PROTECTED]> wrote: > > > # admin.py: > > from

What's a good way to have an integrated blog for my django site with the same user login for blog comments?

2008-10-17 Thread MikeN
I want to create an integrated blog for my Django powered site. I want it to be integrated with my site in the following ways: 1) I want to be able to use my base django template to frame the outer portion of all the displayed blog content --> I want to be able to put the entire contents of the

Re: Add foreign key name to admin's list_display?

2008-10-17 Thread Karen Tracey
On Fri, Oct 17, 2008 at 3:21 PM, Ty <[EMAIL PROTECTED]> wrote: > > # admin.py: > from django.contrib import admin > from clydefrog.blog.models import Post, Comment > > class PostAdmin(admin.ModelAdmin): >list_display = ('name', 'slug', 'date', 'is_published',) >list_filter =

Re: site/admin/doc error in django's model_detail.html using "filter escape" VS "autoescape"

2008-10-17 Thread Karen Tracey
On Fri, Oct 17, 2008 at 2:46 PM, Scott SA <[EMAIL PROTECTED]> wrote: > > I'm having a consistent problem across multiple projects with the self- > documentation and I'm hoping somone here might have an idea what is > wrong and how I might fix it. Thanks in advance for any assistance! > > I have

http://alt.coxnewsweb.com/statesman/img/photos/3699112.jpg

2008-10-17 Thread Norman Harman
is there Sorry for the screw up -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ Get off the sidelines and huddle up with the Statesman all season long for complete high school, college and pro

ensuring a string does not get escaped in views.py

2008-10-17 Thread Kevin
All, I am new to Python and Django. I'm quickly catching on but have finally run in to my first issue. I'm building a simple app that will work with Google's Picasa. The idea is to copy an album from one account to another, something that Picasa won't let you do in its interface. Here's the

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread mthorley
Oh I see. I thought that a DateTimeField had a split date widget by default. Now I see that it does not. I was rendering as a input field because that IS the default widget for a DateTimeField. Thanks for that last clarification, that dispelled all confusion. On Oct 17, 12:40 pm, "Keith

ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread KillaBee
I keep getting this error that says ViewDoesNotExist: Could not import intranet.timesheets.views. Error was: No module named User. No i do not have a User module, I don't want nor need one. How do I find out Where it is being call at? I got this error today, and I have been trying to get the

Re: Enter Valid Date/Time ...

2008-10-17 Thread Karen Tracey
On Fri, Oct 17, 2008 at 11:48 AM, dbee <[EMAIL PROTECTED]> wrote: > > I keep getting the same stupid error ... "Enter valid date/time". I've > done everything I can think of to let django know that the value in > question can be blank ... > > http://code.djangoproject.com/ticket/8898 Sounds like

Re: Named URL Patterns

2008-10-17 Thread dkadish
Okay. I think the issue is that I am trying to use reverse( ) in the URLConf file. According to the django docs, "the reverse() function has to import all of your URLConf files and examine the name of each view". My thinking is that this is leading to to attempt to import itself as it evaluates

Re: nOOb alert, accessing set variables in template

2008-10-17 Thread R. Gorman
You could use {{ for obj in A.a_set.all }} and print out the {{ obj }}. R. --~--~-~--~~~---~--~~ 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

Add foreign key name to admin's list_display?

2008-10-17 Thread Ty
# admin.py: from django.contrib import admin from clydefrog.blog.models import Post, Comment class PostAdmin(admin.ModelAdmin): list_display = ('name', 'slug', 'date', 'is_published',) list_filter = ('is_published',) ordering = ('is_published', '-date', 'name',)

page not updating right away

2008-10-17 Thread ashbii
I am new to Django, but love it so far. I went through a tutorial and created a basic blog app. I'm using Django's admin interface to add new blog posts -- I have a blog "Post" model. My problem is that whenever I enter and save a new blog post via admin, its not showing up on the web page

Re: unable to open database file - sqlite3/apache problem - help?

2008-10-17 Thread Emilio
I found the solution: http://django.freelancernepal.com/errors/django-says-unable-to-open-database-file-when-using-sqlite3/ Regards, Emilio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

site/admin/doc error in django's model_detail.html using "filter escape" VS "autoescape"

2008-10-17 Thread Scott SA
I'm having a consistent problem across multiple projects with the self- documentation and I'm hoping somone here might have an idea what is wrong and how I might fix it. Thanks in advance for any assistance! I have tried a couple of different versions of django including the latest svn release

cannot import name SimpleCookie on new Django install

2008-10-17 Thread Wayne Collier
Hello.I am new to Django and I am having some trouble installing it. I running Python 2.5 and mod_python on Apache with RH linux. I installed Django-0.95. When I go to my mysite directory and run "python manage.pyrunserver"command, I get the following result: [EMAIL PROTECTED] mysite]#

nOOb alert, accessing set variables in template

2008-10-17 Thread Mr. T
Just start with Django and liking it a lot. Made a database and a page that displays queries as html table. It was all too easy. In one of my models I use a Foreign key to ref another object. class A: class B: a = ForeignKey(A) When I include A in the context of my template, I

Re: unable to open database file - sqlite3/apache problem - help?

2008-10-17 Thread Emilio
Same exact problem in Debian Lenny. I've tried debugging it but I'm out of ideas. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

How to setup Apache, mod_python and a reverse proxy to Lighttpd for Django on Ubuntu

2008-10-17 Thread Alexis Bellido
Hi guys, I've got my first 'serious' Django application running on a production environment and after learning a lot from the great Django community and extensive documenation I decided to give something back. Here's a simple tutorial on how to setup Apache, mod_python and a reverse proxy to

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread Keith Eberle
I believe the idea is that if you override a field in your custom form, you are then working off the default implementation of a field, which doesn't include any of the niceties that the admin has added for you. keith On Fri, Oct 17, 2008 at 10:34 AM, mthorley <[EMAIL PROTECTED]> wrote: > >

Re: newforms question

2008-10-17 Thread Daniel Roseman
On Oct 17, 5:50 pm, Jeff Gentry <[EMAIL PROTECTED]> wrote: > > Oops. It could also read > >     from django import newforms as forms > > in which case you should change it to > >     from django import forms > > Right, that's what I was thinking. > > > but I hope you've got the idea: basically

Re: Named URL Patterns

2008-10-17 Thread dkadish
Do you know if there's an easy way to try and figure out where reverse( ) is looking for the pages? On Oct 17, 11:24 am, dkadish <[EMAIL PROTECTED]> wrote: > Nope. Tried that. > > This shouldn't (I don't think) make any difference but I am running > Django 1.0, Python 2.5, Apache 2.210 on

Re: Named URL Patterns

2008-10-17 Thread dkadish
Nope. Tried that. This shouldn't (I don't think) make any difference but I am running Django 1.0, Python 2.5, Apache 2.210 on Windows Server 2003 with SQL Server 2005 as the db (I know, I know...out of my hands) David On Oct 17, 11:19 am, Steve Holden <[EMAIL PROTECTED]> wrote: > dkadish

Re: Named URL Patterns

2008-10-17 Thread Steve Holden
dkadish wrote: > I'm having issues with a named URL pattern in my code. Django does not > seem to be finding the correct URL when the {% url %} and reverse( ) > tag/functions are used. > > the urls.py file at app_root/project/urls.py contains: > > from django.views.generic import list_detail,

Named URL Patterns

2008-10-17 Thread dkadish
I'm having issues with a named URL pattern in my code. Django does not seem to be finding the correct URL when the {% url %} and reverse( ) tag/functions are used. the urls.py file at app_root/project/urls.py contains: from django.views.generic import list_detail, create_update from

Re: ordering a query set randomly

2008-10-17 Thread Steve Holden
Orcun Avsar wrote: > hi, > problem is that i want to order model instances for an attribute and > slice it. then sort list randomly. > >>> query=order_by("date")[:20] >>> query.order_by("?") > returns an error because query set has been sliced > > >>> query=order_by("date")[:100] >>>

ordering a query set randomly

2008-10-17 Thread Orcun Avsar
hi, problem is that i want to order model instances for an attribute and slice it. then sort list randomly. >>query=order_by("date")[:20] >>query.order_by("?") returns an error because query set has been sliced >>query=order_by("date")[:100] >>random.shuffle(query) also returns error bacuse

Re: [solved] Re: delete tables

2008-10-17 Thread felix
I just pulled it directly from django's source code. I would only recommend doing syncdb in a development environment. I just use it as part of an import / convert from an old website's schema. probably for what you are doing (a user doing something on a form) this is too dangerous to do.

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread Steve Holden
timc3 wrote: > I am having a problem with getting lists/dictionaries out of the > database. > > If I have for instance this in a field of my database: > > [['Image format', 'JPEG'], ['Image mode', 'RGB'], ['Image size', > '1440x900'], ['Compression', '21.0 times']] > This is a single field?

Re: newforms question

2008-10-17 Thread Jeff Gentry
> Oops. It could also read > from django import newforms as forms > in which case you should change it to > from django import forms Right, that's what I was thinking. > but I hope you've got the idea: basically newforms has *become* forms. Yup - just wasn't sure on that. I had

Re: newforms question

2008-10-17 Thread Steve Holden
Jeff Gentry wrote: > Hi there ... > > To date, I've not been using Django's form system (nor 'newforms'), but am > trying to integrate another app into a suite that I'm developing. The > code on this is a bit older and is using newforms - when I fire up the > server (running off of the 1.0

Getting lists/dictionaries out of the database

2008-10-17 Thread timc3
I am having a problem with getting lists/dictionaries out of the database. If I have for instance this in a field of my database: [['Image format', 'JPEG'], ['Image mode', 'RGB'], ['Image size', '1440x900'], ['Compression', '21.0 times']] And I call it from django, I would get the following

Re: newforms question

2008-10-17 Thread Steve Holden
Jeff Gentry wrote: > Hi there ... > > To date, I've not been using Django's form system (nor 'newforms'), but am > trying to integrate another app into a suite that I'm developing. The > code on this is a bit older and is using newforms - when I fire up the > server (running off of the 1.0

Re: newforms question

2008-10-17 Thread Jeff Anderson
Jeff Gentry wrote: > Hi there ... > > To date, I've not been using Django's form system (nor 'newforms'), but am > trying to integrate another app into a suite that I'm developing. The > code on this is a bit older and is using newforms - when I fire up the > server (running off of the 1.0

Re: Extending the User model

2008-10-17 Thread krylatij
Take a look at http://code.google.com/p/django-profile/ --~--~-~--~~~---~--~~ 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

newforms question

2008-10-17 Thread Jeff Gentry
Hi there ... To date, I've not been using Django's form system (nor 'newforms'), but am trying to integrate another app into a suite that I'm developing. The code on this is a bit older and is using newforms - when I fire up the server (running off of the 1.0 branch) I get "No module named

Re: How to parse an XML file with django.

2008-10-17 Thread JFQueralt
Hi, people. Thanks a lot for the indications. Will work on them and sure will find a way to implement what I am looking for :-) Take care. Jean On Oct 16, 9:39 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-10-16 at 00:19 -0700, JFQueralt wrote: > > Hi, James. > > > Does

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread [EMAIL PROTECTED]
I had a similar issue having to use an admin's widget. from django.contrib.admin.widgets import AdminFileWidget which shows a link to the file if the FileField is not empty. Wondered if that coud have been more straightforward. best, Haroldo On 17 oct, 12:34, mthorley <[EMAIL PROTECTED]>

Enter Valid Date/Time ...

2008-10-17 Thread dbee
I keep getting the same stupid error ... "Enter valid date/time". I've done everything I can think of to let django know that the value in question can be blank ... # Store the people who need reminding of things class TeleInt (models.Model): call_back = models.DateTimeField( null=True,

Re: How to get a page in Django?

2008-10-17 Thread Gnarlodious
David Reynolds uttered this profundity: > http://diveintopython.org/ Thanks, I'll spend a few months on that material. -- Gnarlie http://Gnarlodious.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: login_required for imported apps

2008-10-17 Thread bruno desthuilliers
On 17 oct, 16:18, Heather <[EMAIL PROTECTED]> wrote: > I have a couple of projects that use the same application > (particularly, photologue). In one project, I want the views of the > imported application to require users be signed in. All the views in > this imported application are generic.

Re: No FlatPage matches the given query.

2008-10-17 Thread uucell 管家
On Oct 6, 6:36 am, Matt <[EMAIL PROTECTED]> wrote: > I had not. Thanks! > > On Oct 5, 6:27 pm, John Allen <[EMAIL PROTECTED]> wrote: > > > Have you looked at these notes on how to get the Practical Django > > Projects examples to > >

Re: everything works except apache seeing django app

2008-10-17 Thread bruno desthuilliers
On 17 oct, 15:48, "Stephen Moore" <[EMAIL PROTECTED]> wrote: > for the record, I fixed the problem > > it seems the permissions have to be correct for every level of the directory. > > so for /home/iambo/web then /, /home, /home/iambob and > /home/iambob/web had to have the right permissions :)

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread mthorley
Thanks Keith, that worked perfectly. Can you tell me the reason I have to use the admin widgets and can't use regular form widgets as I might with any other form? On Oct 17, 7:11 am, "Keith Eberle" <[EMAIL PROTECTED]> wrote: > I had a project where I needed to set the initial value to the

[solved] Re: delete tables

2008-10-17 Thread Mirto Silvio Busico
Wanderful! This was exactly what I needed! There is any documentation about "call_command" and the other commnds you used? Thanks alot. Mirto felix ha scritto: > > here's what I'm using: > > from django.core import management > from django.db import connection > cursor =

Re: delete tables

2008-10-17 Thread Steve Holden
Mirto Silvio Busico wrote: > Sorry I was not clear. > > I have some utilities in view.py which have to reload tables content > (migration from the legacy database; clearing a table and reloading with > base content; ...) > > I know from the shell it is enough an "python manage py flush", but

login_required for imported apps

2008-10-17 Thread Heather
I have a couple of projects that use the same application (particularly, photologue). In one project, I want the views of the imported application to require users be signed in. All the views in this imported application are generic. So, is it possible to use login_required w/o having to go

Re: How to get a page in Django?

2008-10-17 Thread Steve Holden
chaugen wrote: > I am new to both Python and Django, and with somewhat limited > programming experience. That being said, the tutorials set up on > Django Project (http://docs.djangoproject.com/en/dev/) are excellent. > I would suggest 'Beginning Python' from O'Brien as well. It took me > only a

Re: delete tables

2008-10-17 Thread felix
here's what I'm using: from django.core import management from django.db import connection cursor = connection.cursor() # don't delete these tables # note that I'm also keeping auth_user tables =

Re: Django server crashes without error

2008-10-17 Thread ccpn
about 25% of the total memory: Mem: 6062488k total, 4693476k used, 1369012k free, 110524k buffers Swap: 2104472k total,0k used, 2104472k free, 2460792k cached PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 11954 chris 20 0 1571m 1.3g 5080 S7 23.3

Re: Figuring out prefork v. worker

2008-10-17 Thread john
On Oct 16, 2008, at 4:14 PM, Doug Van Horn wrote: > I was just wondering if anyone else had been through this cycle? My > testing showed I didn't have any issues with mod_wsgi/prefork leaking > info across apps, but maybe someone else has? > > I'm pretty much thinking I shouldn't have bothered

Re: everything works except apache seeing django app

2008-10-17 Thread Stephen Moore
for the record, I fixed the problem it seems the permissions have to be correct for every level of the directory. so for /home/iambo/web then /, /home, /home/iambob and /home/iambob/web had to have the right permissions :) thankyou for the help. ... :)

Re: delete tables

2008-10-17 Thread Mirto Silvio Busico
Sorry I was not clear. I have some utilities in view.py which have to reload tables content (migration from the legacy database; clearing a table and reloading with base content; ...) I know from the shell it is enough an "python manage py flush", but I have two problems: * the action

Re: ImportError: cannot import name parse_lookup

2008-10-17 Thread [EMAIL PROTECTED]
> Work as if you have no need of the money. > Love as if nobody ever made you suffer. > Dance as if nobody is watching you. > Sing as if nobody is hearing you. > Live as if the Paradise were on this Earth. Good Attitude~I like it~ I have the same error. Thank You everyone.

Re: How to get a page in Django?

2008-10-17 Thread chaugen
I am new to both Python and Django, and with somewhat limited programming experience. That being said, the tutorials set up on Django Project (http://docs.djangoproject.com/en/dev/) are excellent. I would suggest 'Beginning Python' from O'Brien as well. It took me only a few days with both the

Re: Admin won't display datetime widget with custom form?

2008-10-17 Thread Keith Eberle
I had a project where I needed to set the initial value to the current week's week ending date (Sat), so I needed a custom form too. I used the AdminDateWidget, but I think this will be the correct widget for your needs. # import the widgets from django.contrib.admin import widgets # use the

Re: Extending the User model

2008-10-17 Thread Ulises
> AFAICT, there's some work going on to allow to replace the default > User model with a custom one. But so far, the recommended solution is > indeed to use a UserProfile. Else, there's the hackish (IOW : *not* > recommended) solution - monkeypatching the User model >

Need help with newforms ...

2008-10-17 Thread dbee
I need the user to be able to check the box on groups that apply to them. This was really easy to do with oldforms ... VIEWS: # Get all that user's groups groups = Groups.objects.filter(userProfile__user__pk=request.user.id) # Create the FormWrapper, template, context, response

Re: delete tables

2008-10-17 Thread Erik Allik
$ manage.py dbshell > DROP TABLE table_name; Django does not currently have a database schema management tool (with the exception of syncdb and sql* commands). Erik On 17.10.2008, at 15:30, Mirto Silvio Busico wrote: > > Hi all, > > what is the django way o deleting all table content and

delete tables

2008-10-17 Thread Mirto Silvio Busico
Hi all, what is the django way o deleting all table content and resetting the primary key counter? Thanks Mirto -- _ Busico Mirto Silvio Consulente ICT cell. 333 4562651 email [EMAIL PROTECTED]

Re: Django server crashes without error

2008-10-17 Thread Graham Dumpleton
How much memory is the process using just prior to it crashing? Graham On Oct 17, 9:16 pm, ccpn <[EMAIL PROTECTED]> wrote: > I just updated everything, we are using python-mysql 1.2.2 and > MySQL Client API version 5.1.26-rc, which I think are the very latest > versions > The crashes still

Re: Django server crashes without error

2008-10-17 Thread ccpn
I just updated everything, we are using python-mysql 1.2.2 and MySQL Client API version 5.1.26-rc, which I think are the very latest versions The crashes still occur though. Is there any logfile that tracks what is going wrong? Chris On Oct 16, 1:19 am, Graham Dumpleton <[EMAIL PROTECTED]>

Re: ldapauth and TLS

2008-10-17 Thread Daniele Procida
On Thu, Oct 16, 2008, Daniele Procida <[EMAIL PROTECTED]> wrote: >I'm trying to get django.contrib.auth.ldapauth.LDAPBackend - from: > > > >working with our LDAP server. > >However, if we set any value in LDAP_OPTIONS (other than

Promote a Place to a Restaurant?

2008-10-17 Thread Erik Stein
Hello -- I could not get an answer on the IRC channel and I'm also not finding the right keywords for a successful search on the subject[1]: You all know the model inheritance example with the classes Place and Restaurant. Imagine I mapped every Place in my street, now one of this empty

Re: How to get a page in Django?

2008-10-17 Thread David Reynolds
On 17 Oct 2008, at 5:08 am, Gnarlodious wrote: > I don't know anything about Python except for how to run SQLite > commands. Mostly my strong point is HTML If you familiar with another programming language, may I suggest Dive into Python? http://diveintopython.org/ -- David Reynolds

Re: Django development environment (newbie)

2008-10-17 Thread bruno desthuilliers
On 16 oct, 21:49, Trastabuga <[EMAIL PROTECTED]> wrote: > Can I combine it with Apache so I can serve my static and index.html > with Apache and the rest with django-admin.py server? The builtin server is *not* intented for production use. --~--~-~--~~~---~--~~

Re: Django development environment (newbie)

2008-10-17 Thread bruno desthuilliers
On 16 oct, 23:00, "Hernan Olivera" <[EMAIL PROTECTED]> wrote: > > Can I combine it with Apache so I can serve my static and index.html > > with Apache and the rest with django-admin.py server? > > There is a very single configuration option in apache that > auto-reloads code too, in django

Re: Python have a JIT (Just-in-time) compiler?

2008-10-17 Thread bruno desthuilliers
On 17 oct, 00:57, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-10-16 at 12:02 -0700, bruno desthuilliers wrote: > > On 16 oct, 20:28, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Python have a JIT (Just-in-time) compiler? > > > There's psyco, but it only works on x86 and

Re: Extending the User model

2008-10-17 Thread bruno desthuilliers
On 17 oct, 05:30, jeffself <[EMAIL PROTECTED]> wrote: > I'm working on an application that will need data entry from many > users. The users belong to various departments in the organization > and the information that gets entered by each user should contain the > department information. The

Re: How to get a page in Django?

2008-10-17 Thread bruno desthuilliers
On 17 oct, 06:08, Gnarlodious <[EMAIL PROTECTED]> wrote: > I don't know anything about Python except for how to run SQLite > commands. SQLite is not Python. So I guess you *really* dont know anything about Python if you're confusing both. > Mostly my strong point is HTML > > Is there an example

Re: internationalization and template magic caching

2008-10-17 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-16, o godz. 15:45, przez matei: > You are right. I now know what happened to me and caused confusion. It > appears to me django is taking the po files from the django admin so > words like password and change were translated without me specifying > my own .po

Re: save existing jpg to model

2008-10-17 Thread Ben Eliott
Hi Steve, Nope, Linux machine... ??? On 17 Oct 2008, at 01:30, Steve Holden wrote: > > [EMAIL PROTECTED] wrote: >> I have users dumping jpgs into a folder within the media root, the >> idea is to monitor this folder and programmatically add the jpgs to >> certain model instances based on a

Re: How to display image from ImageField in ModelAdmin?

2008-10-17 Thread krylatij
Code above was a bit incorrect. Here better solution: ## widget declaration from django.utils.safestring import mark_safe from django.forms.widgets import FileInput class AdminImageFieldWithThumbWidget(FileInput): def __init__(self, thumb_width=50, thumb_height=50): self.width =