Re: Django patch!

2006-09-01 Thread Kenneth Gonsalves


On 02-Sep-06, at 10:47 AM, Ian Holsman wrote:

> b. email jacob to get your IP# white listed

afaik someone else has been allotted this job

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django patch!

2006-09-01 Thread Ian Holsman

just as an aside.. is it possible to change the 'your a spammer' message
to provide some instructions on what to do if you are actually a human.

something like
...
your trac post was blocked by our spam engine. We apolagize for this  
inconvenience,
and while our spam engine was wrong this time, it does stop hundreds  
of  spams a day.

could you please.
a. post your patch to the developers list
b. email jacob to get your IP# white listed

Thanks for your understanding
the Django team

?

regards
Ian



On 02/09/2006, at 3:12 PM, Kenneth Gonsalves wrote:

>
>
> On 02-Sep-06, at 10:25 AM, Jacob Kaplan-Moss wrote:
>
>> Akismet is now rejecting about a hundred spam posts *a day*.  It
>> looks like it gets about one or two false positives *a week*.  I'd
>> certainly say that's doing more good than bad, myself.
>
> thats good - very good
>>
>> If you (or anyone) wanted to take the time to write a "decent spam
>> protection" plugin for Trac, I'm sure both the Django community and
>> the Trac one would thank you!
>>
>> Until then, yes, if you get flagged incorrectly drop an email to
>> django-dev and we'll whitelist you.
>
> after all even core developers have been flagged at times, and
> everyone knows why, so this is a non issue
>
> -- 
>
> regards
> kg
> http://lawgon.livejournal.com
> http://nrcfosshelpline.in/web/
>
>
>
> >

--
Ian Holsman
[EMAIL PROTECTED]
http://economy-chat.com It's what the economists talk about



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django patch!

2006-09-01 Thread Kenneth Gonsalves


On 02-Sep-06, at 10:25 AM, Jacob Kaplan-Moss wrote:

> Akismet is now rejecting about a hundred spam posts *a day*.  It
> looks like it gets about one or two false positives *a week*.  I'd
> certainly say that's doing more good than bad, myself.

thats good - very good
>
> If you (or anyone) wanted to take the time to write a "decent spam
> protection" plugin for Trac, I'm sure both the Django community and
> the Trac one would thank you!
>
> Until then, yes, if you get flagged incorrectly drop an email to
> django-dev and we'll whitelist you.

after all even core developers have been flagged at times, and  
everyone knows why, so this is a non issue

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django patch!

2006-09-01 Thread Jacob Kaplan-Moss

On Sep 1, 2006, at 7:05 PM, Jan Claeys wrote:
> The Akismet "spam protection" does more bad than good, that's going  
> on.
> (Someone will ask you to submit your IP to be added to a whitelist  
> soon,
> but that's just fighting the symptoms IMNSHO.)
>
> To the admins of the site: isn't it possible to add a decent spam
> protection, maybe based on "bayesian" techniques or something else  
> that
> can "learn" from its mistakes?

Just to give you some numbers:

Akismet is now rejecting about a hundred spam posts *a day*.  It  
looks like it gets about one or two false positives *a week*.  I'd  
certainly say that's doing more good than bad, myself.

If you (or anyone) wanted to take the time to write a "decent spam  
protection" plugin for Trac, I'm sure both the Django community and  
the Trac one would thank you!

Until then, yes, if you get flagged incorrectly drop an email to  
django-dev and we'll whitelist you.

Jacob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Filtering by groups.

2006-09-01 Thread Andy Dustman

On 9/1/06, Gabriel Puliatti <[EMAIL PROTECTED]> wrote:
>
> Hello. I have an application in which a list should be filtered
> depending on what groups a user belongs, since the application is a
> homework list, and the list must only contain the classes the user
> (student) is enrolled.
>
> I know I should do this using filter, but I have no idea how to get
> the list of groups the current, logged in user is a member of, and
> then making that into a filter. Anyone have any tips?
>
> -
> def index(request):
> object_list = Homework.objects.order_by('-duedate')[:100]
> t = loader.get_template('homework/homework_list.html')
> c = Context
> 'object_list': object_list,
> })
> return HttpResponse(t.render(c))
> -
>
> This is the relevant function, in which the latest 100 homework
> entries are passed and then rendered by a template.
>
> If anyone has any tips on how to do this filtering by user group, then
> please do. Help is much appreciated at this point, considering I am a
> newbie. :P

You must have some sort of relation set up between Homework and User
and/or Group, don't you? So it will likely be something like
request.user.homework_set.all().order_by("-duedate"), unless you set a
related_name on your ForeignKeyField or ManyToManyField.

Or, if you are relating Homework to Group, then you might want
something like request.user.groups.homework_set.all().order_by("-duedate")

(It's late, I haven't sanity-checked the above.)
-- 
This message has been scanned for memes and
dangerous content by MindScanner, and is
believed to be unclean.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Filtering by groups.

2006-09-01 Thread Gabriel Puliatti

Hello. I have an application in which a list should be filtered
depending on what groups a user belongs, since the application is a
homework list, and the list must only contain the classes the user
(student) is enrolled.

I know I should do this using filter, but I have no idea how to get
the list of groups the current, logged in user is a member of, and
then making that into a filter. Anyone have any tips?

-
def index(request):
object_list = Homework.objects.order_by('-duedate')[:100]
t = loader.get_template('homework/homework_list.html')
c = Context({
'object_list': object_list,
})
return HttpResponse(t.render(c))
-

This is the relevant function, in which the latest 100 homework
entries are passed and then rendered by a template.

If anyone has any tips on how to do this filtering by user group, then
please do. Help is much appreciated at this point, considering I am a
newbie. :P

-- 
No violence, gentlemen -- no violence, I beg of you!  Consider the furniture!
-- Sherlock Holmes

Gabriel Puliatti
predius.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How to use month/date/year menus for date?

2006-09-01 Thread Sean Schertell

Sorry, perhaps someone can clarify this for me -- or maybe I didn't  
ask my question very clearly.

I have a model called Event. In that model, I have a line that looks  
like this:
date = models.DateField()

In my view, I'm using FormWrapper and that automatically makes a text  
field for the date where the user is expected to enter the date as  
-mm-dd. Personally, I think that's not the most user friendly way  
to collect a date from the user. I like the more typical method of  
having three select menus: one for month, one for date, and one for  
year.

The question is, how can I get those three menus to create a single  
date object that plays nice with Django?

Thanks,
Sean



On Sep 1, 2006, at 11:55 PM, coulix wrote:

>
> Building a menu i dont know,
> bu getting the data yes
>
> exemple the month list of a Entry model with a create date field.
>
> month_list =  Entry.objects.dates('created', 'month')
>
>
> >
>
>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: login/logout oddities

2006-09-01 Thread Tamara D. Snyder

Here are my settings:


