Re: Multiple file upload crashes dev server

2007-03-20 Thread Caz


> OK, I'm impressed. :-)
>
> Nice job thinking through all the things it might be and thinking of
> horses, not zebras.
>
> Malcolm

A happy confluence of unrelated events should get the credit tho: work
frustration turning into determination to be useful to someone and
discovering my new Dell has the nerve to beep at me even with the
volume muted :)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: newforms and output of required fields

2007-03-20 Thread [EMAIL PROTECTED]

Hi Rubic,

On Mar 20, 5:18 pm, "Rubic" <[EMAIL PROTECTED]> wrote:
> On Mar 20, 4:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > I have explained the technique with example code here:
> >http://code.djangoproject.com/wiki/TemplatedForm
>
> Very nice, Alex.  You might consider adding this code
> to the djangosnippets.org site.

Done :)
http://www.djangosnippets.org/snippets/121/

>  FWIW, you can replace
> the first 4 lines in output_via_template with a single
> assignment:
>
> bound_fields = [BoundField(self, field, name) for name, field
> in self.fields.items()]

Thanks! This worked well.



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Django Stuff

2007-03-20 Thread Mary

I am using 0.95.1 the latest stable version for Django
--MA

On Mar 20, 10:21 pm, "Matthew Flanagan" <[EMAIL PROTECTED]>
wrote:
> On 3/20/07, Mary <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > here is my search.py
>
> > from django.contrib.sites.models import Site
>
> > from stuff.search.helpers import SearchDefinition
>
> > class PageSearch(SearchDefinition):
> > model_module = 'test.Unpublished_Pages'
> > time_order_by = 'time_created'
> > search_fields = ('title', 'text')
>
> > I put it in one of my applications inside the project and i get
> > another error now which is :
>
> > Exception Value:'NoneType' object has no attribute 'objects'
> > Exception Location: /var/www/test/stuff/search/helpers.py in
> > get_id_list, line 32
>
> > Sorry for all my questions which may be stupid :(
> > Thank you in advance for help
>
> Which version of Django are you using? 0.95.x or trunk? there was a
> problem in 0.95 that caused stuff.search to fail.
>
>
>
>
>
> > On Mar 20, 12:02 pm, "Matthew Flanagan" <[EMAIL PROTECTED]>
> > wrote:
> > > On 3/20/07, Mary <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Mathew
>
> > > > I really appreciate this diff patch it solves all the problem and now
> > > > i am just facing one error in the search.py
> > > > xception Value: No module named helpers
> > > > Exception Location: /var/www/test.net/test/search.py in ?, line 11
>
> > > > Do u have an idea why this could happened
>
> > > Can you provide test/search.py?
>
> > > > hi Doug
>
> > > > Thanks for the snippets but i really can't understand how it works is
> > > > there any full example that i can see or any documnetation that i can
> > > > read for that
>
> > > > Thank you in advance ;
> > > > Mary Adel
>
> > > > On Mar 19, 11:42 pm, "[EMAIL PROTECTED]"
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > As noted in another thread there is a hack way of adding search to a
> > > > > model detailed on teh django snippits 
> > > > > site:http://www.djangosnippets.org/snippets/31/http://www.djangosnippets.o...
>
> > > > > It is no where near as nice nor as comprehensive as the old django
> > > > > stuff abstract search interface, but it does get the job done in a
> > > > > pinch.
>
> > > > > -Doug
>
> > > --
> > > matthewhttp://wadofstuff.blogspot.com
>
> --
> matthewhttp://wadofstuff.blogspot.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?hl=en
-~--~~~~--~~--~--~---



Re: models.ManyToManyField: Multi-relationship in one table

2007-03-20 Thread hoamon

i persist in models.ManyToManyField so much so that i forgot this
method.

thank you Ivan.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



ANN: workaround for MySQLdb upgrade problems

2007-03-20 Thread Malcolm Tredinnick

All,

Understanding that not everybody is in a position to immediately upgrade
their version of MySQLdb to the required 1.2.1p2 upon release of 0.96,
we have now committed a backwards-compatible MySQL backend to the
repository. This is called mysql_old.

If you really, really cannot upgrade the MySQLdb you are running against
and are willing to accept the problems caused by using the older
version, replace the mysql backend setting in settings.py with
'mysql_old' and everything should work as before.

It is important to realise:

- This backend is instantly deprecated. It is only a support
measure in order to give people time to upgrade. It will be
removed in a future release.

- This backend will not be actively developed. The only changes
we will make to it will be necessary security fixes, as per our
security policy. It will not necessarily support all the options
and functionality that the 'mysql' backend supports,
particularly in the development period following the 0.96
release.

Hopefully this will provide affected users with a less painful upgrade
path to a supported version.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Suggestions for Django Presentation

2007-03-20 Thread Jeremy Dunck

On 3/20/07, Scott Paul Robertson <[EMAIL PROTECTED]> wrote:
...
> I'm looking for suggestions of more features to emphasize/show-off. So
> what does everyone think? What features make Django such a great
> framework?

urlconf is actually one of my favorite features.  It's been months
since I had to fight mod_rewrite.  ;)
admin, of course.
orm.
syndication and sitemap.
i18n.
caching.
solid deployment w/ mod_python.
pragmatic community.

How long's the pres?  You might just pick some high points and make a
slide at the end with small font and loads of links to all the other
stuff you didn't have time form.  ;-)

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Suggestions for Django Presentation

2007-03-20 Thread Kenneth Gonsalves


On 21-Mar-07, at 8:07 AM, Scott Paul Robertson wrote:

> I'm looking for suggestions of more features to emphasize/show-off. So
> what does everyone think? What features make Django such a great
> framework?

