searching problem

2007-06-29 Thread brian muhumuza
Hi, I'm trying to write a search to search through my models but i have a feeling i'm doing it the wrong way. The search string is almost always many words long. So i split the search string into individual words. I need to search and find records that contain all the words searched. I don't know

application autentication

2007-06-29 Thread Enquest
If I where to write a small application with Django that needs authentication on the user level (only edit what you or a group can edit)... Can I then use the authention model for this? And will the authentication lib change before we hit 1.0 ... My main concern would be that something on the dat

Re: One-to-one relationship (model inheritance) or generic relations?

2007-06-29 Thread Jamie Pittock
Russ, Really useful response, thanks. I had thought about your third option but as I figured there'd be a lot of empty fields I didn't give it much consideration. I might actually go down that route until I have a better understanding of generic relations. Thanks again. j. On Jun 29, 2:20 am,

Re: Using more than one database in the project

2007-06-29 Thread AnaReis
Hi, Do you already have an ETA for that? If there is anything I can do to help, even if just testing, I'd be glad to help, since I really need this module for my project. Ana On Jun 28, 10:21 am, "Ben Ford" <[EMAIL PROTECTED]> wrote: > Hi > There is a branch that supports multiple databases and I

New Forms

2007-06-29 Thread Sebastian
Hello Django users, I have a quick question about new Forms in Django 0.96. I am finding that the line between my front-end and the middleware is starting to blur due to the new forms library. I have managed to add css to form field widgets dynamically through the use of template filters which,

Re: Django, shared hosting memory limits and memory optimization

2007-06-29 Thread Remi
> > > BTW, if you run 'ldd' on the mod_python.so file from the Apache > > > modules directory, does it use Python as a shared library or is there > > > no reference to libpython2.?.so at all, meaning it is embedded with in > > > mod_python.so? What is the actual size of your mod_python.so file? >

Re: Developing a flexible CMS

2007-06-29 Thread anderson . santos . br
Hello everyone, I am talking to a friend to find a good solution for this question and finally write our own CMS. I am really thinking about how to create a flexible CMS and don't break django or don't rework a lot of stuff. So, what I do believe is that we have to focus on a Management System the

Re: New Forms

2007-06-29 Thread Michael Sylvan
On Jun 29, 4:16 pm, Sebastian <[EMAIL PROTECTED]> wrote: > Hello Django users, > > password = forms.CharField(label ='Password', >required = True, >max_length =20, >widget =widgets.PasswordInput())

Re: New Forms

2007-06-29 Thread Sebastian
> > Does anyone have an alternative method for dynamically specifying the > > widget of a Form.Field? I do realize this could be done in a similar > > fashion to the CSS, but I believe specifying a Django object as a > > parameter to a template filter would then violate my front-end. > > I use ne

Re: New Forms

2007-06-29 Thread Jeremy Dunck
On 6/29/07, Sebastian <[EMAIL PROTECTED]> wrote: > From my point of view, however, the problem remains > that the the widget definition > is still in the middleware. I think you mean view? > it seems to be the most logical place to do it. Not to me-- form processing is fairly complex, consideri

Re: nested function

2007-06-29 Thread dailer
On Jun 27, 8:52 pm, dailer <[EMAIL PROTECTED]> wrote: > I created a validator for use in a validator_list in the admin > interface like so... > > def startDate_EndDate_CrossValidation(modelName): > def result(field_data, all_data): > > > being new to python, I stole this from an e

Re: nested function

2007-06-29 Thread dailer
On Jun 27, 8:52 pm, dailer <[EMAIL PROTECTED]> wrote: > I created a validator for use in a validator_list in the admin > interface like so... > > def startDate_EndDate_CrossValidation(modelName): > def result(field_data, all_data): > > > being new to python, I stole this from an e

Re: New Forms

2007-06-29 Thread Sebastian
Yes, Sorry I meant view not middleware. I suppose the question is ultimatly an question of taste. I do completly agree that form processing is complex, and that error checking should be done in the view. Im still not sure, however, that the definition of how it gets rendered in hml should be anyw