TEMPLATE_DIRS = (
 #'/Users/tamara/Documents/django-python/fifthproject/tdslogin/ 
templates',
 '/Users/tamara/Documents/django-python/fifthproject/templates',
)


If I uncomment the first directory 'tdslogin/templates'  then both my  
application ('tdslogin') and the admin application use the template  
at tdslogin/templates/registration/logged_out.html

If I leave that line commented then both my application and the admin  
application use /admin/templates/registration/logged_out.html

My installed apps look like this:

INSTALLED_APPS = (
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.markup',
 'django.contrib.comments',
 'django.contrib.redirects',
 'django.contrib.flatpages',
 'django.contrib.admin',
 'fifthproject.tdslogin',
)

even if I switch the last two around, the same thing happens - the  
order of the apps doesn't seem to matter, just the existence (or not)  
of that one line in the TEMPLATE_DIRS.

So the problem is that the admin system logout and  
django.contrib.auth.views.logout both look for a template at  
registration/logged_out.html.  I guess the admin directories are  
checked last - so when 'tdslogin/templates' is not commented out,  
that is the first one it finds, and when it is commented out, it is  
the last one it finds.

I see now that there is no conflict with the login template.  The  
admin has it at /admin/templates/admin/login.html, and  
django.contrib.auth.views expects it at registration/login.html.

BTW, I had really confusing template problems with two other practice  
apps about a month or so ago, and I solved those problems by simply  
commenting out all of the directories in TEMPLATE_DIRS.  That was how  
things started for me earlier today, and why that directory has been  
toggled on and off many times today as I've tried to figure out this  
problem.  But, as I said earlier, my solution is to simply write my  
own logout view (3 lines, oh my!) and move on.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Prefered way of getting current url.

2006-09-01 Thread Anders Aagaard

Hi

I basically want to do what the admin page is doing now in regards to
sorting.

It auto constructs a link replacing a few request.GET items.

I was wondering what's the prefered way of doing this?  Would I have to
make a custom templatetag or something like that?

Saw I have a url like this:
/content/?tag=bla=2=desc
What would be the best way to simply add tag=3 to it (resulting in
/content/?tag=bla=2=desc=3).  And also allow sort=asc,
replacing previus sort key.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django patch!

2006-09-01 Thread Jan Claeys

Op vr, 01-09-2006 te 23:02 +, schreef Bartlomiej Romanski:
> I've just tried to submit a small patch to Django using there website,
> but I've got a stupid error:
> 
> "Internal Error
> Akismet rejected spam"
> 
> What's going on?

The Akismet "spam protection" does more bad than good, that's going on.
(Someone will ask you to submit your IP to be added to a whitelist soon,
but that's just fighting the symptoms IMNSHO.)

To the admins of the site: isn't it possible to add a decent spam
protection, maybe based on "bayesian" techniques or something else that
can "learn" from its mistakes?

-- 
Jan Claeys


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django patch!

2006-09-01 Thread [EMAIL PROTECTED]


Bartlomiej Romanski wrote:
> Hi,
>
> I've just tried to submit a small patch to Django using there website,
> but I've got a stupid error:
>
> "Internal Error
> Akismet rejected spam"
>
> What's going on?

Akismet likes to block things that shouldn't be blocked :) post it on
the developers mailing list if you didn't.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: template tags for content from a database?

2006-09-01 Thread [EMAIL PROTECTED]

check this: http://code.djangoproject.com/wiki/contentBBCode_parser

I use it in my wiki, and to make a link to a page I use: [rk:art
slug="slugname"]

plugin code:

from diamanda.wiki.models import *
def render(dic, text):
for i in dic:
page = Page.objects.get(slug=i['attributes']['slug'])
text = text.replace(i['tag'], '
' + page.title + ' - ' +
page.description + '')
return text

You could make similar for your pages


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: login/logout oddities

2006-09-01 Thread Rob Hudson

What is your TEMPLATE_DIRS setting?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: login/logout oddities

2006-09-01 Thread Tamara D. Snyder

Yes, I checked all these things before I wrote.  I can actually get  
it to use my template if I rearrange the order of the entries in  
TEMPLATE_DIRS.  But then the admin system uses my logout template,  
too.  But the whole time both admin and my app use the correct login  
template.  It is very strange.

In fact, I've given up and just wrote my own logout view.  I guess I  
just don't understand the template system and how to get it to work  
correctly for me.  It is sad, because I like the templating  
'language' itself.  I just have trouble figuring out which order all  
the INSTALLED_APPS and TEMPLATE_DIRS should be in to get everything  
using the right template each time.

Anyway, thanks for the help.

Tamara

On Sep 1, 2006, at 4:41 PM, Rob Hudson wrote:

>
> I'm not sure but you can verify a couple things...
>
> Look at your settings.py file and make sure your TEMPLATE_LOADERS
> directive has the 2 in this order:
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.load_template_source',
> 'django.template.loaders.app_directories.load_template_source',
> )
>
> Looking at the code for these, if they are reversed, it will find the
> auth templates and see registration/logged_out.html before it looks  
> for
> the templates as listed in your TEMPLATE_DIRS setting, which isn't  
> what
> you want.
>
> If that looks ok, I'd just verify my TEMPLATE_DIRS setting and double
> check all paths, check for typos, that sort of thing.
>
> -Rob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Django patch!

2006-09-01 Thread Bartlomiej Romanski

Hi,

I've just tried to submit a small patch to Django using there website,
but I've got a stupid error:

"Internal Error
Akismet rejected spam"

What's going on? Here what I wanted to submit:


[patch] Changing request.path in middleware doesn't affect url
resolver.

When process_request() function in middleware is changing the
request.path, the URL resolver doesn't see the changes.

Currently the function get_response() of BaseHandler gets two
parameters: path and request. I don't know the reason, It could just
use request.path - it would be much simplier and the middleware
modyfications should work then.

I've modified the function itself, and two places from which it is
called (modpython.py and wsgi.py).



And the .patch file, which I was going to atteched latter on:

Index: django/core/handlers/base.py
===
--- django/core/handlers/base.py(revision 3706)
+++ django/core/handlers/base.py(working copy)
@@ -48,7 +48,7 @@
 if hasattr(mw_instance, 'process_exception'):
 self._exception_middleware.insert(0,
mw_instance.process_exception)

-def get_response(self, path, request):
+def get_response(self, request):
 "Returns an HttpResponse object for the given HttpRequest"
 from django.core import exceptions, urlresolvers
 from django.core.mail import mail_admins
@@ -62,7 +62,7 @@

 resolver = urlresolvers.RegexURLResolver(r'^/',
settings.ROOT_URLCONF)
 try:
-callback, callback_args, callback_kwargs =
resolver.resolve(path)
+callback, callback_args, callback_kwargs =
resolver.resolve(request.path)

 # Apply view middleware
 for middleware_method in self._view_middleware:
Index: django/core/handlers/modpython.py
===
--- django/core/handlers/modpython.py   (revision 3706)
+++ django/core/handlers/modpython.py   (working copy)
@@ -133,7 +133,7 @@
 dispatcher.send(signal=signals.request_started)
 try:
 request = ModPythonRequest(req)
-response = self.get_response(req.uri, request)
+response = self.get_response(request)

 # Apply response middleware
 for middleware_method in self._response_middleware:
Index: django/core/handlers/wsgi.py
===
--- django/core/handlers/wsgi.py(revision 3706)
+++ django/core/handlers/wsgi.py(working copy)
@@ -145,7 +145,7 @@
 dispatcher.send(signal=signals.request_started)
 try:
 request = WSGIRequest(environ)
-response = self.get_response(request.path, request)
+response = self.get_response(request)

 # Apply response middleware
 for middleware_method in self._response_middleware:


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



send free anonymous sms to any mobile in the world

2006-09-01 Thread DigitalPerson DigitalPerson
send free anonymous sms to any mobile in the world
features1-Send Free Messages Worldwide!2-Send anonymous - spoofed messages!3-Worldwide Coverage
4-User friendly interface5-Advanced Support
to sign up  http://www.pimpmysms.com/in.php?id=drbassam84
-- DigitalPerson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django users" group.  To post to this group, send email to django-users@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: login/logout oddities

2006-09-01 Thread Rob Hudson

I'm not sure but you can verify a couple things...

Look at your settings.py file and make sure your TEMPLATE_LOADERS
directive has the 2 in this order:
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)

Looking at the code for these, if they are reversed, it will find the
auth templates and see registration/logged_out.html before it looks for
the templates as listed in your TEMPLATE_DIRS setting, which isn't what
you want.

If that looks ok, I'd just verify my TEMPLATE_DIRS setting and double
check all paths, check for typos, that sort of thing.

-Rob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



login/logout oddities

2006-09-01 Thread Tamara D. Snyder

I'm spending the afternoon trying to learn how to add login/logout to  
my django project.  Naturally, I have created a fake app just for  
this purpose.  And I have discovered something strange

Logging in - I have a view that I use a login_required decorator  
with.  That looks for a url with /accounts/login/, which then is sent  
to the view django.contrib.auth.views.login, which looks for a  
template registration/login.html.  The entry in my urls.py file is:
(r'^accounts/login/', 'django.contrib.auth.views.login'),
This works just fine, and it uses my login template.

If I want to log out, I make the following entry in my urls.py file:
(r'^accounts/logout/', 'django.contrib.auth.views.logout'),
and I write a file registration/logged_out.html

The link I use for logout is to /accounts/logout/

I get logged out, but the template that is used is not *my* template,  
it is the one from the admin application.  Why?  If logging in finds  
my template, why won't logging out find my template?  Both templates  
are in the same directory, right next to each other.

Can anybody explain to me what is going on?

Thanks,

Tamara

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Creating class object in template tag?

2006-09-01 Thread [EMAIL PROTECTED]

Dammit Wayne, I'm one step from having this working and busy patting
myself on the back, and you have to go talking sense to me.

You're right.. this is very much a niche market, and the items change
so infrequently (as in YEARS apart) that it's probably not even worth
setting up a cron job.

It would be worth it if I were passing in keywords to search for, but
for my purposes the keywords don't change that much either.

In the words of Boris Badenov... I guess it's back to the salt mines!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Creating class object in template tag?

2006-09-01 Thread Waylan Limberg

On 9/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> That might work, if I were smart enough to figure it out... but I think
> all I'm trying to do is make bookxml.Items a class, so I can treat it
> as I would other classes.
>
> I think.
>
It looks like your hardcoding the search terms in the request your
submitting to Amazon. Do the results change often? Do you really want
to re-request that with each and every page view on your site? While
you could cache the xml file localy and work from that, perhaps you
should consider creating a model in your db and then use a script run
from a cron job (using django db api) to update the db every so often.
That way you can easly acces the data as you would any other django
model.

I believe that is how most people display their
del.icio.us/ma.gnolia.com links in their blogs and it works fine.
Perhaps you should check some of the source code that has been made
available for ideas.(you'll have to do some searching, it doesn't look
like anyone has compliled a list of those on the wiki - unless I
missed it)


-- 

Waylan Limberg
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Looking into / previewing attached files

2006-09-01 Thread Vizcayno

Hello:
I have defined a FileField attribute in the model.
Users can attach documents for every record they save.
However, many of them asked me for looking into the file before saving
the
attached one; the files have .doc, .pdf, .xls or .ppt formats. Is there
a
way to do this using Admin?
Thank you very much for your attention.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Looking into / previewing attached files

2006-09-01 Thread Vizcayno

Hello:
I have defined a FileField attribute in the model.
Users can attach documents for every record they save.
However, many of them asked me for looking into the file before saving
the
attached one; the files have .doc, .pdf, .xls or .ppt formats. Is there
a
way to do this using Admin?
Thank you very much for your attention.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Accessing parent classes within admin site list_display function

2006-09-01 Thread RajeshD

Actually, the document is pretty clear about this.

See: http://www.djangoproject.com/documentation/model_api/#list-display

.quote
For any element of list_display that is not a field on the model, the
change list page will not allow ordering by that column. This is
because ordering is done at the database level, and Django has no way
of knowing how to order the result of a custom method at the SQL level.
/.quote


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Table prefix problems

2006-09-01 Thread [EMAIL PROTECTED]


James Bennett wrote:
> Otherwise, the admin will only be able to show objects for the site
> that's hosting it.

and that is what I want to do, when I use

objects = CurrentSiteManager()
site = models.ForeignKey(Site)

Admin Panel list all objects from the table but allows to edit only
those from current site. I want him to list only objects from current
site.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Creating class object in template tag?

2006-09-01 Thread [EMAIL PROTECTED]

That might work, if I were smart enough to figure it out... but I think
all I'm trying to do is make bookxml.Items a class, so I can treat it
as I would other classes.

I think.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: group traffic

2006-09-01 Thread Waylan Limberg

On 9/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Gary Wilson wrote:
> > A Django forum would be another option.  IMO, forums have more of a
> > community feel, and are also probably a little more friendly for
> > newbies.  And, unlike with this mailing list, you would be able to
> > reply to posts that are more than 30 days old.
>
> In my opinion the Google Groups interface is the best: you can now
> subscribe to updates for the post u're interested in and the search
> just works. Plus all the old posts with new replies get highlighted on
> the right.
>
+1