one thing that you cannot overemphasise is that django is just  
python. Many people forget this. You can write practially any code  
whatsoever in python and put it in the view - yes, even something  
like programming your electric toaster through the usb port and  
controlling through django over the web

-- 

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?hl=en
-~--~~~~--~~--~--~---



informing user about unsaved fields in overridden save method (in admin)

2007-03-20 Thread Evren Esat Ozkan

Hi,

I'm checking a field's value againts related object and deciding
saving or not.
But I can't a way to inform user about save state.
Searched  for way of "redirecting to error page" or "passing custom
error messages to admin templates" but found nothing.
(custom valitador is useless because field_data is not paired with
object id)

Any help would be greatly appreciated,

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?hl=en
-~--~~~~--~~--~--~---



'module' object has no attribute 'handler404'

2007-03-20 Thread akonsu

hello,

i have no handler404 defined in my application, so when a 404 is
raised the server returns internal server error and an error message
saying 'module' object has no attribute 'handler404' is written in to
the log. how to make it use the default 404 view?

i am running the current version from svn.

thanks
konstantin


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Suggestions for Django Presentation

2007-03-20 Thread Scott Paul Robertson
I'm giving a presentation on Django to two local Linux Users Groups in
the next month. I don't want to rehash the tutorial; I'd rather spend
time showing off why Django is cool and how to do interesting things
with it. Currently I want to talk about:
- Authenticate framework
- Generic views
- Template language
- Newforms

I'm looking for suggestions of more features to emphasize/show-off. So
what does everyone think? What features make Django such a great
framework?

Thanks,
Scott

PS. If anyone is wondering, the groups are the Provo Linux Users Group
and the BYU Unix Users Group, in Utah, and I'm presenting on April 11th
and 12th, respectively.

-- 
Scott Paul Robertson
http://spr.mahonri5.net
GnuPG FingerPrint: 09ab 64b5 edc0 903e 93ce edb9 3bcc f8fb dc5d 7601


pgpYWVV7gSTI9.pgp
Description: PGP signature


Re: Mod_python + MySQLdb won't install ...

2007-03-20 Thread Gerry Steele

you might need to have the mysql source files installed to  get it to  
work. I'm on debian so i can't give instructions for your distro.

On Tue, 20 Mar 2007 23:15:25 -, dbee <[EMAIL PROTECTED]> wrote:

>

> ImportError: this is MySQLdb version (1, 2, 2, 'final', 0), but _mysql
> is version (1, 0, 0, 'final', 1)
> When I try to build the source version of MySQLdb from sourceforge, it
> just errors with this non-descript error...
> error: command 'gcc' failed with exit status 1
> I really wasn't expecting it to take so long to get mod_python +
> MySQLdb working.
> Help



-- 
http://belfast.no-ip.info/
Get http://www.ubuntu.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?hl=en
-~--~~~~--~~--~--~---



Re: newforms and output of required fields

2007-03-20 Thread Waylan Limberg