Is django a good solution for non-CMS web-apps?

2007-06-29 Thread walterbyrd
I have been reading that django is good for CMS type sites, but not especially good for other types of web applications. For example: financial applications. I have read that TurboGears is better for those other apps. I am not sure why this would be true. Except, maybe, because TG has some sort o

Re: nested function

2007-06-29 Thread Jeremy Dunck
On 6/29/07, dailer <[EMAIL PROTECTED]> wrote: ... > found my answer on comp.lang.python (these nested functions are a bit > crazy)... For this example: def foo(msg1): def bar(msg2): print msg1, msg2 return bar if it helps, you can consider the parent declaration (foo) to be an obje

Re: django authorization of apache

2007-06-29 Thread Robin Becker
Steven Armstrong wrote: > > You could then pass the groups, or whatever else you need, to the > handler using PythonOption directives. > > e.g. > > AuthType basic > AuthName "djauth test" > Require valid-user > SetEnv DJANGO_SETTINGS_MODULE djauth.settings > PythonOption DjangoGroups XX

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
Derek Hoy wrote: > Take a look at this: > http://www.djangoproject.com/documentation/authentication/#authentication-data-in-templates > > You can use this to put something in a base template that all your > site templates can be based on. > > Derek Well, here's my sitewide template that everythin

Re: Is django a good solution for non-CMS web-apps?

2007-06-29 Thread KpoH
No doubt. You can do with django whatever you want. not only CMS system. You even can do not use entire Django, but only part of it (ORM for example). In my company we write VoIP software using Django for instance. and it's very nice ;) thx for all django developers. walterbyrd write: > I have be

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
On Friday 29 June 2007, Jeremy Dunck wrote: > Yep, that doesn't make sense. Something else is going on. > > Is it possible that the view servicing /accounts/login is calling > auth.login? From urls.py (copied and pasted from http://www.djangoproject.com/documentation/authentication/): urlpatt

Re: Is django a good solution for non-CMS web-apps?

2007-06-29 Thread Nic James Ferrier
walterbyrd <[EMAIL PROTECTED]> writes: > I have been reading that django is good for CMS type sites, but not > especially good for other types of web applications. For example: > financial applications. I have read that TurboGears is better for > those other apps. That seems like nonsense. I am

Re: New Forms

2007-06-29 Thread Jeremy Dunck
On 6/29/07, Sebastian <[EMAIL PROTECTED]> wrote: > Im still not sure, however, that the definition > of how it gets rendered > in hml should be anywhere but the template. Ah, so if I read that right, you'd be in favor of an optional mapping from field to widget supplied by the template. Right no

Re: Variables available to all templates

2007-06-29 Thread Jeremy Dunck
On 6/29/07, Kirk Strauser <[EMAIL PROTECTED]> wrote: ... > ...which yields the text "Welcome, kirk. Thanks for logging in." I'm > finding this somewhat confusing in that page_template knows my name if > I'm viewing the login page but not the main index.html. Yep, that doesn't make sense. Someth

Re: Variables available to all templates

2007-06-29 Thread Jeremy Dunck
On 6/29/07, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I hate it when you feel *so close* to finding the answer but can't make that > final little leap. :-) Hmm. What's your MIDDLEWARE_CLASSES setting look like? --~--~-~--~~~---~--~~ You received this message be

Filter a single trans tag

2007-06-29 Thread KiD
Hi everybody, I'm searching for a short way of applying a filter to a translated text. I've found some "complex" ways, but I think that probably there's one shorter. What i want can be done (for example) by: {% filter title %}{% trans 'my text' %}{% endfilter %} {% blocktrans with 'my text'|titl

Internationalization of templates

2007-06-29 Thread Peter Melvyn
Hi, I'm beginner in Django and I have a question about internationalization support. If my understanding of i18n is correct, there are 3 basic approaches: 1. for views _() function 2. for templates {% trans ... %} block 3. for static files URL containing language code Templates containing more

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
On Friday 29 June 2007, Jeremy Dunck wrote: > What's your MIDDLEWARE_CLASSES setting look like? I have: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddlewar

Generating Xml in Django

2007-06-29 Thread sago
If you're using Django to generate XML that isn't RSS, Sitemaps or an external SOAP library, my Xml generation module at http://djangonflex.wordpress.com/2007/06/29/xml-generation-module/ might be useful. I'm using Django to talk to Flex, so need to generate custom XML dialects all the time. Yo

Re: application autentication

2007-06-29 Thread Werner
On 29 Jun., 09:29, Enquest <[EMAIL PROTECTED]> wrote: > If I where to write a small application with Django that needs > authentication on the user level (only edit what you or a group can > edit)... Can I then use the authention model for this? Yes, this may help you too -> http://code.google.co

Re: Variables available to all templates

2007-06-29 Thread Derek Hoy
How are you producing your index page? If you look in the docs, you'll see the warning about needing a RequestContext- if that's not being used in the view that is loading the index.html into a response then the template won't have any user info even if you are logged in.. Hope that makes some s

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
On Friday 29 June 2007, Derek Hoy wrote: > How are you producing your index page? If you look in the docs, > you'll see the warning about needing a RequestContext- if that's not > being used in the view that is loading the index.html into a response > then the template won't have any user info ev

Using a closure as a callback.

2007-06-29 Thread Doug Van Horn
I have a design approach I've been kicking around and thought the group might have some opinions on the subject. Here's the scenario. You're on a web page and you're filling in data for a new Widget to add to your inventory. In the middle of the form you see that you need to create a new Type f

prettier html

2007-06-29 Thread Carl Karsten
nicely formated template code generates lots of CRs in the resulting html. I am trying to figure out how to make the html a bit easier to read. for instance, how can I make this: Not put the CR inside the ? I realize i may be asking for magic, but I am thinking maybe something like skip

caching between successive calls to model.objects.all()?