And then I don't need to go to a different website for each group I
belong to just to see new activity. They all come to me via email (the
actual content - not a notice to go to the site - uhg.) and I can
respond right there (something you can't do with feeds). And with
google groups, you still get the benefits of a forum for those who
don't want to use email. They can read and reply right on the site.

Now if someone added the abilty for a certain forum package to also
act like a mailing list, that would be something to think about.
-- 

Waylan Limberg
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Yet another Django application

2006-09-01 Thread Jan Claeys

Op do, 24-08-2006 te 12:10 +0200, schreef didier Belot:
> About the service app: it is very distribution specific! Maybe you can
> have a base class defining the api, and distribution specific classes
> doing the job (one for fedora/redhat, one for debian, ...) with a
> DISTRIBUTION setting in the settings file.
> 
> I'll let you know if I finish an ubuntu specific one. 

Also look at the new init replacement ('upstart') then:




-- 
Jan Claeys


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Advanced Admin Customization

2006-09-01 Thread nate-django

On Fri, Sep 01, 2006 at 10:21:38AM -0700, mthorley wrote:
> Table creation is handled by core.management. In it, a lookup is
> preformed where it loads the dict DATA_TYPES (or something like that)
> from db.backends..creation. Then it attempts a key matching the
> field class name of each field in your model. So in order to create
> your own fields, whether you subclass an existing one or not, you must
> either overwrite the class name, or add your fieldtype to the list.

This thread has peaked my interest so I did some code digging.  I was
thinking that overriding the class name didn't seem like a smart choice.
I thought it would be nice if the creation code would check the parent
class's name if it couldn't find the current class name in DATA_TYPES.

Upon inspection of the code I found it was calling get_internal_type()
for each field.  If you look in db/models/fields/__init__.py you'll
find that this is used in EmailField which subclasses CharField.

class EmailField(CharField):
...
def get_internal_type(self):
return "CharField"

Now I'll have to try creating some custom fields myself. :)

Nate

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Re: Table prefix problems

2006-09-01 Thread James Bennett

On 9/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> objects = CurrentSiteManager()
> site = models.ForeignKey(Site)

Just keep in mind that if you want to share an instance of the admin
across multiple sites *and* use the CurrentSiteManager, you need to do
this:

objects = models.Manager()
on_site = CurrentSiteManager()

Otherwise, the admin will only be able to show objects for the site
that's hosting it.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Table prefix problems

2006-09-01 Thread [EMAIL PROTECTED]

[EMAIL PROTECTED] wrote:
> using Sites is good for forums and wikis... 
not "is" but "isn't" :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Table prefix problems

2006-09-01 Thread [EMAIL PROTECTED]

using Sites is good for forums and wikis... and it require some
hacking... unless I cheat :)
hm... If I add:

objects = CurrentSiteManager()
site = models.ForeignKey(Site)

to each of my models classes it seems that it will do the hacking part
for non Admin Panel views, now how to make Admin Panel to show only
object from current site ? in this hack I can add entries for all Sites
but I can edit only those from current site :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Does "extends" also copy "load" declarations from base template?

2006-09-01 Thread Rob Hudson

Adrian Holovaty wrote:
> No, this isn't the case -- loaded template tags/filters aren't made
> available in child templates. This happens on purpose, so that a child
> template is less coupled to its parent template.

If you're extending a base template, aren't you already coupling the
two?

I could see an argument towards more flexibility where if you want it
less coupled you don't put any "load"s in the base template.  But if
you don't care and want less repetition (DRY) of "load" statements, put
it in the base template.

There's probably other cases I'm not considering.

Thanks,
Rob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Creating class object in template tag?

2006-09-01 Thread Rob Hudson

Why not have your template tag take a 2nd and 3rd argument: filter and
order by. I'm not sure how exactly that works with the "as".  Maybe:

{% get_amazon_book_list title author as amazon_book_list %}

?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Does "extends" also copy "load" declarations from base template?

2006-09-01 Thread Adrian Holovaty

On 9/1/06, Rob Hudson <[EMAIL PROTECTED]> wrote:
> If not, should it?
>
> If I'd like do have markup on my whole project it would be nice to set
> it once in base.html via {% load markup %} and have it automatically
> loaded in each template that extends base.
>
> I just tried this with template tags and it didn't work but I'm curious
> if it would be a useful thing or not?

Hey Rob,

No, this isn't the case -- loaded template tags/filters aren't made
available in child templates. This happens on purpose, so that a child
template is less coupled to its parent template.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Custom SQL in Q objects

2006-09-01 Thread bk

Thanks, Luke.

I'll be working on an ajax solution, and will hopefully have something
to post about it soon.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Making sure a user has checked a checkbox ?

2006-09-01 Thread [EMAIL PROTECTED]

After discussing this on IRC, I have submitted a ticket and a patch.
It is at http://code.djangoproject.com/ticket/2640 if anyone is
interested.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



ajax & django again

2006-09-01 Thread dummy

Hi all,

at 
http://svn.sourceforge.net/viewvc/django-userlibs/trunk/libs.ajax/src/ajax/views/generic/date_based.py
I tried to solve ajax-aware views by copying original django generic views into 
my own project namespace and modifiy them to use separate customized 
HttpResponse objects. This has 2 disadvantages for me: I have to maintain views 
and http-reponse-classes and not all http-response-classes are generic to use 
everywhere.

Fromthe feedback I got until now, I know that the django way to build 
ajax-aware views would be like this:

1. create a ajax-aware template
2. call any available view you like
3. let the view load your template thru template_loader
4. serialize/render the RequestContext thru your template
5. return a standard HttpResponse with the templates rendered response

I want to go these steps now in my project above.

I tought to create some Template-subclasses for Json/JsonRpc/Xml etc., a 
Template-Loader to import those py-subclasses instead of HTML-Files and 
integrate the django-serializers into those Template-subclasses.

Everything would be fit best into django's view/template/context framework I 
think. Any comments on this ?

Regards,
Dirk

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Advanced Admin Customization

2006-09-01 Thread mthorley

I found it! There is a mapping of Field types in
db.backends..creation where yourdb is mysql or postgres or what
ever. I found it by grepping for CREATE in the django source.

Table creation is handled by core.management. In it, a lookup is
preformed where it loads the dict DATA_TYPES (or something like that)
from db.backends..creation. Then it attempts a key matching the
field class name of each field in your model. So in order to create
your own fields, whether you subclass an existing one or not, you must
either overwrite the class name, or add your fieldtype to the list.

The easiest option, (if you're using a column type already defined by
django) is to overwrite the class name. The second option is a
maintenance nightmare to be avoided if at all possible.

Here's a snip of my custom Field, I hope to write up a tutorial on this
later. I'll write back when I get it online.

class MyField(models.Field):
def __new__(cls):
 cls.__name__ = 'IntegerField'
 return models.Field.__new__(cls)

You set cls.__name__ to the string name of field type in
db.backends..creation that corresponds to the type of db column
you want to use.

Thanks again Chris! Your comments really helped me work out the thought
process. I'll try that template/model/management permisions enforcement
just as soon as I get this custom Field complete.

Also thanks to all the django devs, your excellent code, and comments
lended a great hand in solving this mystery.
--
mthorley


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Accessing parent classes within admin site list_display function

2006-09-01 Thread DF

I am trying to access parent class objects within the admin site with
the list display function.