On Sat, 17 Mar 2007 17:02:43 -0400, Andreas Ahlenstorf  
<[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I'm playing around with newforms and I like to give the labels of my
> required fields a special styling using CSS. For that I need a class
> attribute in every label. But until now I wasn't able to figure out
> how to do it.
>
> Setting a field as required doesn't give me a 'required' class or
> something like that when using the built-in functions for form
> rendering (like as_p()). Passing an additional attribute to the
> widget works only with the field itself. So, what does I need to do
> get a custom class on all labels of my required fields?
>
> - A.
>

Ticket #3512 addresses this issue. I'd suggest trying the latest patch  
just uploaded the other day.

http://code.djangoproject.com/ticket/3512


-- 
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?hl=en
-~--~~~~--~~--~--~---



djschemadiff - show differences between Django database schemas

2007-03-20 Thread Sam Morris
Tired of manually updating your database schema after changing your
model classes? So was I! I wrote a tool called djschemadiff to
automatically compare your database's current schema to the schema that
would be produced if you started with a fresh, empty database and then
ran syncdb.

Currently it works with PostgreSQL 8.1, but shouldn't be too hard to
extend to work with other database systems.

djschemadiff can be downloaded from
. Feel free to send me any
comments, flames or patches!

-- 
Sam Morris
http://robots.org.uk/

PGP key id 1024D/5EA01078
3412 EA18 1277 354B 991B  C869 B219 7FDB 5EA0 1078


signature.asc
Description: This is a digitally signed message part


Problem importing models in custom data import scripts

2007-03-20 Thread Nathan Harmston
Hi Guys and Gals,

I am currently trying to import a large amount of data held in flatfiles
into a database so that it can be displayed through Django. I am using the
most recent development version of Django. I found that a new method called
get_or_create, however I cant seem to get it to work as I cant import the
models file into my Parser script.

My Project is called pynomics and the app alignments.
~/pynomics/alignments/models.py

so in my "Parser.py", I try to import the models file
from pynomics.alignments.models import *

but I get the following error when I try to run it:
Traceback (most recent call last):
  File "Parser.py", line 1, in ?
from pynomics.pyalignments.models import Interval
ImportError: No module named pynomics.pyalignments.models

However the import seems to work when I import it in views.py. Does anyone
know what is wrong with my setup and how to fix it?

Many Thanks in advance

Nathan

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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?hl=en
-~--~~~~--~~--~--~---



Philippine Sex Scandal & Sex Tips

2007-03-20 Thread sex

UPLOAD FILIPNA SEX PICTURES & SEX TIPS AT
http://www.pinoysexguru.blogspot.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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-20 Thread Malcolm Tredinnick

On Tue, 2007-03-20 at 07:48 +, Caz wrote:
> Hi Lorenzo
> 
> I suspect its not that you are uploading 2 files, but which files u
> upload.
> 
> The line
> print "%s %s %s %s" % (k, new_data[k]["filename"],new_data[k]["content-
> type"], new_data[k]["content"])
> Will print the actual content of the file you are uploading.
> 
> Now if thats an image or binary file the char \x07 will appear in it.
> Which is system beep.(Printing char \x07 will make windows beep, Dell
> does not play nicely with system beep, no way to mute it, I know, I
> have one.)
> 
> So with many \x07 chars in the content you system is going to look
> like its hanging beeping like crazy until its beeped its way through
> the files you are uploading.

OK, I'm impressed. :-)

Nice job thinking through all the things it might be and thinking of
horses, not zebras.

Malcolm



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Multiple file upload crashes dev server

2007-03-20 Thread [EMAIL PROTECTED]

On Mar 20, 8:48 am, "Caz" <[EMAIL PROTECTED]> wrote:
> Hi Lorenzo
>
> I suspect its not that you are uploading 2 files, but which files u
> upload.
>
> The line
> print "%s %s %s %s" % (k, new_data[k]["filename"],new_data[k]["content-
> type"], new_data[k]["content"])
> Will print the actual content of the file you are uploading.
>
> Now if thats an image or binary file the char \x07 will appear in it.
> Which is system beep.(Printing char \x07 will make windows beep, Dell
> does not play nicely with system beep, no way to mute it, I know, I
> have one.)

Thanks Caz, this makes sense and it's confirmed by the fact that
uploading a non binary file didn't produce any beep even having the
print statement.

I've removed the print statement now and everything is fine ;-)

Thanks a lot,
L.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Mod_python + MySQLdb won't install ...

2007-03-20 Thread dbee

System: Linux 2.6.9-34.0.1.EL #1 Wed May 24 07:40:56 CDT 2006 i686
athlon i386 GNU/Linux
OS: CentOS
Python: 2.3.4
Mysql: 5.0

I'm having lots of issues trying to get my django server up. It seems
that mod_python won't work on my system.

When I yum install mysql-python, the package installs fine, but I get
this error whenever I need to import it into my python scope.

>>> import MySQLdb
ImportError: this is MySQLdb version (1, 2, 2, 'final', 0), but _mysql
is version (1, 0, 0, 'final', 1)

When I try to build the source version of MySQLdb from sourceforge, it
just errors with this non-descript error...

error: command 'gcc' failed with exit status 1

I really wasn't expecting it to take so long to get mod_python +
MySQLdb working.

Help


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: MySQLdb version

2007-03-20 Thread Andy Dustman

On 3/20/07, chasfs <[EMAIL PROTECTED]> wrote:
>
> Thanks for the quick reply!  Do you know if Django has been tested
> with MySQLdb
> 1.2.2?

Yes. 1.2.2 is the best version you can get. Trust me.

> On Mar 20, 11:20 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> > On 3/20/07, chasfs <[EMAIL PROTECTED]> wrote:
> >
> > > The problem is that the MySQLdb page says that 1.2.1p2 has no changes
> > > that we should worry about.  Why is p2 required?

No changes relative to 1.2.1 that affect users using MySQL-4.1 or
newer. If you were using MySQL-4.0, 1.2.1 didn't work and you needed
1.2.1p2.

-- 
Patriotism means to stand by the country. It does
not mean to stand by the president. -- T. Roosevelt

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?hl=en
-~--~~~~--~~--~--~---



Re: Development in LAN. URLs of FlatPages. Best Practices?

2007-03-20 Thread Aidas Bendoraitis

> have you found any solution?
Yes. I wrote my own FlatPage model with it's own middleware. Now the
URL can be empty and it represents the relative path counting from the
website root directory. The root directory is "/" on the public site
and "/someproject/" on the development site. The root directory is set
in the settings.

> would it be correct to say that the problem would
> be solved if there was a way to access project settings from inside
> flatpages?
Not really. You don't define what you mean, saying "from inside
faltpages" - whether you're talking about models, views, middleware,
or something else from the flatpages. Anyway, it's enough to write
your own middleware to override the default control of the flatpages
(And fortunately it is not hard to do that).

Regards,
Aidas Bendoraitis [aka Archatas]


>
> On Mar 5, 12:44 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
> wrote:
> > We are developing a few Django projects. The development versions are
> > accessible in the local network under some directories of the local
> > server's IP (i.e.http://1.2.3.4/example/) and the published versions
> > are accessible under some domains directly (i.e.http://example.com/).
> >
> > If you have a similar situation, how are you dealing with the URLs 
> > ofFlatPages? The problem is that in the development version the URLs are
> > like /example/about/ and in the published version they are like
> > /about/. So we need to modify all theflatpageswhen transfer the data
> > from the development version to the public one.
> >
> > The ideas that came to my mind:
> > 1. creating my own FlatPage model based on the contributed one which
> > corresponds to the directory setting in the project settings.
> > 2. installing a BIND (DNS) server locally so that we didn't have to
> > put projects under specific directories, but rather under local domain
> > names (i.e.http://example.local/).
> > 3. creating some middleware that removes directory name from the
> > requested URL before URL parsing.
> >
> > What are the best practices for doing that? What do you do in similar
> > situations?
> >
> > Regards,
> > Aidas Bendoraitis [aka Archatas]
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Development in LAN. URLs of FlatPages. Best Practices?

2007-03-20 Thread mezhaka

have you found any solution? i am interested in handling this
situation as well. would it be correct to say that the problem would
be solved if there was a way to access project settings from inside
flatpages?

On Mar 5, 12:44 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
wrote:
> We are developing a few Django projects. The development versions are
> accessible in the local network under some directories of the local
> server's IP (i.e.http://1.2.3.4/example/) and the published versions
> are accessible under some domains directly (i.e.http://example.com/).
>
> If you have a similar situation, how are you dealing with the URLs 
> ofFlatPages? The problem is that in the development version the URLs are
> like /example/about/ and in the published version they are like
> /about/. So we need to modify all theflatpageswhen transfer the data
> from the development version to the public one.
>
> The ideas that came to my mind:
> 1. creating my own FlatPage model based on the contributed one which
> corresponds to the directory setting in the project settings.
> 2. installing a BIND (DNS) server locally so that we didn't have to
> put projects under specific directories, but rather under local domain
> names (i.e.http://example.local/).
> 3. creating some middleware that removes directory name from the
> requested URL before URL parsing.
>
> What are the best practices for doing that? What do you do in similar
> situations?
>
> Regards,
> Aidas Bendoraitis [aka Archatas]


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: defecting to django from rails

2007-03-20 Thread Jeremy Dunck

On 3/20/07, rubdabadub <[EMAIL PROTECTED]> wrote:
> Thank you very much for all the input. I found them to be
> very valuable. As for me I am back to python interactive shell i.e
> python -i
> Well you have to start somewhere :-)

Run, don't walk, to get IPython working.
http://ipython.scipy.org/moin/

If you're on windows, there's a bit of extra work involved in getting
syntax highlighting and auto-complete working, but you'll make back
the time in a single day.

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: defecting to django from rails

2007-03-20 Thread rubdabadub

Doug & James:


Thank you very much for all the input. I found them to be
very valuable. As for me I am back to python interactive shell i.e
python -i
Well you have to start somewhere :-)

Thanks again for all the comments and inputs. Very kind.

Regards
Raj


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Django Stuff

2007-03-20 Thread Matthew Flanagan

On 3/20/07, Mary <[EMAIL PROTECTED]> wrote:
>
> here is my search.py
>
> from django.contrib.sites.models import Site
>
> from stuff.search.helpers import SearchDefinition
>
>
> class PageSearch(SearchDefinition):
> model_module = 'test.Unpublished_Pages'
> time_order_by = 'time_created'
> search_fields = ('title', 'text')
>
>
> I put it in one of my applications inside the project and i get
> another error now which is :
>
> Exception Value:'NoneType' object has no attribute 'objects'
> Exception Location: /var/www/test/stuff/search/helpers.py in
> get_id_list, line 32
>
> Sorry for all my questions which may be stupid :(
> Thank you in advance for help
>

Which version of Django are you using? 0.95.x or trunk? there was a
problem in 0.95 that caused stuff.search to fail.

>
> On Mar 20, 12:02 pm, "Matthew Flanagan" <[EMAIL PROTECTED]>
> wrote:
> > On 3/20/07, Mary <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Hi Mathew
> >
> > > I really appreciate this diff patch it solves all the problem and now
> > > i am just facing one error in the search.py
> > > xception Value: No module named helpers
> > > Exception Location: /var/www/test.net/test/search.py in ?, line 11
> >
> > > Do u have an idea why this could happened
> >
> > Can you provide test/search.py?
> >
> >
> >
> >
> >
> > > hi Doug
> >
> > > Thanks for the snippets but i really can't understand how it works is
> > > there any full example that i can see or any documnetation that i can
> > > read for that
> >
> > > Thank you in advance ;
> > > Mary Adel
> >
> > > On Mar 19, 11:42 pm, "[EMAIL PROTECTED]"
> > > <[EMAIL PROTECTED]> wrote:
> > > > As noted in another thread there is a hack way of adding search to a
> > > > model detailed on teh django snippits 
> > > > site:http://www.djangosnippets.org/snippets/31/http://www.djangosnippets.o...
> >
> > > > It is no where near as nice nor as comprehensive as the old django
> > > > stuff abstract search interface, but it does get the job done in a
> > > > pinch.
> >
> > > > -Doug
> >
> > --
> > matthewhttp://wadofstuff.blogspot.com
>
>
> >
>


-- 
matthew
http://wadofstuff.blogspot.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?hl=en
-~--~~~~--~~--~--~---



Re: IRC

2007-03-20 Thread Kenneth Gonsalves


On 20-Mar-07, at 8:08 AM, Todd O'Bryan wrote:

> I'm trying to use XChat to connect to the IRC channel, but I can only
> find #django-br and #django-fr on FreeNode.
>
> What am I stupidly doing?

#django is alive and well there
-- 

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?hl=en
-~--~~~~--~~--~--~---



Dynamically generated template variables in admin?

2007-03-20 Thread David Zhou

Hi all,

I'm trying to do something, but before I start, I figure I'll pass it  
on and see if anyone's already done something similar or has a better  
method of accomplishing the same thing.

Let me know if the following sounds feasible or if there's a better  
way of doing it:

Basically, I want to manage my templates in the admin view, and have  
the ability to define custom variables to be filled out.

Then, in say, the "Instance" admin add page, the user is able to  
select a template.  The page will then dymaically generate a table of  
the template variables that need to be filled out along -- like

Title: |==textfield==|
Variable2: |==textfield==|


Live Preview:
|===|
| Preview   |
| of Temp.  |
|===|

I'm thinking that I'll have to edit the admin code somehow, and have  
it parse the selelected template code for {{ variable_title }}.

Then it will use the variable name with underscores replaced with  
spaces as the title.

Should I wait for the new admin code before trying to edit the admin  
interface?

Does this sound like a good way of doing things?

Thanks,

---
David Zhou
[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?hl=en
-~--~~~~--~~--~--~---



Re: Search feature

2007-03-20 Thread Mary

Thanks for all the tips
I just want to know how the return result template will look like
So if any body can give me a small example i would really appretiate

Thank you in advance --
Mary Adel
:(

On Mar 19, 2:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Feb 22, 11:07 pm, "Mary" <[EMAIL PROTECTED]> wrote:
>
> > How can i add asearchfeature to my website?
>
> > Can anybody help me in this
>
> HiMary,
>
> have a look at these two 
> snippets:http://www.djangosnippets.org/snippets/31/(long version, easier to
> understand the principle)http://www.djangosnippets.org/snippets/32/(compact 
> version)
>
> L.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: MySQLdb version

2007-03-20 Thread chasfs

Thanks for the quick reply!  Do you know if Django has been tested
with MySQLdb
1.2.2?

On Mar 20, 11:20 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 3/20/07, chasfs <[EMAIL PROTECTED]> wrote:
>
> > The problem is that the MySQLdb page says that 1.2.1p2 has no changes
> > that we should worry about.  Why is p2 required?
>
> Unfortunately, there is a change that we need to worry about: the
> thread-safety bug in MySQLdb which caused ticket #3279[1] wasn't fixed
> until that version, which is why we now have the version check in
> Django.
>
> [1]http://code.djangoproject.com/ticket/3279
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Deployment with Subversion

2007-03-20 Thread [EMAIL PROTECTED]

Thanks everyone for the suggestions.  I might have "over-done" my
solution, but it works and my colleagues, clients and myself are
satisfied.  If you're interested, I use JSON to specify some settings
with should override those in settings.py.  See http://gnuvince.net/?p=371
for more information.

Vincent.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: newforms and output of required fields

2007-03-20 Thread Rubic

On Mar 20, 4:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I have explained the technique with example code here:
> http://code.djangoproject.com/wiki/TemplatedForm

Very nice, Alex.  You might consider adding this code
to the djangosnippets.org site.  FWIW, you can replace
the first 4 lines in output_via_template with a single
assignment:

bound_fields = [BoundField(self, field, name) for name, field
in self.fields.items()]

Best regards.

--
Jeff Bauer
Rubicon, Inc.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: MySQLdb version

2007-03-20 Thread James Bennett

On 3/20/07, chasfs <[EMAIL PROTECTED]> wrote:
> The problem is that the MySQLdb page says that 1.2.1p2 has no changes
> that we should worry about.  Why is p2 required?

Unfortunately, there is a change that we need to worry about: the
thread-safety bug in MySQLdb which caused ticket #3279[1] wasn't fixed
until that version, which is why we now have the version check in
Django.


[1] http://code.djangoproject.com/ticket/3279

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



MySQLdb version

2007-03-20 Thread chasfs

I just downloaded the latest trunk - it reports:

ImproperlyConfigured: Error importing middleware
django.contrib.sessions.middleware: "MySQLdb-1.2.1p2 or newer is
required; you have 1.2.1g3"

The problem is that the MySQLdb page says that 1.2.1p2 has no changes
that we should worry about.  Why is p2 required?

Thanks!
-chasfs


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Django & Web Services Api

2007-03-20 Thread johnny

I am not sure if I want to take XML-RPC approach.  In the future, I
may consider REST for Web Services API, like Flickr.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: problem with template {% url string %}

2007-03-20 Thread Paul Rauch

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ivan Sagalaev schrieb:
> Paul Rauch wrote:
>> Template:
>> {% url cvh.view.login %}
> 
> Here you have "view".
> 
>> urlpatterns = patterns('mysite.cvh.views',
>>  (r'^$','index'),
>>  (r'^login/$','login'),
>> )
> 
> And here you have "views". {% url %} doesn't find your pattern and 
> returns '' (empty string) that browser translates to a current URL.
> 
> {% url cvh.views.login %} should do.
> 

ok, this works.

but now I try to make it dynamic and stored the linkinfo to the database..

models.py:

class navigation(models.Model):
 name = models.CharField(maxlength=30)
 link = models.CharField(maxlength=30)
 def __str__(self):
  return self.name

views.py:

# Create your views here.
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response,get_object_or_404
from django.conf import settings

from mysite.cvh.models import group,navigation

media_root = settings.MEDIA_URL
navi_list = navigation.objects.all()


def index(request):
 return render_to_response('cvh/index.html',
 {
  'media_root' : media_root,
  'navi_list'  : navi_list,
 })

def login(request):
 return render_to_response('cvh/login.html',
 {
  'media_root' : media_root,
  'navi_list'  : navi_list,
 })

template:

  {% block navi %}
  
  {% if navi_list %}
  {% for elem in navi_list %}
   {{elem.name}}
   
  {% endfor %}
  {% else %}
   Index
   Login
  {% endif %}
  
  {% endblock%}
 


The static ELSE statement works. But the database ones don't..
They contain exactly the same content.
the html-output:
 
  
   Index
   
   Login
   
  
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iQIVAwUBRf/wehG67lyyQrltAQK57w//Th1K/16zXWT1htMwfdNSmISfCNGN8zYT
NrcsU71ZH5cFBIaRLLICcHggFk9DkafZ2O/hnU9wfQzxd2O7/MKeJxGLGCtnytxm
gCj9KKtx3ia0wu6GTV1+oXb/ebrU+u27gT205yZzHh5PIPkuhkyLx309/eVqhQgt
oLSRito+nszyQi3VKUxiKqRfJvhkNEeyH+Vc4BRFZGHOmVdSezoSoPzdwP99kVGh
IFSR+NlZrrqJPuBrApiXo/ervXkocVXR51yDgnnnovuC2J6rF0ErQ3lHo0C5Wz0X
Gug1R0G4crrkVIsNsI7UZ/YoHhuIUTgl21pg0b2SmfAbMBaxPT0qn+iTRKaw7oM/
/IDHrd2Q0aVLdtrSa5CqwMEUKHxXhRq0ixtylNLD96oizt+dNCUN4aagHAII1gUQ
AwNt4mwBlUMsj1yUCkLqpuca13wXW8PnVHYIFSakNL0AjTZM1lf/EREGyMNzz0CS
TKADQ8g8J54V7cPrfDtIWeQDX+myHT0eWXxM9DTBFC+6jXwxgE4xyRWVpO4VWyIq
EVebzgXvPeXqeK2fJT8wiQ/jbUBoIVHW67886edJ6cDAEAal6g9OvdXxYT7zcOFV
1YAXqoZJ3vzQ7KRxp66d4xA8mwsAlIKNz2mF1qyIC4ADKM5VKmoTVk4lRuzmRNs7
QI8NQFe8Lrw=
=YWXD
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Question on django.test.client.Client

2007-03-20 Thread [EMAIL PROTECTED]

I'll see what I can do.

On Mar 20, 9:42 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 3/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > However, if I want more than one selected boxes, using a list doesn't
> > work, it simply returns an empty list.  Is it possible to do with
> > Client or should I open a ticket and start working on a patch?
>
> This problem is already reported as #3212; its on my list of things to
> look at. If you want to help out, you can:
>
> 1) validate that the patch provided works, and
> 2) provide a test case (integrated into the Django system tests) to
> prove the validity of the patch.
>
> Yours,
> Russ Magee %-)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Question on django.test.client.Client

2007-03-20 Thread Russell Keith-Magee

On 3/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> However, if I want more than one selected boxes, using a list doesn't
> work, it simply returns an empty list.  Is it possible to do with
> Client or should I open a ticket and start working on a patch?

This problem is already reported as #3212; its on my list of things to
look at. If you want to help out, you can:

1) validate that the patch provided works, and
2) provide a test case (integrated into the Django system tests) to
prove the validity of the patch.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Question on django.test.client.Client

2007-03-20 Thread [EMAIL PROTECTED]

Hello everyone,

I have a page with a bunch of select boxes with the same name
("selected") and different values so that they are sent as a list to
the view.  I can't figure how to test multiple selections with
django.test.client.Client however.  This works for a single value:

self.client.post('/foo/', {'selected': '1'})

However, if I want more than one selected boxes, using a list doesn't
work, it simply returns an empty list.  Is it possible to do with
Client or should I open a ticket and start working on a patch?

Vincent


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Changing the database - attribute errors

2007-03-20 Thread Ramiro Morales

On 3/20/07, Merric Mercer <[EMAIL PROTECTED]> wrote:
>
> Another observation after more investigation.
>
> I decided to do the following:-
>
> 1. Drop the table (again) from the DB.
> 2. Alter the Model in Django.  This time I deleted one of the original
> fields named "rrp".
>
> Then:-
>
> 1.  I re-ran syncdb.  This confirmed  the creating of a new table in the db
> 2.  I checked  the db and the admin - again both of these showed up
> correctly with all the fields  from my Model.
> 3.  In the shell I then tried to run a query set on the table.   I got
> the following error
>
> " OperationError: (1054, "unknown column 'promotions_product.rrp' in
> field list)"
>
> This was the field that I deleted from the model.
>
> This is making me conclude that django is using two versions of the
> information in my Models.  The updated version is being used to
> correctly update the database and the admin - but the older version is
> being used to run the query sets.

Are you opening a new Python shell (with the myproject.promotions import)
after any of your model/database modifications or have been
maintaining the same shell session open from before you started
these mods?.

Regards,

-- 
 Ramiro Morales

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How much is Django memory footprint?

2007-03-20 Thread Atilla

On 20/03/07, Nuno Mariz <[EMAIL PROTECTED]> wrote:
>
> The processing is nothing in special, right now a weblog and a online
> store.
> I've removed some modules, like fcgi, include and suexec(I can't
> remember the instalation of this modules ;) ) and the size of the
> processes is now 22Mb.
> Do you have KeepAlive On?
> In my case did't solve the problem.
> Also, can I reduce the memory footprint if I had a independent server
> to serve static media, like lighttpd?

