Re: Adding a list filter that points to a function?

2006-02-17 Thread Roberto Aguilar
Thanks for the reply! Here is the pertinent part of the code: http://django.pastebin.com/560781 I think it has more that has_address is a function and not a variable in the model. -berto. On 2/17/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 2/17/06, Roberto Aguilar <[EMAIL PROTECTED]>

How to iterate through form object in template

2006-02-17 Thread Siah
Hi, I will be creating my custom manipulator dynamically, so I don't know what fields I have, and I simply want to iterate through them in my templates? Doing a simple: {% for a in form %} {{ a}} {% endfor %} doesn't work... Any ideas? Thanks, Sia --~--~-~--~~~--

Re: Adding a list filter that points to a function?

2006-02-17 Thread James Bennett
On 2/17/06, Roberto Aguilar <[EMAIL PROTECTED]> wrote: > I added 'has_address' to the > list_filter tuple, but it just crashes the page. I added a column for > has address as listed in tutorial #2 for "was_published_today": Also, one thing that occurred to me a moment too late: do you have a com

Re: Adding a list filter that points to a function?

2006-02-17 Thread James Bennett
On 2/17/06, Roberto Aguilar <[EMAIL PROTECTED]> wrote: > In a person model I keep track of a person's address. I wanted to add > a list filter, has_address, that shows yes or no depending on if the > person has an address listed. I added 'has_address' to the > list_filter tuple, but it just cras

Adding a list filter that points to a function?