The following are my models:
###
class Device(models.Model):
make = models.CharField(maxlength=30)
model = models.CharField(maxlength=50)
partno = models.CharField('part number', maxlength=30)
serial = models.CharField('serial number', maxlength=30,
primary_key=True)
asset = models.CharField('asset tag', maxlength=30)
recievedate = models.DateTimeField('date received')
active = models.BooleanField()
def __str__(self):
return '%s (%s)' % (self.serial, self.asset)
class Admin:
list_display = ('make','model','serial','asset')

class Plan(models.Model):
shortname = models.CharField(maxlength=30, primary_key=True)
description = models.CharField(maxlength=100)
active = models.BooleanField()
device = models.ForeignKey(Device)
def __str__(self):
return '%s' % self.shortname
class Admin:
pass

class Task(models.Model):
description = models.CharField(maxlength=30)
frequency = models.IntegerField()
active = models.BooleanField()
plan = models.ForeignKey(Plan)
def __str__(self):
return '%s|%s' % (self.plan,self.description)
class Admin:
pass

class Log(models.Model):
timestamp = models.DateTimeField('date completed')
comments = models.TextField()
active = models.BooleanField()
task = models.ForeignKey(Task)
def __str__(self):
return '%s' % self.timestamp
class Admin:
list_display = ('timestamp','comments','task')
###

So, when I view Logs via the admin interface, I see the timestamp,
comments, and the return of __str__ for the parent task object.
However, I was really wanting to be able to view and sort based off of
some of the device fields (make, model, serial, etc).  Is there a way
to step up the ForeignKey bindings to higher level objects within the
Admin class?

Push come to shove, I could write a seperate functions to get the data
I am looking for, but then I would not be able to sort based on it.

I wasnt able to find a whole lot on how to do this in the DJango
documentation.  Although, I could be looking in the wrong places.  Any
help would be apprecaited.

Thanks!
 - DF


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Creating class object in template tag?

2006-09-01 Thread [EMAIL PROTECTED]

I hope I'm using the correct terminology here...

As anyone who's read my posts knows, I'm new to both Django and Python,
but I'm trying to figure stuff out. In my last post, I mentioned I
wanted a way to bring in things from Amazon Web Services, and it was
suggested I should use templatetags.

Well, it was harder than I thought it was going to be, but I've got it
working. My problem is manipulating what I return. Currently, I'm
returning EVERYTHING.  I'm using xmltramp, so I can drill down through
the xml and return what I want, but right now I'm forcing the template
to do way more of the sorting and filtering than I want.  In other
words, I want something like
Amazon.objects.all().filter(title).order_by('?')

As it is now, my template's jumping through hoops like this:
{% load amazon.amazon %}
{% get_amazon_book_list as amazon_book_list %}

{% for book in amazon_book_list %}
{% ifequal book.ItemAttributes.Format HTML %}
{% if book.ItemAttributes.Title %}
   {{ book.ItemAttributes.Title}}" />
  {{ book.EditorialReviews.EditorialReview.Content
}}
   {% endif %}
   {% endifequal %}
   {% endfor %}


And that just seems silly to me. I KNOW there's a better way.

Here's my template tag:

from django import template
import datetime
import urllib
import xmltramp
register = template.Library()

bookfile =
urllib.urlopen("http://webservices.amazon.com/onca/xml?Service=AWSECommerceService=17AFEX4H54748CG47E02=thegretschpag-20=ItemSearch=gretsch%20guitar=Books=Medium;).read()

bookxml = xmltramp.parse(bookfile)

class AmazonBookListNode(template.Node):
def __init__(self,varname):
self.varname = varname
self.xml = bookxml.Items

def __repr__(self):
return ""

def render(self, context):
context[self.varname] = self.xml
return ''

class GetAmazonBookList:
"""
{% get_amazon_book_list as amazon_book_list %}
"""
def __init__(self, tag_name):
self.tag_name = tag_name

def __call__(self, parser, token):
bits = token.contents.split()
if len(bits) != 3:
raise template.TemplateSyntaxError, "'%s' tag takes two
arguments" % bits[0]
if bits[1] != "as":
raise template.TemplateSyntaxError, "First argument to '%s'
tag must be 'as'" % bits[0]
return AmazonBookListNode(bits[2])

register.tag('get_amazon_book_list',
GetAmazonBookList("get_amazon_book_list"))


Thanks!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Does "extends" also copy "load" declarations from base template?

2006-09-01 Thread Rob Hudson

If not, should it?

If I'd like do have markup on my whole project it would be nice to set
it once in base.html via {% load markup %} and have it automatically
loaded in each template that extends base.

I just tried this with template tags and it didn't work but I'm curious
if it would be a useful thing or not?

Thanks,
Rob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Does "extends" also copy of "load" declarations from base template?

2006-09-01 Thread Rob Hudson

If not, should it?

If I'd like do have markup on my whole project it would be nice to set
it once in base.html via {% load markup %} and have it automatically
loaded in each template that extends base.

I just tried this with template tags and it didn't work but I'm curious
if it would be a useful thing or not?

Thanks,
Rob


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Table prefix problems

2006-09-01 Thread jrs

I actually looked into this yesterday and came up with the following
modification to db/models/options.py around line 37

def __setattr__(self, name, value):
 if (settings.DB_PREFIX != '' and name == 'db_table' and value !=
''):
 self.__dict__[name] = DB_PREFIX + "_" + value
 else:
 self.__dict__[name] = value

Where a new option is added to settings.  This is pretty crude but in
my initial test it appeared to work.

This solution would not allow for sharing users between the sites

Or is this 'incredibly hackish'

Disclaimer I am not a python programmer, but I did stay at a Holiday
Inn Express last night.  So this may be way off base.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Addingg to admin nice selector for editing ForeignKey fields in case of relatively large number of items (adopted from SelectFilter2.js)

2006-09-01 Thread Adrian Holovaty

On 9/1/06, Andrew <[EMAIL PROTECTED]> wrote:
> I adopted nice SelectFilter2.js for single item selecting with search
> in change forms
> in case of relatively large lists.
> Here is my changes against current sources (0.96-pre).
> It's seems work for me.

Hey Andrew,

This looks pretty cool! Could you post a ticket to Django's ticket
system -- http://code.djangoproject.com/newticket -- so we don't
forget about it? It's easy to lose track of code snippets posted to
the mailing list.

Thanks for your contribution!

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Table prefix problems

2006-09-01 Thread Adrian Holovaty

On 8/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I want to make few sites which will use the same django apps and the
> problem is with table prefixes as using one database would be nice.
> There is db_table for my tables but django tables can't be changed that
> way - users and permissions aren't the problem (the same user system is
> welcomed) but tables like django_admin_log will go crazy as there will
> be items from app A with the same ID from all sites.
>
> Is there any solutions to this? (prefix other tables) and I don't want
> to use Sites.

My suggestion would be to alter the apps/databases to be able to use
them on multiple sites. I can't think of any other solution that's not
incredibly hackish.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Kate syntax highlighting for django html templates.