If you have a lot of static content, you definitely want to have a
separate server to handle that. Even if it is Apache - just use a
stripped down version (no funky modules) to serve your static data,
and keep the django system separate. All of the Django tutorials
recommend using a separate server for static files - extensively.

Try locating any other modules you're not using and turning them off.
For most of the performance tests I've done on systems running
mod-python/mod-perl, it really makes a difference - sometimes
immediately noticeable.

I've keep alive off, for many cases in serving dynamic content
KeepAlive in Apache will not help you at all. When it comes to serving
static content, and especially lots of javascript/css/image files for
web-pages, then it's a blessing - you can keep it on on your static
file server, whether it's Apache or something smaller/faster.

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Changing the database - attribute errors

2007-03-20 Thread Merric Mercer

Another observation after more investigation.

I decided to do the following:-

1. Drop the table (again) from the DB.
2. Alter the Model in Django.  This time I deleted one of the original 
fields named "rrp".

Then:-

1.  I re-ran syncdb.  This confirmed  the creating of a new table in the db
2.  I checked  the db and the admin - again both of these showed up 
correctly with all the fields  from my Model.
3.  In the shell I then tried to run a query set on the table.   I got 
the following error

" OperationError: (1054, "unknown column 'promotions_product.rrp' in 
field list)"