2006-02-17 Thread Roberto Aguilar
Hello, In a person model I keep track of a person's address. I wanted to add a list filter, has_address, that shows yes or no depending on if the person has an address listed. I added 'has_address' to the list_filter tuple, but it just crashes the page. I added a column for has address as list

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread bsnipes
I finally see! What is returned by get_object() is dependent upon the results of the __repr__ method in the model setup. Hmmm. now to get it into a parsable format... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread bsnipes
Don't know if this helps, but this is what I get from the shell: >>> from django.models.foodlog import foods,periods >>> foods.get_object(pk=1) 1 >>> foods.get_values(pk=1) [{'eat_date': datetime.datetime(2006, 2, 10, 19, 51), 'period_id': 3, 'id': 1, 'calories': 400, 'description': 'mac and chee

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread bsnipes
Still must be doing something wrong. My urls.py has: (r'^foodlog/$', 'foodlog.views.index'), (r'^foodlog/(\d+)/$', 'foodlog.views.details'), My views.py has: - snip def index(request): latest_log_entries = foods.get_list() return render_to_response('foodlog/index',

Re: Collecting field data in admin when field is not in model

2006-02-17 Thread David Pratt
Hi Adrian. Many thanks for your reply. As an example, I'll just use polls. Let's say you have: admin = meta.Admin( fields = ( (None, {'fields': ('pub_date', 'question')}), ), ) and you wanted to two additional input fields like: occupation (text field with label Occupation

Re: ForeignKey dropdown list in custom view

2006-02-17 Thread Adrian Holovaty
On 2/16/06, bsnipes <[EMAIL PROTECTED]> wrote: > I am just learning Python and Django and can't seem to be able to > figure this out. As a test app I am trying to make a 'foodlog' app to > track food eaten, when, and calories. My model file looks like this: > > --- snip > from django.cor

Re: Collecting field data in admin when field is not in model

2006-02-17 Thread Adrian Holovaty
On 2/17/06, David Pratt <[EMAIL PROTECTED]> wrote: > Hi. I have a situation with my admin pages where I need to collect some > information from admin input fields that are not part of my model. A > number of fields must be entered and then the data processed first to > derive a result that is inse

Re: Threading Issues running sqlite3 in apache

2006-02-17 Thread Nicholas Matsakis
On Fri, 17 Feb 2006, Nicholas Matsakis wrote: > So, I set up postgresql and now have a somewhat different problem. I can > still run my app and the admin interface using the development server > ("python manage.py runserver") but when I run from mod_python I again get > errors; this time a r

Re: Threading Issues running sqlite3 in apache

2006-02-17 Thread Nicholas Matsakis
On Thu, 16 Feb 2006, Nick Matsakis wrote: > However, once I tried to run my app from within Apache, I get the > appended error. My cursory investigation leads me to believe that is > caused by accessing sqlite3 in Apache 2, which is a threaded webserver. So, I set up postgresql and now have

Re: Web Services

2006-02-17 Thread mateja
Chaos, I too am interested in adding XML-RPC functionality to django. I have not done anything more about this past just dreaming about it. I'm very familiar with how to do this in Java, but I've been looking for an excuse to start a django project. Here are some thoughts... A google search

Re: How to use Decimal() objects

2006-02-17 Thread [EMAIL PROTECTED]
Thank you very much Brett. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAI

Re: Request for ideas

2006-02-17 Thread Luke Plant
On Wednesday 15 February 2006 15:59, Eric Walstad wrote: > Be careful about what you choose to document. Django's magic-removal > branch will be a significant change and there may be other backwards > incompatible changes before Django 1.0 is born. I would second that. Have a look here: http:/

Re: Simple Import Module Question

2006-02-17 Thread Siah
Thanks for the help. I figured if I place the module out of my myproject directory, I can import it. I'll do that for now until 9.2 comes out. Regards, Sia --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Please help with django tutorial #2

2006-02-17 Thread Luke Skibinski Holt
A shortcut to the 'print sql, copy sql, paste sql into db' route is (for postgresql users anyway) piping it directly in: python manage.py sqlall | psql dbname means you won't miss data :) Luke Skibinski Holt --~--~-~--~~~---~--~~ You received this message beca

Collecting field data in admin when field is not in model

2006-02-17 Thread David Pratt
Hi. I have a situation with my admin pages where I need to collect some information from admin input fields that are not part of my model. A number of fields must be entered and then the data processed first to derive a result that is inserted into a field in my model. Other types of scenarios

Re: Please help with django tutorial #2

2006-02-17 Thread ak
Ohh thanks guys, my fault ! I've ran python manage.py sqlall polls and it has shown me that I missed some sql stuff that inserts records into django admin tables Thanks a lot! p.s. really django rocks. I used to use my own python library to develop sites that includes MVC stuff and OR-mapping f

Re: How to pass a variable as parameter to a tag

2006-02-17 Thread limodou
On 2/17/06, Maniac <[EMAIL PROTECTED]> wrote: > > limodou wrote: > > >{% calendar year month %} > > > > > It's perfectly possible (strange I can't find it in the docs now but I > knew it from there). > > In your tag function you should wrap all the parameters in a special > parser object which the

Re: How to pass a variable as parameter to a tag

2006-02-17 Thread Maniac
limodou wrote: >{% calendar year month %} > > It's perfectly possible (strange I can't find it in the docs now but I knew it from there). In your tag function you should wrap all the parameters in a special parser object which then will be evaluated with a context: def do_calendar(parser, t

Re: MD5 Password being changed to SHA1 and no longer working

2006-02-17 Thread Milton Waddams
> I'm only guessing, since while I've been around django, sha1 has been > used as the passwd hash function.. But could you check that if the > password actually fits in the space reserved for in the database? my > point is (if there is any;)) that md5 creates a 32 digit hash sum and > sha1 creates

RE: django-admin.py sqlall doesn't include indexes?

2006-02-17 Thread Leeuw van der, Tim
I agree! I'd like to know this as well; currently I created a small shell-script to create DDL scripts from sqlall + sqlindexes. Cheers, --Tim -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: vrijdag 17 februari 2006 0

RE: How to pass a variable as parameter to a tag

2006-02-17 Thread Leeuw van der, Tim
Hi, You are right of course. Django built-in tags do manage; I wonder how. Perhaps time to look at the source-code for some of the Django tags. Cheers, --Tim -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of limodou Sent: donderdag 16 februar

Re: Please help with django tutorial #2

2006-02-17 Thread Max Battcher
ak wrote: > Thans for your answer Jason but I think you are wrong. As far as I know > "python manage.py install polls" should create all tables in my DB. It > was done and I can sucessfully load entities from database, modify them > and save them back and I see all these tables and records in mysq

Re: Please help with django tutorial #2

2006-02-17 Thread ak
Thans for your answer Jason but I think you are wrong. As far as I know "python manage.py install polls" should create all tables in my DB. It was done and I can sucessfully load entities from database, modify them and save them back and I see all these tables and records in mysql. Even things fro