2006-09-01 Thread Adrian Holovaty

On 8/25/06, Matthew Marshall <[EMAIL PROTECTED]> wrote:
> I got sick of kate highlighting my django template vars/tags as errors,
> so I put this together.  It highlights tags, vars, filters, and
> comments.  You can also use Ctrl+[Shift+]D to [un]comment using {%
> comment %}{% endcomment %}.
>
> It's really pretty simple, but I thought it was worth sharing.
>
> Get it here:
> http://media.matthewmarshall.org/djangotemplate.xml

Awesome! I've been a Kate user for years and have never gotten around
to writing this. Thanks, Matthew. Would you be willing to contribute
this to the Django distribution proper? It's a nice candidate for our
"extras" directory, which currently only contains one thing (a
bash-completion helper).

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



help with custom validators

2006-09-01 Thread Tim Shaffer

This is my first time using custom validators, so I want to make sure
I'm on the right track.

Here's a stripped down version of my model and the validation
requirements:

class Event(models.Model):
date = models.DateField()
recurrence = models.SmallIntegerField(blank=True, null=True,
choices=RECURRENCE_CHOICES)
every = models.PositiveSmallIntegerField(blank=True, null=True)
end_date = models.DateField(blank=True, null=True)

recurrence will be null, or a number between 1 and 4. If recurrence is
not null, the every and end_date fields must be provided, and end_date
must be greater than date.

So here is my model after I added in all the validation. It works great
right now... I'm just wondering if there is a better/easier way to do
this? It didn't look like I could meet my needs with just the
validators in django.core.validators, so I wrote a couple to help me
out.

class ValidateIfOtherFieldGiven(object):
def __init__(self, other_field, validator_list):
self.other_field, self.validator_list = other_field,
validator_list
self.always_test = True
def __call__(self, field_data, all_data):
if all_data.get(self.other_field, False):
for v in self.validator_list:
v(field_data, all_data)

class IsGreaterThanOtherField(object):
def __init__(self, other_field, error_message):
self.other_field, self.error_message = other_field,
error_message
def __call__(self, field_data, all_data):
if field_data < all_data[self.other_field]:
raise validators.ValidationError, self.error_message

recurrence_validator =
validators.RequiredIfOtherFieldGiven('recurrence', 'This field is
required for recurring events')

end_date_greater_validator = IsGreaterThanOtherField('date', 'End date
must be later than Date')

every_validator = ValidateIfOtherFieldGiven('recurrence',
[recurrence_validator])
end_date_validator = ValidateIfOtherFieldGiven('recurrence',
[recurrence_validator, end_date_greater_validator])

class Event(models.Model):
date = models.DateField()
recurrence = models.SmallIntegerField(blank=True, null=True,
choices=RECURRENCE_CHOICES)
every = models.PositiveSmallIntegerField(blank=True, null=True,
validator_list=[every_validator])
end_date = models.DateField(blank=True, null=True,
validator_list=[end_date_validator])

Also, would it be worth submitting the two validators as a patch? It
seems like ValidateIfOtherFieldGiven could be useful for others as
well, and IsGreaterThanOtherField is a logical opposite for the
already-existing IsLessThanOtherField.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Re: django/core/meta

2006-09-01 Thread James Bennett

On 9/1/06, brian corrigan <[EMAIL PROTECTED]> wrote:
> the unique fields are not created.
> the same happens for unique_together=(("distribution_list",
> "subscriber"),)

I think the confusion here is over the word 'meta'.

Once upon a time, you defined models by starting out with:

from django.core import meta

But *within* the model itself, you specified extra options by adding
an inner class called 'META', like so:

from django.core import meta

class MyModel(meta.Model):
name = meta.CharField(maxlength=250)
blurb = meta.TextField()

class META:
unique_together = (('name', 'blurb'),)

'META', here, has nothing whatsoever to do with the class 'django.core.meta'.

Now, you do this:

from django.db import models

class MyModel(models.Model):
name = models.CharField(maxlength=250)
blurb = models.TextField()

Class Meta:
unique_together = (('name', 'blurb'),)

In other words, inside the model you define a class called 'Meta'.
This isn't an imported class, and there is no 'meta' class anywhere in
Django that you need to pull in -- it's a class that *you* create,
*inside* your model class.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: get_object_or_404 and select_related?

2006-09-01 Thread Adrian Holovaty

On 8/28/06, Rob Hudson <[EMAIL PROTECTED]> wrote:
> Can you use both?  I saw a link to a post about this sort of here:
> http://groups.google.com/group/django-developers/browse_thread/thread/818c2ee766550426/e311d8fe6a04bb22
> but didn't see a resolution.

There's no great solution to this yet. Personally I've just been using
try/except around my get()s that use select_related(), and raising the
Http404 manually.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Table prefix problems

2006-09-01 Thread [EMAIL PROTECTED]

I want to make few sites which will use the same django apps and the
problem is with table prefixes as using one database would be nice.
There is db_table for my tables but django tables can't be changed that
way - users and permissions aren't the problem (the same user system is
welcomed) but tables like django_admin_log will go crazy as there will
be items from app A with the same ID from all sites.

Is there any solutions to this? (prefix other tables) and I don't want
to use Sites.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



OneToMany Connection quite simple query how to

2006-09-01 Thread kelemen

Hi

I have two simple models with a OneToMany connection

class Student(models.Model):
last_name = models.CharField(maxlength=60)
first_name = models.CharField(maxlength=60)

class Grade(models.Model):
mark = models.CharField(maxlength=1, choices=MARK_CHOICES)
student = models.ForeignKey(Student)

I'd like to print out a particulary student's marks
in sql syntax:
SELECT * FROM naplo_grade WHERE student_id = proper id

I couldnt figure out how to write it in python/django
ive tried for example
  Grade.objects.filter(student_id=1)
but of course it didnt work...
Could you tell me a great solution?

(im a newbie in this python/django world)

thanks in advance
 Viktor


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: which css files are loaded?

2006-09-01 Thread coulix

A javascipt widget may load his own css file.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: How to use month/date/year menus for date?

2006-09-01 Thread coulix

Building a menu i dont know,
bu getting the data yes

exemple the month list of a Entry model with a create date field.

month_list =  Entry.objects.dates('created', 'month')


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread brian corrigan

Cheers Chris,

Finally saw that but I have tried it and have the following problem...

The code:

distribution_list = models.ForeignKey(DistributionList)
subscriber = models.CharField(maxlength=30)
unique_together=((distribution_list, subscriber),)

gives the following sql

"id" serial NOT NULL PRIMARY KEY,
"distribution_list_id" integer NOT NULL REFERENCES
"textnotifier_distributionlist" ("id"),
"subscriber" varchar(30) NOT NULL

the unique fields are not created.
the same happens for unique_together=(("distribution_list",
"subscriber"),)

Is there something I need to do or am leaving out?

Thanks again

Brian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: displaying thumbnails in the admin

2006-09-01 Thread adamjspooner

Oh yeah, on this note...do I need to override the default
get__url() for this?  I tried using it, and it returns a relative
url instead of an absolute url (MEDIA_ROOT and MEDIA_URL are set in
settings).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread Chris Long

See:
http://www.djangoproject.com/documentation/model_api/#unique-together

Cheers,

Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Re: django/core/meta

2006-09-01 Thread James Bennett

On 9/1/06, brian corrigan <[EMAIL PROTECTED]> wrote:
> Oops... Sorry about that, airhead moment. Is there a similar function
> to unique_together now that can be used?

Take a look at the model documentation[1]; most of the names of the
'meta' and 'admin' options on models haven't changed, they've just
moved -- now when you're defining a model you start with 'from
django.db import models' instead of 'from django.core import meta'.

[1] http://www.djangoproject.com/documentation/model_api/

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



displaying thumbnails in the admin

2006-09-01 Thread adamjspooner

Newb question.  I'm using the PIL to create thumbnails of page
templates for a simple CMS that I'm building.  The function is written
- Python isn't my problem.  My problem is how to go about adding the
thumbnails to the view.  Do I use foo.show() somewhere, somehow in a
view?  Do I make a template tag and pass the thumbnails as the object
(with a Manager)?

This is where I continually run into trouble.  I have no trouble making
things in Python.  I have trouble when I try to tie what I've made in
Python into Django.  Does anyone have any suggestions on how I can wrap
my brain around this?  Don't catch a fish for me...teach me how to
fish.  =)