This was the field that I deleted from the model.

This is making me conclude that django is using two versions of the 
information in my Models.  The updated version is being used to 
correctly update the database and the admin - but the older version is 
being used to run the query sets. 

MerMer

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Changing the database - attribute errors

2007-03-20 Thread MerMer

This is a follow on from my previous email.  Things have got even
stranger and unpredicable.

I dropped the table from the database and then ran syncdb to re-create
a completely new and empty db.  However I STILL
cannot get the new fields to be recognized.  All the previous fields
are available.

The shell confirmed that a new table had been created.   I checked in
the DB and in the Admin and both or these
were working as expected.  I added a new record on all the fields via
the admin.

In the shell I run the following to return the new record and return
all the attributes.

record = Product.objects.get(id=1).
dir(record)

This shows that I cannot access the extra fields that I added to the
model.

This is really shaking my confidence in the system and I'm not sure
what else I can try.




--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Django Stuff

2007-03-20 Thread Mary

here is my search.py

from django.contrib.sites.models import Site

from stuff.search.helpers import SearchDefinition


class PageSearch(SearchDefinition):
model_module = 'test.Unpublished_Pages'
time_order_by = 'time_created'
search_fields = ('title', 'text')


I put it in one of my applications inside the project and i get
another error now which is :

Exception Value:'NoneType' object has no attribute 'objects'
Exception Location: /var/www/test/stuff/search/helpers.py in
get_id_list, line 32