2007-06-29 Thread [EMAIL PROTECTED]
$ ./oui3/manage.py shell Python 2.4.3 (#1, Jun 13 2006, 16:41:45) [GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from oui3.mon.models import User >>> User.objects.all() [, , ] (then, in another shell

Re: prettier html

2007-06-29 Thread Christian Joergensen
Carl Karsten wrote: > nicely formated template code generates lots of CRs in the resulting html. I > am > trying to figure out how to make the html a bit easier to read. > > for instance, how can I make this: > > {% ifequal day.day day.today %} class="today"{% endifequal %}> > > Not put the

Get Paid to Surf ADs... I am already Paid

2007-06-29 Thread coolguy17111987
[red]Get Paid to Surf ADs[/red] Hi all Now you can get paid to surf ads..All you need to do is register on their site, surf ads for 30 seconds. And you will be credited with the earning immediately. Ist'nt dat amazing. Many of you must have already joined, for rest dont wait...hurry up... Soone

Re: Django Template

2007-06-29 Thread Doug Van Horn
On Jun 29, 12:59 pm, dystopia <[EMAIL PROTECTED]> wrote: > [snip]... Would I > then have have to implement the functionality of this in every view by > calling an cartSummary method and pushing that out into the template? > Or is it better to somehow compile all this functionality into a > templat

Re: prettier html

2007-06-29 Thread Doug Van Horn
On Jun 29, 12:20 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > for instance, how can I make this: > > {% ifequal day.day day.today %} class="today"{% endifequal %}> > > Not put the CR inside the ? Is that line broken by a line break inserted by you? I would think this would achieve your desire

Django Template

2007-06-29 Thread dystopia
Hi, MVC is still a bit alien to me but I'm slowly getting to grips with it. I've previously used languages like PHP in conjunctions with template engines such as Smarty. What I can't quite grasp with django is, suppose I have a three column layout for a shopping site and I wanted to show a summ

Re: Variables available to all templates

2007-06-29 Thread Jeremy Dunck
On 6/29/07, Kirk Strauser <[EMAIL PROTECTED]> wrote: ... > return render_to_response('index.html', > context_instance=RequestContext(request)) ... > > My only concern is that it would seem that I'll need to manually build and > pass in a RequestContext for every single view, since I want to h

Get Paid to Surf ADs... I am already Paid

2007-06-29 Thread coolguy17111987
[red]Get Paid to Surf ADs[/red] Hi all Now you can get paid to surf ads..All you need to do is register on their site, surf ads for 30 seconds. And you will be credited with the earning immediately. Ist'nt dat amazing. Many of you must have already joined, for rest dont wait...hurry up... Soone

Re: Django Template

2007-06-29 Thread Tim Chase
> What I can't quite grasp with django is, suppose I have a three column > layout for a shopping site and I wanted to show a summary of the > carts contents on MOST of my pages in the third column ... Would I > then have have to implement the functionality of this in every view by > calling an ca

Top 300 Freeware Software

2007-06-29 Thread JAVED AS
*TOP 300 FREEWAR E SOFTWARES Download Free Free Free http://thinktarget.net/TOP_300_software.htm * * * -- www.thinktarget.net -- www.thinktarget.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: prettier html

2007-06-29 Thread Carl Karsten
Christian Joergensen wrote: > Carl Karsten wrote: >> nicely formated template code generates lots of CRs in the resulting html. >> I am >> trying to figure out how to make the html a bit easier to read. >> >> for instance, how can I make this: >> >> > {% ifequal day.day day.today %} class="toda

Re: crosstabs

2007-06-29 Thread Matthew Nuzum
Just wondering if there's any additional information I can give that might help get some suggestions on this topic. I'd really love to get some advice. On Jun 28, 4:30 pm, Matthew Nuzum <[EMAIL PROTECTED]> wrote: > So here it is:http://webapps.ubuntu.com/course_locator/ > > Click on Canada, and

Re: prettier html

2007-06-29 Thread Carl Karsten
Doug Van Horn wrote: > On Jun 29, 12:20 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: >> for instance, how can I make this: >> >> > {% ifequal day.day day.today %} class="today"{% endifequal %}> >> >> Not put the CR inside the ? > > Is that line broken by a line break inserted by you? yes. to ke

extends admin/change_list.html bug?

2007-06-29 Thread Vincent Nijs
Hi, I created a page that {% extends "admin/change_list.html" %} Everything is working fine except, for some reason, the page doesn't show the links in {% block userlinks %} when I use apache but it *does* show them when I use the development server. The code is exactly the same on both setups.

Re: prettier html

2007-06-29 Thread Carl Karsten
Carl Karsten wrote: > Christian Joergensen wrote: >> Carl Karsten wrote: >>> nicely formated template code generates lots of CRs in the resulting html. >>> I am >>> trying to figure out how to make the html a bit easier to read. >>> >>> for instance, how can I make this: >>> >>> >> {% ifequal d

Re: Flickr / Django

2007-06-29 Thread [EMAIL PROTECTED]
Here's a model and syncronization script I wrote: http://www.djangosnippets.org/snippets/299/ BW On May 25, 3:14 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm trying to write a view that displays a selection from someFlickr > groups on a page. > > I'm unsure where to

Re: Variables available to all templates

2007-06-29 Thread Nathaniel Whiteinge
A `related thing`__ came up on the Django Dev list this week. I'm not that old-school. :-) I use that `{% if user.is_authenticated %}` all over my site and it's a pain to import and call all the stuff you need for render_to_response over and over. So this is what I changed all my views to this we

Re: Announcing the birth of Fluther.com

2007-06-29 Thread leifbyron
Thanks for the info, Andrew. Best of luck, and please keep us updated! --~--~-~--~~~---~--~~ 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 unsu

Re: Announcing the birth of Fluther.com

2007-06-29 Thread David M. Besonen
the interface looks good and appears to function well. On Wed, June 27, 2007 4:03 pm, Andrew wrote: > with some new twists like real-time discussion what exactly does "real-time" mean? i read the privacy statement. how do you plan on using the data you gather? peace, david --~--~--

Working '/comments/flag/[comment.id here]/' examples?

2007-06-29 Thread JHeasly
Hello, I've been poking around the SVN Comments and django.contrib.comments.views.userflags. I've got the URL "/comments/flag/[comment.id here]/" working the "first" time, i.e. like it's used on an ljworld.com story page, where it returns an "are you sure?" page and a "Yes, go ahead" form button

Re: prettier html

2007-06-29 Thread Michael Trier
Make sure you have an __init__.py in that directory. Michael On 6/29/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > Carl Karsten wrote: > > Christian Joergensen wrote: > >> Carl Karsten wrote: > >>> nicely formated template code generates lots of CRs in the resulting > >>> html. I am > >>> tr

Upload image or select from existing

2007-06-29 Thread [EMAIL PROTECTED]
Hello, I have a model with ImageField, i want to let users to upload their own images or select existing from a list (images are used for article icon). How can i do that (esecially in admin if this is possible)? Sorry if i missed similar topic, but i spent whole night googling around. --~--~-

Re: Working '/comments/flag/[comment.id here]/' examples?

2007-06-29 Thread Jeremy Dunck
On 6/29/07, JHeasly <[EMAIL PROTECTED]> wrote: ... > 'UserFlagManager' object has no attribute 'objects' Very odd. UserFlag has an objects attribute which is an of UserFlagManager. Looking at the svn source, I don't see how UserFlag in views.userflags.flag() could refer to a UseFlagManager obje

how I can get the proper get_absolute_url?

2007-06-29 Thread Young Gyu Park
I try to get the proper get_absolute_url. Under the this circumstances. I have username parameter in my URL. like this http://.../(? . I need to pass this username parameter to the get_absolute_url function. But I don't know how to get the proper username. Because the User model is out of

Re: how I can get the proper get_absolute_url?

2007-06-29 Thread Young Gyu Park
I think it is better to show my code This is my models's get_absoute_url function def get_absolute_url(self): return ('blog.views.tag_main', None, {'username':User.username, 'slug': str(self.Slug)}) get_absolute_url = permalink(get_absolute_url) This is a part of my urls.py whic

Re: how I can get the proper get_absolute_url?

2007-06-29 Thread [EMAIL PROTECTED]
It could be that I don't understand the question, but don't you need to use reverse() to resolve the url from the model? A quick google search found this blog posting showing what I thought was the way to do it: http://blog.micampe.it/articles/2007/01/06/a-little-django-feature-nobody-tells-you-a

Re: how I can get the proper get_absolute_url?

2007-06-29 Thread SmileyChris
I'm guessing your model defines a foreign key to User. Use that instead of User.username (so, for example, self.user.username). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Using more than one database in the project

2007-06-29 Thread Ben Ford
Hi Ana, I'm hoping that I'll get an answer from someone in the next few days and be able to check these changes in. Otherwise I can send you the patch. Help with the testing would be ideal, it's one of the week areas! One of the tests is broken to the extent that it locks the dajngo_session table i

Re: Announcing the birth of Fluther.com

2007-06-29 Thread Andrew
Hi David, "Real-time" means that if you're in the same discussion as another member, you can see them crafting their response in real-time (similar to the ellipsis you see during an iChat) -- something that's happening more and more as we keep doubling our users. We only "use" the data we have t

Re: use Django's database layer for a regular python program?

2007-06-29 Thread ahlongxp
I found python shelve module quite suitable for my need. Thanks anyway. --~--~-~--~~~---~--~~ 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 uns

Re: Upload image or select from existing

2007-06-29 Thread Andrews Medina
2007/6/29, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Hello, > > I have a model with ImageField, i want to let users to upload their > own images or select existing from a list (images are used for article > icon). How can i do that (esecially in admin if this is possible)? I can create a other m