Cheers!
Adam Spooner


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread brian corrigan


Jacob Kaplan-Moss wrote:
> On Sep 1, 2006, at 9:17 AM, brian corrigan wrote:
> > However with the project I'm working on, I can't change the Django
> > version I'm working on. I have tried doing an SVN update on the core
> > directory but meta was not included in it. Is there anyway I can
> > download the relevant files/folders?
>
> What I was trying to say -- sorry if it wasn't clear -- is that in
> Django trunk django.core.meta no longer exists; it's been replaced
> (as explained in those pages I linked to).

Oops... Sorry about that, airhead moment. Is there a similar function
to unique_together now that can be used?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



How to use month/date/year menus for date?

2006-09-01 Thread Sean Schertell

Hi,

My model has a date field in it and I want to collect that data in my  
form with a more traditional method than the default text field that  
the FormWrapper generates. I want to use three select menus with  
month/date/year pulldowns. What the best way to do this while keeping  
my model happy?

Thanks in advance,
Sean

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread Jacob Kaplan-Moss

On Sep 1, 2006, at 9:17 AM, brian corrigan wrote:
> However with the project I'm working on, I can't change the Django
> version I'm working on. I have tried doing an SVN update on the core
> directory but meta was not included in it. Is there anyway I can
> download the relevant files/folders?

What I was trying to say -- sorry if it wasn't clear -- is that in  
Django trunk django.core.meta no longer exists; it's been replaced  
(as explained in those pages I linked to).

If you want to stick with an older version of Django, check out the  
sidebar at http://www.djangoproject.com/download/ to download a  
previous release.

Jacob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread Adrian Holovaty

On 9/1/06, brian corrigan <[EMAIL PROTECTED]> wrote:
> However with the project I'm working on, I can't change the Django
> version I'm working on. I have tried doing an SVN update on the core
> directory but meta was not included in it. Is there anyway I can
> download the relevant files/folders?

Hey Brian,

A "svn update" won't do you any good, because that gets you the
*latest* version of Django, which no longer uses django.core.meta.
What you want to do is one of these two things:

  * Get version 0.91 from http://www.djangoproject.com/download/ .

  * Get the latest "0.91-bugfixes" release from
http://code.djangoproject.com/svn/django/branches/0.91-bugfixes/ .
This is a branch devoted to maintaining the 0.91 version of code
(which is what you're using), purely to fix big bugs.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread brian corrigan

Also...

I have downloaded the .tar.gz file from the django site and browsed to
django/core and again there is no mention of meta.

Is there something I'm missing?

If there is no work around this for me, is there any other way I can
implement the following code...

distribution_list = meta.ForeignKey(DistributionList)
subscriber = meta.CharField(maxlength=30)
class META:
unique_together=(("distribution_list", "subscriber"),)

?

It is the unique_together that I need to implement.


Thanks in advance 

Brian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



which css files are loaded?

2006-09-01 Thread cyberco

I'm trying to learn how to use CSS in combination with Django (I owe a
great deal to Jeff Croft for his LOST theories example
site).Unfortunately I ran into the following problem. I am using a
'base.css' that loads other css files, e.g.

@import url("homepage.css");
@import url("user.css");

Only a few of the css files are loaded although they are all in the
same dir. Strangely enough, when I use a firefox extension to see which
css files are loaded there is a file called 'global.css' as well. This
file is part of the admin framework of Django I found out. How can this
css file be loaded without me specifying so?

Any good CSS related links are highly welcome! :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread brian corrigan

Thanks Jacob,

However with the project I'm working on, I can't change the Django
version I'm working on. I have tried doing an SVN update on the core
directory but meta was not included in it. Is there anyway I can
download the relevant files/folders? 

Thanks again,


Brian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: put some initial data in the db

2006-09-01 Thread charles sibbald
Hi Mikah,     Would you be willing to share your script, minus anything to sensitive.     Regards     charlesmazurin <[EMAIL PROTECTED]> wrote:  Another option, which may or may not be acceptable, is to write an SQLscript containing the necessary INSERTs and run it using yourdatabase's command line client, after syncdb has run.I do this because syncdb seems to break when runningmyapp/sql/mymodel.sql files when they contain newlines (no idea why).Plus, I have to do things like create views and stored procedures,which are very database-specific things anyway.I automate the whole process with a shell script that drop-creates thedatabase, runs syncdb, then runs the view- and storedprocedure-creating
 script.- mikah		Do you Yahoo!? 
Get on board. You're invited to try the new Yahoo! Mail.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django users" group.  To post to this group, send email to django-users@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: Djangoproject site broken ?

2006-09-01 Thread Jacob Kaplan-Moss

On Sep 1, 2006, at 6:18 AM, Bruno Desthuilliers wrote:
> Seems like there are problems with the djangoproject site - no css,
> broken internal links etc... (someone mentionned it on c.l.py a few
> minutes ago, and I experimented the same problem).

Fixed now, FYI.

Jacob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django/core/meta

2006-09-01 Thread Jacob Kaplan-Moss

Hi Brian --

Django's actually undergone some pretty sweeping changes since you  
last played with it.  Probably the best place to start is by reading  
the 0.95 release notes (http://www.djangoproject.com/documentation/ 
095_release_notes/) for an overview of what's changed.

That page will eventually lead you to http://code.djangoproject.com/ 
wiki/RemovingTheMagic, which describes is gory details all the  
changes since last time you checked out Django.

Jacob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



django/core/meta