Sorry for all my questions which may be stupid :(
Thank you in advance for help


On Mar 20, 12:02 pm, "Matthew Flanagan" <[EMAIL PROTECTED]>
wrote:
> On 3/20/07, Mary <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Mathew
>
> > I really appreciate this diff patch it solves all the problem and now
> > i am just facing one error in the search.py
> > xception Value: No module named helpers
> > Exception Location: /var/www/test.net/test/search.py in ?, line 11
>
> > Do u have an idea why this could happened
>
> Can you provide test/search.py?
>
>
>
>
>
> > hi Doug
>
> > Thanks for the snippets but i really can't understand how it works is
> > there any full example that i can see or any documnetation that i can
> > read for that
>
> > Thank you in advance ;
> > Mary Adel
>
> > On Mar 19, 11:42 pm, "[EMAIL PROTECTED]"
> > <[EMAIL PROTECTED]> wrote:
> > > As noted in another thread there is a hack way of adding search to a
> > > model detailed on teh django snippits 
> > > site:http://www.djangosnippets.org/snippets/31/http://www.djangosnippets.o...
>
> > > It is no where near as nice nor as comprehensive as the old django
> > > stuff abstract search interface, but it does get the job done in a
> > > pinch.
>
> > > -Doug
>
> --
> matthewhttp://wadofstuff.blogspot.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?hl=en
-~--~~~~--~~--~--~---



Re: Django & Web Services Api

2007-03-20 Thread Mohammad Tayseer
If you are using XML-RPC, then you should read this
http://effbot.org/zone/element-xmlrpc.htm



Mohammad Tayseer
http://spellcoder.com/blogs/tayseer

 
-
 Get your own web address.
 Have a HUGE year through Yahoo! Small Business.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Changing the database - attribute errors

2007-03-20 Thread Merric Mercer

When I want to add a new field to a database, with existing data, I 
normally don't have a problem as long as I follow these steps.

1.  Alter the django model.
2.  Manually adjust the database table ( mySQL)
3.  Run syncdb

However,  I used these steps this morning and it has not worked. The new 
fields are working fine in the Admin but I cannot access them 
elsewhere.  When I try to access them via the shell they are not 
recognized as attributes.   I've checked and double checked the 
settings, but nothing seems to help. 

What makes this even stranger is my colleague, working on a replica 
model, has created the extra fields without any problem. 

This has got me completely stumped.  Any ideas appreciated!

MerMer


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How much is Django memory footprint?

2007-03-20 Thread Nuno Mariz

The processing is nothing in special, right now a weblog and a online
store.
I've removed some modules, like fcgi, include and suexec(I can't
remember the instalation of this modules ;) ) and the size of the
processes is now 22Mb.
Do you have KeepAlive On?
In my case did't solve the problem.
Also, can I reduce the memory footprint if I had a independent server
to serve static media, like lighttpd?
Lets see if the processes will maintain in 22Mb size.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Subversion: How do you set up multiple branches of the same project on the same machine?