2006-09-01 Thread [EMAIL PROTECTED]

Hi all,

I dowloaded django for the first time about a month and a half ago and
today tried this line:

from django.core import meta

but keep getting this error:

Error: cannot import name meta. Are you sure your INSTALLED_APPS
setting is correct?

When I browsed the directory I found that the meta folder does not
exist in my django/core. Do I have to download this from somewhere or
move it from another location?

Any help you can give me would be great.

Cheers

Brian Corrigan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: group traffic

2006-09-01 Thread [EMAIL PROTECTED]

Gary Wilson wrote:
> A Django forum would be another option.  IMO, forums have more of a
> community feel, and are also probably a little more friendly for
> newbies.  And, unlike with this mailing list, you would be able to
> reply to posts that are more than 30 days old.

In my opinion the Google Groups interface is the best: you can now
subscribe to updates for the post u're interested in and the search
just works. Plus all the old posts with new replies get highlighted on
the right.

Lorenzo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Problem accessing users and groups in Admin

2006-09-01 Thread Luis P. Mendes



Jay Parlar escreveu:
> On 8/30/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote:
> 
>> I have something to add:
>> - I can add or delete 'fichas' from the admin site with no problem.
>> - This 0.95 version is an upgrade from 0.91.
>>
> 
> That last part is interesting. Did you have a database running against
> 0.91, and then you upgraded just your Django to 0.95? I never used
> Django pre-magic-removal, but there's a possibility that the required
> database fields are different.
> 
> Alternatively, something from 0.91 was maybe not upgraded properly
> (either in your Django source code, or in your own code). You've read
> the migration document?
> 
> http://code.djangoproject.com/wiki/RemovingTheMagic
> http://code.djangoproject.com/wiki/MagicRemovalCheatSheet
> 
I followed the instructions of RemovingTheMagic but only grasped
MagicRemovalCheatSheet. So, I'll try to find the error(s) on this file.

Thank you for your help once again.

Luis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Djangoproject site broken ?

2006-09-01 Thread Bruno Desthuilliers

Hi

Seems like there are problems with the djangoproject site - no css,
broken internal links etc... (someone mentionned it on c.l.py a few
minutes ago, and I experimented the same problem).


-- 
bruno desthuilliers
développeur
[EMAIL PROTECTED]
http://www.modulix.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Addingg to admin nice selector for editing ForeignKey fields in case of relatively large number of items (adopted from SelectFilter2.js)

2006-09-01 Thread Andrew
Hi,

I adopted nice SelectFilter2.js for single item selecting with search
in change forms
in case of relatively large lists.
Here is my changes against current sources (0.96-pre).
It's seems work for me.

# add file SelectFilter3.js to ..\admin\media\js (adaptation of
SelectFilter2.js)
--
/*
SelectFilter3 - Turns a multiple-select box into a filter interface.

Different than SelectFilter because this is coupled to the admin framework.

Requires core.js, SelectBox.js and addevent.js.
*/

function findForm(node) {
// returns the node of the form containing the given node
if (node.tagName.toLowerCase() != 'form') {
return findForm(node.parentNode);
}
return node;
}

var SelectFilter3 = {
init: function(field_id, field_name, is_stacked, admin_media_prefix) {
var from_box = document.getElementById(field_id);
from_box.id += '_from'; // change its ID
from_box.className = 'filtered';
from_box.size = 5

// Remove , because it just gets in the way.
var ps = from_box.parentNode.getElementsByTagName('p');
for (var i=0; i

Re: mod_python-3.2.10/Apache-2.2.2/FreeBSD/

2006-09-01 Thread Wiktor Grębla

Ivan Sagalaev napisał(a):

>> I have lighttpd+fastcgi configuration on the same host, but apache + 
>> mod_python looked like a good idea (for a change).
>> 
>
> Interesting I've just made as switch in other direction :-). 
> Lighty+FastCGI just takes less memory...

If it was up to me, I'd have replaced Apache on this machine :) (I 
really like lighttpd),
but it's not.

W.

Talkers are no good doers.
http://greblus.net/djangoblog/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Django on shared hosting - no effect until restart SOLVED

2006-09-01 Thread viestards

Looks like I have to add to httpd.conf
FastCgiConfig -autoUpdate

http://www.fastcgi.com/docs/faq.html#application_reload

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: mod_python-3.2.10/Apache-2.2.2/FreeBSD/

2006-09-01 Thread dt

Last time I tried Apache-2.2 with mod_python 3.x and it didn't work for
me. I degraded to apache2.0 and now everything works. I am using
Freebsd 6.1.  There was a known problem about 3 months ago, maybe it's
fixed now, in which case you need to update your ports (advise using
portsnap for this) and reinstall everything again.

-dt


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: foreignKey + manipulator...performance problem, SOLVED

2006-09-01 Thread gabor

[EMAIL PROTECTED] wrote:
> 
> Gábor Farkas wrote:
>> [EMAIL PROTECTED] wrote:
>>> What do you mean with "2000 thing objects"? Are there 2000 records in
>>> the database for that table, or did you have 2000 records in memory at
>>> runtime?
>>>
>> if you don't use raw_id_admin, then (from my understanding at least),
>> the manipulator loads all of them into the memory.
>> so you have all the objects from the database-table in the memory.
> 
> You know, I really couldn't believe it - so I went home this evening
> and made a test case to work it through. Sure enough, it did *exactly*
> that... I've posted a short sample of the performance degredation graph
> on my blog at
> 
> 
> http://www.rhonabwy.com/wp/2006/08/31/a-subtle-django-performance-hit/
> 

nice :)

i'm not sure if i agree with the idea of having raw_id_admin=True by 
default (hmmm..maybe i do... i don't know), but i definitively think 
that this flag should be mentioned in a more "frequently read" place 
than the model_api docs... maybe in the tutorials even.

gabor

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Rows in admin TextFields

2006-09-01 Thread Andrew Stoneman

I have the following model:

class Fact(models.Model):
 text = models.TextField(core = True)
 newspost = models.ForeignKey(Newspost,
  edit_inline = models.TABULAR,
  num_in_admin = 5,
  min_num_in_admin = 5,
  num_extra_on_change = 3,
  related_name = "facts")

Because each newspost shows 5 of these, and they generally aren't  
very long, the default of 10 rows is too much, and makes the admin  
interface a bit awkward.  Searching through the mailing list  
archives, I turned up suggestions to use CSS, either by id, or by the  
class .vLargeTextField.  Neither of these will work in my case,  
however.  There are five facts by default, with id's #id_fact.1.text  
through #id_fact.5.text, which would be possible, although ugly, but  
through repeated changes, there could be an unbounded number of them,  
and I can't list all the possible id's.  Also, I can't  
use .vLargeTextField because the newspost itself has it's own  
textField, which I don't want to shrink.  Is there a reasonable  
solution to this, or am I going to have to list id's up to 100 or  
something and hope that's enough?

Andrew

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---