2007-03-20 Thread Aidas Bendoraitis

After some googling I found the solution myself.

For each branch of the same project I can set the following directives
in my Apache configuration:

SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonPath "sys.path+[r'/absolute/path/to/the/trunk']"
SetEnv DJANGO_SETTINGS_MODULE someproject.settings
PythonDebug On
PythonAutoReload On
PythonInterpreter someproject


SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonPath "sys.path+[r'/absolute/path/to/the/somebranch']"
SetEnv DJANGO_SETTINGS_MODULE someproject.settings
PythonDebug On
PythonAutoReload On
PythonInterpreter someproject2


I also symlink media directories respectively to someproject-media and
someproject2-media  in Apache htdocs.

Anyway, thanks, Scott, for your help as well.

Regards,
Aidas Bendoraitis [aka Archatas]



PythonPath 
"sys.path+[r'/Library/Subversion/general_src/branches/kulturprojekte']"

On 3/19/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> How can you import from a package if it is not under python path? Is
> there another way to do that than just to create a symlink in
> site-packages? PYTHON_PATH environment variable?
>
> The relation between someproject and someproject2 in my case is
> similar to django trunk and django per-object-permission branch. They
> are like one project at different statuses and at some point they'll
> need to be merged (at least some parts of them). Both someproject and
> someproject2 are self-contained projects. No other project uses any
> part of them.
>
> Regards,
> Aidas Bendoraitis [aka Archatas]
>
>
>
> On 3/19/07, ScottB <[EMAIL PROTECTED]> wrote:
> >
> > Hi Aidas.
> >
> > On Mar 19, 2:18 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
> > wrote:
> > > I have a symlink from trunk/someproject to site-packages/someproject
> > > on my machine.
> > >
> > > I need to launch the branched version of the project at the same time.
> > > So intuitively I create a symlink from branches/somebranch/someproject
> > > to site-packages/someproject2 to get it to the python path.
> >
> > Do your projects really need to be in site-packages?  Are they normal
> > self-contained projects, or does something else import them?
> >
> > I'm thinking you could have:
> >
> > /home/me/dev/someproject/
> > /home/me/dev/someproject2/
> >
> > Then either use manage.py runserver for each one (with different
> > ports), or configure Apache/Lighty/whatever to access those two
> > projects under different urls.  That way, both can run simultaneously.
> >
> > Scott
> >
> >
> > > >
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Django Stuff

2007-03-20 Thread Matthew Flanagan

On 3/20/07, Mary <[EMAIL PROTECTED]> wrote:
>
> Hi Mathew
>
> I really appreciate this diff patch it solves all the problem and now
> i am just facing one error in the search.py
> xception Value: No module named helpers
> Exception Location: /var/www/test.net/test/search.py in ?, line 11
>
> Do u have an idea why this could happened

Can you provide test/search.py?

>
> hi Doug
>
> Thanks for the snippets but i really can't understand how it works is
> there any full example that i can see or any documnetation that i can
> read for that
>
> Thank you in advance ;
> Mary Adel
>
> On Mar 19, 11:42 pm, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
> > As noted in another thread there is a hack way of adding search to a
> > model detailed on teh django snippits 
> > site:http://www.djangosnippets.org/snippets/31/http://www.djangosnippets.org/snippets/32/
> >
> > It is no where near as nice nor as comprehensive as the old django
> > stuff abstract search interface, but it does get the job done in a
> > pinch.
> >
> > -Doug
>
>
> >
>


-- 
matthew
http://wadofstuff.blogspot.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?hl=en
-~--~~~~--~~--~--~---



Re: (x)html tags used to render newforms

2007-03-20 Thread [EMAIL PROTECTED]


On Mar 11, 7:11 pm, Frédéric Roland
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was discussing about layout of forms using CSS and heard that there
> was some tags such as fieldset, label and legend that should allow us to
> make the layout of forms without tables. Is there a reason these tags
> aren't used to render forms in Django ? Does it is hard to add them ?
> (Something like as_label() for example.)

I think probably its much easier and very fast to completely customize
your form via HTML template.
I also belive that using django templates to render HTML is much
better suited tool vs. trying
to dynamically construct HTML inside of Python script. Here is example
of what I mean:

http://code.djangoproject.com/wiki/TemplatedForm

Alex


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Django Stuff

2007-03-20 Thread Mary

Hi Mathew

I really appreciate this diff patch it solves all the problem and now
i am just facing one error in the search.py
xception Value: No module named helpers
Exception Location: /var/www/test.net/test/search.py in ?, line 11

Do u have an idea why this could happened

hi Doug

Thanks for the snippets but i really can't understand how it works is
there any full example that i can see or any documnetation that i can
read for that

Thank you in advance ;
Mary Adel

On Mar 19, 11:42 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> As noted in another thread there is a hack way of adding search to a
> model detailed on teh django snippits 
> site:http://www.djangosnippets.org/snippets/31/http://www.djangosnippets.org/snippets/32/
>
> It is no where near as nice nor as comprehensive as the old django
> stuff abstract search interface, but it does get the job done in a
> pinch.
>
> -Doug


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: newforms and output of required fields

2007-03-20 Thread [EMAIL PROTECTED]

Hi Andreas,

On Mar 17, 11:02 pm, Andreas Ahlenstorf <[EMAIL PROTECTED]> wrote:

> Setting a field asrequireddoesn't give me a 'required' class or
> something like that when using the built-in functions for form
> rendering (like as_p()). Passing an additional attribute to the
> widget works only with the field itself. So, what does I need to do
> get a custom class on all labels of myrequiredfields?

OK I also started worrying about it today because one of my customers
asked me to
add asterisks to the required fields. I told I have a trouble with it
(hacking
around _html_output will not help since its already too big function
which seems needs
a refactoring.

Instead I have made decision to move all my forms to direct rendering
via
template. Results were astonishing since it uses less code  and seems
to be much
flexible then core technique. So since today I am moving all my forms
to use TemplatedForm.

I have explained the technique with example code here:
http://code.djangoproject.com/wiki/TemplatedForm

Please feel free to use it.

Regards,
 Alex


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How much is Django memory footprint?

2007-03-20 Thread Atilla

I've a moderatelly small apllication in production, that runs on FCGI,
instead of mod-python. From stress-tests it's prooven to be very fast
and responsive. FCGI is dynamically managed by Apache.

The memory footprint of my FCGI processes is around 12MB per process,
In addition, my Apache processes take around 6MB each.

I guess that ~18MB per process is normal in your case. A 50 MB process
is quite large however, what type of processing are you doing?

Also - for most of the cases you'd like to recycle an apache child
after a number of requests, so set the MaxRequestsPerChild to some
reasonable limit. If it is unlimited and something in your code
doesn't collect garbage memory properly, or it leaks memory, you'll
end up with your Apache children growing significantly, and loosing
the  copy-on-write pages that are shared between children.

In addition, make sure you take off any Apache modules that you're not using.

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: models.ManyToManyField: Multi-relationship in one table

2007-03-20 Thread Ivan Sagalaev

hoamon wrote:
> Course|Trainee|Company
> C1|  T1   |  Com1
> C1|  T2   |  Com1
> C1|  T3   |  Com1
> C2|  T1   |  Com2
> C2|  T3   |  Com1
> C2|  T4   |  Com2
> C3|  T1   |  Com2

You really can't do it using standard ManyToManyField. The common way is 
to create this relation explicitly:

 class Record(models.Model): # or whatever name fits
   course = models.ForeignKey(Course)
   trainee = models.ForeignKey(Trainee)
   company = models.ForeignKey(Company)

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---