Re[2]: XML output

2007-08-11 Thread Alex Nikolaenkov

You wrote 11 ??? 2007 ?., 13:55:42:

> Alex Nikolaenkov wrote:
>> Hello guys,
>> I like just about everything in django, but at this point of me reading 
>> django
>> book I can't imagine the way of xmlizing django.

> There are serializers in Django: 
> http://www.djangoproject.com/documentation/serialization/

>> Is there a way to use XSLT templates instead of standard django template 
>> language?

> It could look something like this (not tested of course :-) ):

>  from django.core import serializers
>  from models import MyModel

>  def my_view(request):
>object_list = MyModel.objects.all()
>xml = serializers.serialize('xml', object_list)
>return HttpResponse(xml, mimetype='application/xml')

Thank you. The idea is perfectly clear :)


-- 
Best regards,
 Alex  mailto:[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[2]: XML output

2007-08-11 Thread Alex Nikolaenkov

You wrote 12 ??? 2007 ?., 1:41:39:

> Alex Nikolaenkov <[EMAIL PROTECTED]> writes:

>> Hello guys,
>> I like just about everything in django, but at this point of me reading 
>> django
>> book I can't imagine the way of xmlizing django.
>>
>> Is there a way to use XSLT templates instead of standard django
>> template language?

> I have some stuff that is being used for a big project. Works quite
> well...
Hehe... I've heard that python already supports XSLT 2 & XPATH 2. It's
very convenient to to use these standards. BTW does python support
XQuery, XInclude, XLink, XPointer and stuff like that?

> But big project is nearing completion so I don't have much time right
> now to upload it to snippetts.

It will be perfect if you upload your solutions sometime. Good ideas
should be shared.

-- 
Best regards,
 Alex  mailto:[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: mod_python can't find settings

2007-08-11 Thread george

So it turns out that lack of sleep was causing me to be an idiot.
Malcolm, your initial instinct was correct -- while the app directory
and files all had the correct permissions, the /home/george directory
lacked the necessary o+x for apache.  In the end I apologize for
asking a question about a problem that had nothing to do with
mod_python or django.  But thank you very much Malcolm and Graham for
your insights.

G.

On Aug 11, 2:58 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Aug 11, 4:32 pm, george <[EMAIL PROTECTED]> wrote:
>
>
>
> > I have seen previous posts regarding this issue, and I'm pretty sure
> > that I'm not running into similar issues that others have faced.  I'm
> > a bit stuck as to where to go.
>
> > I'm running Apache2, python2.3,mod_python, latest django and CentOS
> > 4.5.
>
> > I've got a django project located at:
>
> > /home/george/testing/myapp
>
> > Meaning that my settings.py file is at /home/george/testing/myapp/
> > settings.py
>
> > I've got the following configuration in my /etc/httpd/conf.d/
> > python.conf file:
>
> > 
> > SetHandler python-program
> > PythonHandler django.core.handlers.modpython
> > PythonPath "['/home/george/testing'] + sys.path"
> > SetEnv DJANGO_SETTINGS_MODULE myapp.settings
> > PythonDebug On
> > 
>
> > When I try viewing the root in a web browser, I get the following:
>
> > Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> > Traceback (most recent call last):
>
> >   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
> > 299, in HandlerDispatch
> > result = object(req)
>
> >   File "/usr/lib/python2.3/site-packages/django/core/handlers/
> > modpython.py", line 178, in handler
> > return ModPythonHandler()(req)
>
> >   File "/usr/lib/python2.3/site-packages/django/core/handlers/
> > modpython.py", line 146, in __call__
> > self.load_middleware()
>
> >   File "/usr/lib/python2.3/site-packages/django/core/handlers/
> > base.py", line 22, in load_middleware
> > for middleware_path in settings.MIDDLEWARE_CLASSES:
>
> >   File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
> > line 28, in __getattr__
> > self._import_settings()
>
> >   File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
> > line 57, in _import_settings
> > self._target = Settings(settings_module)
>
> >   File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
> > line 85, in __init__
> > raise EnvironmentError, "Could not import settings '%s' (Is it on
> > sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> > e)
>
> > EnvironmentError: Could not import settings 'myapp.settings' (Is it on
> > sys.path? Does it have syntax errors?): No module named myapp.settings
>
> > I'm pretty sure that there isn't some collision happening with a built
> > in python library because if I open the python interpreter and enter:
>
> > import sys
> > sys.path.append('/home/george/testing')
> > import myapp.settings
>
> > Then I am able to see variables defined in the settings.py file.  For
> > good measure I also tried adding the parent directory (because I
> > remember seeing this solution as well) into the python path, both:
>
> > PythonPath "['/home/george', '/home/george/testing'] + sys.path"
> > and
> > PythonPath "['/home/george/testing', 'home/george'] + sys.path"
>
> > But neither of these solutions worked.  I still got the same error.
>
> You misunderstand what 'parent' meant in the context of some of the
> discussions. It meant the parent of the mysite directory. What some of
> the instructions say is to also add your site directory:
>
>   PythonPath "['/home/george/testing', 'home/george/testing/mysite'] +
> sys.path"
>
> See my more detailed explanation on Jul 6 (item 12, hierarchical view)
> in:
>
>  http://groups.google.com/group/django-users/browse_frm/thread/24deb09...
>
> > Is there an easy way to check what the runtime sys.path is?  I don't
> > see how it could be loading the wrong version of myapp given that a
> > quick 'find / -name 'myapp' -print' turns up only my /home/george/
> > testing/myapp.  Is there something else I should be trying?
>
> Change:
>
>   PythonHandler django.core.handlers.modpython
>
> to:
>
>   PythonHandler mod_python.testhandler
>
> to get a lot of information about request and environment setup
> displayed. I think it includes sys.path.
>
> Graham


--~--~-~--~~~---~--~~
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: Testing/Fixtures/Production/TestRunner

2007-08-11 Thread Russell Keith-Magee

On 8/11/07, Chris Green <[EMAIL PROTECTED]> wrote:
>
> On Aug 9, 7:55 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
> wrote:
> > On 8/9/07, Chris Green <[EMAIL PROTECTED]> wrote:

> > > 2) Setting up users/groups/users manually in the runner gets blown
> > > away by the TestCase architecture.  Works as documented.  However, I'm
> > > not sure where I should put things that should happen post-each syncdb
> > > for testing only.  Should there be a testrunner function that gets
> > > called post each sync or should I create a single TestCase derived
> > > from django.test.TestCase that does the "pre-setup"?
> >
> > I'm not sure I follow. TestCase goes out of its way to avoid
> > interfering with setUp/tearDown methods, and in a TestCase, there is a
> > complete flush after each test, so any setup would need to be rerun on
> > a per-test basis, not a per-sync basis. Can you provide an example of
> > the problem?
>
> Sure: My runner simplified

Ah - I didn't catch on that you were using a customized test runner.
Understood now.

As for how to fix this problem, I have two suggestions.

1) Are you sure you can't just fix this with a static fixture? I can
see that you are using python code to generate the custom permissions,
but are the resulting permissions actually dynamic? Couldn't you just
build them one, capture them, and add them as an 'test_auth' fixture
that you specify each time?

2) Alternatively, have you considered using a syncdb 'post_sync'
trigger? When Django loads an application, it looks for management.py,
and loads it if it is available. This provides an entry point to
listen for the 'post_sync' signal.

This is how Django installs its permissions to begin with. In
management.py, you install a listener on the post_sync message that is
emitted as part of the synchronization process. This signal is
re-emitted as part of a flush (which is what happens at the start of
each test). Look at django.contrib.auth.management for an example of
how to set this up.

> Since strptime() breaks with dates before 1901, it gets serialized out
> with dumpdata but fails on a loaddata()

Ok - this looks to be a python problem (although I'm seeing the issue
with strftime, not strptime). It's worth logging as a ticket so that
it isn't forgotten.

Although this is a python problem, it is a python problem born of a
desire to solve Y2K issues by supporting '04' as 1904. Since we are
only using dates on the backend and in serialization, we can impose
more rigorous datetime formatting constraints, so we might be able to
solve this problem by using an alternate strftime/strptime
implementation that requires 4 digit years. If you want to try your
hand at this, feel free.

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: basic testing procedure?

2007-08-11 Thread Russell Keith-Magee

On 8/10/07, patrickk <[EMAIL PROTECTED]> wrote:
>
> here are a couple of questions:
> 1. where to define the testing? in models.py or in tests.py? I´d like
> to seperate the testing from models.py, so how can I write doctests
> in a seperate file (the example in the django documentation only
> explains seperate unit-testing)?

Django will look for doctests and unit tests in both models.py and tests.py.

> 2. can I make a test-directory (and does that make sense) for all my
> tests or do I have to use the application-directories? within
> django_src, there´s a directory called "tests" for example.

Yes, in a couple of ways.

For unit tests - make a tests directory, put all your tests in that
directory (e.g., first_test.py), then in __init__.py, put 'from
first_test import *'.

Alternatively, in tests.py, define a suite() method that constructs a
unit test suite. See the Python documentation on building test suites
for more details.

For doctests - in tests.py, define a __test__ dictionary:

from some_location import first_test_string

__test__ = {
   'first_test': first_test_string
}

in this context, first_test_string is a doctest string that has been
imported from another location.

These tricks are all part of standard Python doctest/unittest testing.
Check out the Python docs for more details. The only Django specific
parts is the initial search - searching the models module and tests
module of each installed application for tests.

> 3. where do I find some examples (besides the django docs)?

Django itself is a pretty good example. Between the modeltests,
regression tests, and contrib app tests, Django has a very
comprehensive test suite, that provides all sorts of detailed examples
of how to set up and use tests.

> 4. does anyone know about a simple "how-to" on testing? something
> like "step 1: setup the testing-database", "step 2: create a test-
> directory (or use the app-dir or whatever)" ... ?

The steps are really just:
- write the tests, in locations that they will be found
- run the tests with ./manage.py test

However, I'm happy to improve on any area that you think the
documentation is inadequate. Suggestions are welcome.

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: Developing and testing a model mixin

2007-08-11 Thread Russell Keith-Magee

On 8/12/07, Ned <[EMAIL PROTECTED]> wrote:
>
> Firstly, is a mixin a good way to do this?

This is one approach - another would be an abstract base class. We (by
which, I mean Malcolm) is currently working on improving the
inheritance capabilities in Django - providing a way to cleanly
implement abstract base classes is one of the goals of this work.

> But management.syncdb() doesn't create any tables, which is because it
> doesn't have any INSTALLED_APPS. But I don't have any django apps,
> just a handful of testing classes.

If you're going to test some functionality with mixins, you're going
to need a test application with some test models; those test
apps/models are what gets installed with a syncdb.

The simplest approach would be to write a simple test app, use the
normal Django test framework on that app, and then not install/include
that test app as part of an end-users installation.

Django's own system tests are a reasonable guide, here. The model
tests and regression tests are 'test apps' that have sample models for
testing specific behaviours. The 'runtests.py' script mocks up an
INSTALLED_APPS setting that syncdb can use. However, there is no need
for the tests directory to be distributed to end user installations.
Have a look at runtests.py and see if you get any inspiration.

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: Error loading MySQLdb module

2007-08-11 Thread Kelsey Ruger

I have the same problem even though I have installed MySQLdb.

On Jul 6, 3:42 pm, "Bryan L. Fordham" <[EMAIL PROTECTED]>
wrote:
> looks like you need to install 
> MySQLdb:http://sourceforge.net/projects/mysql-python
>
> Jalil wrote:
> > I keep getting this below error when I try to sync my database.
> > I am using python2.3. Any ideas?
>
> > [no job set:~/dev/mysite] 113% python2.3  manage.py syncdb
> > Traceback (most recent call last):
> >   File "manage.py", line 11, in ?
> > execute_manager(settings)
> >   File "/usr/lib/python2.3/site-packages/django/core/management.py",
> > line 1672, in execute_manager
> > execute_from_command_line(action_mapping, argv)
> >   File "/usr/lib/python2.3/site-packages/django/core/management.py",
> > line 1571, in execute_from_command_line
> > action_mapping[action](int(options.verbosity), options.interactive)
> >   File "/usr/lib/python2.3/site-packages/django/core/management.py",
> > line 486, in syncdb
> > from django.db import connection, transaction, models,
> > get_creation_module
> >   File "/usr/lib/python2.3/site-packages/django/db/__init__.py", line
> > 11, in ?
> > backend = __import__('django.db.backends.%s.base' %
> > settings.DATABASE_ENGINE, {}, {}, [''])
> >   File
> > "/usr/lib/python2.3/site-packages/django/db/backends/mysql_old/base.py",
> > line 12, in ?
> > raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
> > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> > module: No module named MySQLdb
> > bykergrove [no job set:~/dev/mysite] 114%


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



no cookie vs. expired cookie

2007-08-11 Thread [EMAIL PROTECTED]

Hi,

I'm building a service that should have 2 week sessions.

For authentication, I'm hoping someone can explain what happens if a
cookie has expired because those two weeks are up.

Is request.user authenticated? Is there another flag that notes the
cookies is expired?

Or is request.user not authenticated, but the expired cookie is still
sent?

Basically, I want a different message for people that presumably have
never seen the site, and those that just need to login again.

Thanks,
Ivan
www.kirigin.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: EARN 1$ PER HOUR! EARN 1$ PER HOUR! EARN 1$ PER HOUR!

2007-08-11 Thread G.J. Souverein
2007/8/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>
> Paying to Surf with AGLOCO
>
> Please Trust Us
> EARN 1$ PER HOUR! EARN 1$ PER HOUR! EARN 1$ PER HOUR!
> Free 4 easy step to earn money while u surf
> 1.  just go to the below link
> 2.  sing-up & register
> 3.  download the AGLOCO Viewbar
> 4.  Restart u r computer & run AGLOGO Viewbar on ur computer
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
>
> & Read All other features for u r knowledge .
> Do you realize how valuable you are? Advertisers, search providers and
> online retailers are paying billions to reach you while you surf. How
> much of that money are you making? NONE!
> Earn Money Everyday with A Few Hours of Internet Surfing
> We are in the business to provide a service for our members to surf
> the internet
> and make some real good money doing this simple task. The best part
> about our program it takes very little effort to achieve these numbers
> per day. With our program we will teach you how to automate your
> surfing tasks, virtually creating income with out having to do
> anything but surf Internet few hours.
>
> PAID TO SURF IS A LEGITIMATE GET PAID INTERNET OPPORTUNITY?
> www.agloco.com/r/BBFZ2776
> I am sure you are telling yourself "How Is This Possible"?
>
> And we are glad you asked, so we can explain how this IS possible.
> www.agloco.com/r/BBFZ2776
> Never will You Pay for Anything Once a member. We are going to train
> You how To make Money NOT Spend it.
> You Keep 100% Of Your Earnings-No Taxes Taken-
> We Do Not Take Any Commissions On Your Earnings.
> What will you earn?
> You will earn up to Rs. 1 Lakh per month. You just have to follow the
> simple instructions prescribed in our package. For all this you just
> need a PC connected to internet and some efforts.
> You have to simply sign-up free, download the free ToolbarTM Software
> and surf the Internet as you normally would.
> www.agloco.com/r/BBFZ2776
> What's The Toolbar(tm)?
> The ToolbarTM is a small toolbar that rests on the bottom of your
> screen or browser window while you surf the Internet. The ToolbarTM
> software helps to collect the money you are earning while browsing the
> Internet.
> No other Toolbar(tm) pays you Except this for surfing the net!
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
>
> What You Have to Do? What is the work involved?
> You have to sign up for a free account with the company.
> After signing up you have to download & Install a ToolbarTM Software
> provided by the company similar like a Yahoo & Google Toolbar
> After Installing you have to surf Internet as you normally do but you
> have to make sure that the ToolbarTM is present on your Desktop
> (Computer).
> You have to surf Internet using this Toolbar(tm) for a maximum period of
> 5 hours per month.
> The company will place there client's advertisements on your
> Toolbar(tm), the ads will be running constantly on your Toolbar(tm), so on
> the basis of the impressions generated by the ads on your Toolbar(tm)
> this company gets paid by their advertisers and then they pay you your
> commission for your 5 hours surfing period.
>
>
> How it Works?
>
> This company makes money for its Members in many ways:
> * Search: Every time you use the Toolbar(tm) to do an Internet search,
> the company earns money from the search engine providers. (For
> example, Google pays as much as $0.10 on average for each search that
> is directed to its search engine.)
> www.agloco.com/r/BBFZ2776
> * Advertising: The Toolbar(tm) itself displays ads that are targeted
> based upon the websites you're visiting. When you click on an ad and
> make a purchase, the company receives a referral fee, which we pass on
> to our Members.
> www.agloco.com/r/BBFZ2776
> * Transaction commissions: Many major retailers pay commissions when
> you refer customers who make a purchase. The company collects that
> commission and passes it on to our members. (For example, Amazon pays
> an 8.5% commission to most websites who refer customers, and has cut
> deals for even larger percentages. The bigger the Toolbar company
> community, the better commission we can negotiate for our Members.)
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> * Software distribution: Numerous software companies pay websites to
> encourage the download of new software releases (for example, Adobe's
> Flash and Acrobat Reader software), and trial versions of new
> programs. The company's members not only get access to the latest and
> coolest software, they get paid for it.
> www.agloco.com/r/BBFZ2776
> www.agloco.com/r/BBFZ2776
> * Service distribution: Many online service providers will look to the
> company's community as a 

Re: database table doesn't exist

2007-08-11 Thread Doug B

Syncdb doesn't create the intermediary table* if the model the
manytomanyfield is on already exists.  You'll have to create it
manually, or drop the entry table and then run syncdb to create it.

ManyToManyField keeps track of the relations in a 3 column third table
like:  id | entry_id  |  tag_id, usually called
appname_model1_model2(s), or blog_entry_tags.



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



database table doesn't exist

2007-08-11 Thread Evan H. Carmi

Hi,

I was implementing tags on my blog and ran into this problem:

Under the administration page I can create and view tags. I can also
view a list of entries and try and create an entry. When I try and
create an entry I can fill out the entry form and save it. The data is
saved and appears on my blog but I get the following error: (I also get
this error when trying to view the details for an entry.)


ProgrammingError at /admin/blog/entry/7/
(1146, "Table 'django_.blog_entry_tags' doesn't exist")
Request Method: GET
Request URL:http://binarymanipulations.com:8157/admin/blog/entry/7/
Exception Type: ProgrammingError
Exception Value:(1146, "Table 'django_.blog_entry_tags' doesn't exist")
Exception Location:
/usr/local/lib/python2.4/site-packages/MySQLdb/connections.py in
defaulterrorhandler, line 35
Python Executable:  /usr/local/bin/python
Python Version: 2.4.3

[snipped]


My blog/models.py is below (and here http://dpaste.com/hold/16673/) :

from django.db import models
import datetime

# Create your models here.

class Tag(models.Model):
slug = models.SlugField(
prepopulate_from=("name",),
help_text='Automatically prepopulated from name',
)
name = models.CharField(maxlength=30)
description = models.TextField(
help_text='Short summary of this tag'
)
def __str__(self):
return self.name

def get_absolute_url(self):
return "/blog/tag/%s/" % self.slug

class Admin:
list_display = ('slug', 'name',)
search_fields = ('name', 'description',)

class Entry(models.Model):
title = models.CharField(maxlength=255, core=True,
unique_for_date="pub_date")
pub_date = models.DateTimeField(core=True)
slug = models.SlugField(maxlength=30, prepopulate_from= ['title'])
body = models.TextField(core=True)
tags = models.ManyToManyField(Tag,
filter_interface=models.HORIZONTAL)

class Admin:
fields = (
(None, {'fields': ('slug', 'title', 'tags',
'pub_date', 'body',)}),
)

def __str__(self):
return self.title

def get_absolute_url(self):
return "/blog/%s/%s/" %
(self.pub_date.strftime("%Y/%m/%d").lower(), self.slug)


I have ran python manage.py syncdb. I really don't know what is going on
but I have a slight idea it might have something to do with the Entry
tags field. It seems like django wants to see a blog_entry_tags table in
the database but it isn't there. Maybe a problem with the ManyToManyField?

Thanks,
Evan

--~--~-~--~~~---~--~~
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: Maldives Holidays Boston Holidays Holidays in Dubai

2007-08-11 Thread G.J. Souverein
2007/8/11, ali öztürk <[EMAIL PROTECTED]>:
>
> 15/6/2007: Yahoo! hits flack from 
> shareholders
> 15/6/2007: IBM avoids $1.6bn taxes days before loophole 
> shut
> 15/6/2007: Intel targets developing world with basic laptop for
> childrenTom Bawden in New York 
> 15/6/2007: Tempus: Google learns a lessonRobert Lindsay
> 
> 15/6/2007: Hotels boss quits over fake qualificationsDominic Walsh
> 
> 15/6/2007: eBay takes its adverts off GoogleTom Bawden in New 
> York
>
> 20/6/2007: Maldives Holidays 
> 20/6/2007: Boston Holidays The Cradle Of Modern America
> 
> 20/6/2007: Atlanta Holidays 
> 20/6/2007: New York, New York - from 
> £489pp
> 20/6/2007: Boston Tea Parties - from £509pp
> 
> 20/6/2007: Cool DC - from £465pp 
> 20/6/2007: Lovely Lake Tahoe - from 
> £525pp
>


My mother was a tailor,
she sewed  my new blue-jeans...

20/6/2007: Home of 'The King' - from
£519pp
> 20/6/2007: Live it up in Vegas - from 
> £499pp
> 20/6/2007: Get outdoors in Oregon - from £535pp
> 
> 20/6/2007: West Coast Fly-drives - from 
> £519pp
> 20/6/2007: West Coast Fly-drives 
> 19/6/2007: ABU DHABI CITY TOUR (FROM DUBAI) - £38 PER PERSON
> 
> 19/6/2007: Tunisia Holidays Carpets In Carthage
> 
> 19/6/2007: Morocco Holidays An Exotic Spice
> 
> 19/6/2007: North Africa Holidays A Hot 
> Destination
> 19/6/2007: Syria Holidays The Cradle Of Civilizations
> 
> 19/6/2007: Sharjah Holidays 
> 19/6/2007: Saudi Arabia Holidays Arabian 
> Kingdom
> 19/6/2007: Ras Al Khaimah Holidays Catch Of The 
> Day
> 19/6/2007: Qatar Holidays 
> 19/6/2007: Oman Holidays Water And Rock
> 
> 19/6/2007: Jordan Holidays Sun Always Shines
> 
> 19/6/2007: Israel Holidays A Long Time In The 
> Making
> 19/6/2007: Fujairah Holidays Land Of The Exotic
> 
> 19/6/2007: Egypt Holidays Welcome To 
> Civilisation
> 19/6/2007: Dubai Holidays Arabian Nights
> 
> 19/6/2007: Bahrain Holidays 
> 19/6/2007: Abu Dhabi Holidays 
> 19/6/2007: About Us 
> 19/6/2007: OVERNIGHT SAFARI (FROM DUBAI) - £69 PER 
> PERSON
> 19/6/2007: EAST COAST MOUNTAIN TOUR (FROM DUBAI) - £69 PER PERSON
> 
> 19/6/2007: HATTA TREK (FROM DUBAI) - £59 PER 
> PERSON
> 19/6/2007: EAST COAST TOUR (FROM DUBAI) - £38 PER 
> PERSON
> 19/6/2007: Al - AIN - TOUR OF OASIS (FROM DUBAI) - £38 PER 
> PERSON
> 19/6/2007: ABU DHABI CITY TOUR (FROM DUBAI) - £38 PER PERSON
> 
> 19/6/2007: DINNER DHOW CRUISE (FROM DUBAI) - £49 PER 
> PERSON
> 19/6/2007: SAND SKIING & CAMEL RIDING (FROM DUBAI) - £35 PER PERSON
> 
> 19/6/2007: DESERT SAFARI (FROM DUBAI) - £49 PER 
> PERSON
> 19/6/2007: DUBAI AND THE FUTURE (FROM DUBAI) - £21 PER PERSON
> 
> 19/6/2007: SHOPPING TOUR (FROM DUBAI) - £21 PER 
> PERSON
> 19/6/2007: SHARJAH CITY TOUR (FROM DUBAI) - £21 PER PERSON
> 
> 19/6/2007: DUBAI CITY TOUR (FROM DUBAI) - £21 PER 
> PERSON
> 19/6/2007: Other Emirates 
> 19/6/2007: Abu Dhabi - The Capital City
> 19/6/2007: Dubai... Where to eat, where to 
> go
> 19/6/2007: Dubai Dubai... Where to eat, where to go
> 
> 19/6/2007: You'll get rid of stress in the 

Re: Life (1) ; Working

2007-08-11 Thread G.J. Souverein
2007/8/11, Dr. Solve <[EMAIL PROTECTED]>:
>
>
> .
>
>   Life
>
> It is something that everyone has, yet very view people comprehend it,
> or at least try to.
>
> If I put a book on your hand and ask you, "What is a book?
> I bet you can answer it easily.
>
> If now I put a slice of bread on your hand and ask you, "What is
> bread?
> Definitely, you'll answer it correctly.
>
> Likewise, sugar, rubber band, money, and many other things, I believe
> you know exactly what they are.
>
> But what about Life?
>
> If represented as a little thing and put onto your hand, then I ask
> you:
>  What is Life?
>
> Can you answer it?
> Not easy, right?
>
> While every human being has life, or used to have it, it is absolutely
> not easy to define what exactly Life is.
>
> I tell you what, take some time, say 10 minutes, before you continue
> reading, to try to answer the question with your own thought and idea.
> Not other's idea that you got from a book somewhere, but with your
> own.
> Now, use your thought, perception, mind, experience, idea, meaning,
> and feeling.  Answer this question:
> .
>  What is LIFE ???
>
>
>  To be continued.
>
>
> -
>
> Indonesia ; Bank: BCA ( Bank Central Asia ) ; Code: CENAIDJA
>
> Account number: 526 025 9204 ;  Name:  Bintang Torang Sirait ; Branch:
> KCP K.S. Tubun
>
>
> -
> .
>
>  Working
>
> Every human being, like all living creatures, has basic routine needs.
>
> Foods, clothing, medicines, etc.
>
> Without meeting those needs people will die soon.
>
> Most people do not want to die soon, then they have to meet those
> basic routine needs.
>
> How?
>
> Have something to exchange: money.
>
> How to get money?
>
> See the title above.
>
>
> 
>
>
> Do you have problem with your boyfriend or girlfriend?
> You have problem with your husband or wife, family, job, social-life,
> etc?
>
> Something in your mind really disturbing you?
> If you have any kind of problem in life and need some advice, please
> send me an email to:
> [EMAIL PROTECTED]
>
> solveproblem11at gmail dot com
>
> And let me know your problem in detailed. I'll give you some advice to
> solve that problem directly to your email address.
>
> Nobody will get your identity, not even me.
>
> Sincerely yours,
>
> Dr. Solve Personal Problem
>
>
> 


the only thing a gambler needs
is a suitcase and a trunk ...

--~--~-~--~~~---~--~~
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: return html snippet via XHR with simplejson

2007-08-11 Thread Udi

If you just want to return html that will get dumped into a container
via innerHTML, then I don't really see the need to return json.  Just
return the html as text/html and dump the response directly into the
container.

However, the approach you are taking is nice because it lets you add
more metadata to the response.

I do something sort of like this:

response_dict.update({'html': html_table, 'success': 1, 'el_id':
456})
return HttpResponse(simplejson.dumps(response_dict),
mimetype='application/javascript')

Then on the js side of things:

if (json.success) {
document.getElementById(json.el_id).innerHTML = json.html;
} else {
// handle errors here
}



On Aug 10, 7:43 pm, r_f_d <[EMAIL PROTECTED]> wrote:
> I was wondering what people are doing to format html snippets returned
> via XHR.  I am currently using code  like:
>
> response_dict = {}
>
> t = ModelObject.objects.all()
>
> html_table = render_to_response('table_template.html', {'table': t})
>
> response_dict.update({'table': html_table})
>
> return HttpResponse(simplejson.dumps(response_dict),
> mimetype='application/javascript')
>
> Where my template contains code to loop through the queryset and
> layout the table appropriately.  I also do this with
> form_for_model(instance) to layout the form fields.
>
> This seems pretty appropriate to me, but as I am relatively new to
> python and django, I was wondering if others are doing something
> similar or if there are other suggestions for returning the html
> formatted.
> 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
-~--~~~~--~~--~--~---



Re: mod_python can't find settings

2007-08-11 Thread Graham Dumpleton

On Aug 11, 4:32 pm, george <[EMAIL PROTECTED]> wrote:
> I have seen previous posts regarding this issue, and I'm pretty sure
> that I'm not running into similar issues that others have faced.  I'm
> a bit stuck as to where to go.
>
> I'm running Apache2, python2.3,mod_python, latest django and CentOS
> 4.5.
>
> I've got a django project located at:
>
> /home/george/testing/myapp
>
> Meaning that my settings.py file is at /home/george/testing/myapp/
> settings.py
>
> I've got the following configuration in my /etc/httpd/conf.d/
> python.conf file:
>
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> PythonPath "['/home/george/testing'] + sys.path"
> SetEnv DJANGO_SETTINGS_MODULE myapp.settings
> PythonDebug On
> 
>
> When I try viewing the root in a web browser, I get the following:
>
> Mod_pythonerror: "PythonHandler django.core.handlers.modpython"
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
> 299, in HandlerDispatch
> result = object(req)
>
>   File "/usr/lib/python2.3/site-packages/django/core/handlers/
> modpython.py", line 178, in handler
> return ModPythonHandler()(req)
>
>   File "/usr/lib/python2.3/site-packages/django/core/handlers/
> modpython.py", line 146, in __call__
> self.load_middleware()
>
>   File "/usr/lib/python2.3/site-packages/django/core/handlers/
> base.py", line 22, in load_middleware
> for middleware_path in settings.MIDDLEWARE_CLASSES:
>
>   File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
> line 28, in __getattr__
> self._import_settings()
>
>   File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
> line 57, in _import_settings
> self._target = Settings(settings_module)
>
>   File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
> line 85, in __init__
> raise EnvironmentError, "Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e)
>
> EnvironmentError: Could not import settings 'myapp.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named myapp.settings
>
> I'm pretty sure that there isn't some collision happening with a built
> in python library because if I open the python interpreter and enter:
>
> import sys
> sys.path.append('/home/george/testing')
> import myapp.settings
>
> Then I am able to see variables defined in the settings.py file.  For
> good measure I also tried adding the parent directory (because I
> remember seeing this solution as well) into the python path, both:
>
> PythonPath "['/home/george', '/home/george/testing'] + sys.path"
> and
> PythonPath "['/home/george/testing', 'home/george'] + sys.path"
>
> But neither of these solutions worked.  I still got the same error.

You misunderstand what 'parent' meant in the context of some of the
discussions. It meant the parent of the mysite directory. What some of
the instructions say is to also add your site directory:

  PythonPath "['/home/george/testing', 'home/george/testing/mysite'] +
sys.path"

See my more detailed explanation on Jul 6 (item 12, hierarchical view)
in:

  
http://groups.google.com/group/django-users/browse_frm/thread/24deb095a2b2e450/f8e703bbb96e9e88

> Is there an easy way to check what the runtime sys.path is?  I don't
> see how it could be loading the wrong version of myapp given that a
> quick 'find / -name 'myapp' -print' turns up only my /home/george/
> testing/myapp.  Is there something else I should be trying?

Change:

  PythonHandler django.core.handlers.modpython

to:

  PythonHandler mod_python.testhandler

to get a lot of information about request and environment setup
displayed. I think it includes sys.path.

Graham


--~--~-~--~~~---~--~~
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: XML output

2007-08-11 Thread Nic

Alex Nikolaenkov <[EMAIL PROTECTED]> writes:

> Hello guys,
> I like just about everything in django, but at this point of me reading django
> book I can't imagine the way of xmlizing django.
>
> Is there a way to use XSLT templates instead of standard django
> template language?

I have some stuff that is being used for a big project. Works quite
well... 

But big project is nearing completion so I don't have much time right
now to upload it to snippetts.

I'll _try_ and get it done this week.


-- 
Nic Ferrier
http://prooveme.com - easy, simple, certificated OpenID

--~--~-~--~~~---~--~~
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: make-messages does not generate any message in .po except dummy header

2007-08-11 Thread Ramiro Morales

Peter,

On 8/11/07, Peter Melvyn <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'm trying to generate messages for transaltion in my project folder.
>
> As recommened in Wiki/Localization, I installed gettext utility for
> SourceForge and if I run make-messages command with verbose option, it
> produces just a .po file containing dummy header :
>
> [...]
>
> and no messages extracted from my python files or templates.
>
> Please, does have anybody an idea what is wrong?
>

You are using Windows and a checkout of Django from SVN at a revision
between r5722
and r5842 right?. Please update to a revision >= 5842.

See ticket #4899.

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
-~--~~~~--~~--~--~---



Windows XP - Repairing

2007-08-11 Thread John Travolta
Optimize your operating system, minimize background activities,  repair
registry base, uninstall unnecessary components, get rid of boring errors
and make your operating system safer.

http://windowsxpsp2pro.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
-~--~~~~--~~--~--~---



Maldives Holidays Boston Holidays Holidays in Dubai

2007-08-11 Thread ali öztürk
15/6/2007: Yahoo! hits flack from
shareholders
15/6/2007: IBM avoids $1.6bn taxes days before loophole
shut
15/6/2007: Intel targets developing world with basic laptop for childrenTom
Bawden in New York 
15/6/2007: Tempus: Google learns a lessonRobert Lindsay

15/6/2007: Hotels boss quits over fake qualificationsDominic Walsh

15/6/2007: eBay takes its adverts off GoogleTom Bawden in New
York

20/6/2007: Maldives Holidays 
20/6/2007: Boston Holidays The Cradle Of Modern America

20/6/2007: Atlanta Holidays 
20/6/2007: New York, New York - from
£489pp
20/6/2007: Boston Tea Parties - from
£509pp
20/6/2007: Cool DC - from £465pp 
20/6/2007: Lovely Lake Tahoe - from £525pp
20/6/2007: Home of 'The King' - from
£519pp
20/6/2007: Live it up in Vegas - from
£499pp
20/6/2007: Get outdoors in Oregon - from
£535pp
20/6/2007: West Coast Fly-drives - from
£519pp
20/6/2007: West Coast Fly-drives 
19/6/2007: ABU DHABI CITY TOUR (FROM DUBAI) - £38 PER PERSON

19/6/2007: Tunisia Holidays Carpets In Carthage

19/6/2007: Morocco Holidays An Exotic Spice

19/6/2007: North Africa Holidays A Hot
Destination
19/6/2007: Syria Holidays The Cradle Of Civilizations

19/6/2007: Sharjah Holidays 
19/6/2007: Saudi Arabia Holidays Arabian
Kingdom
19/6/2007: Ras Al Khaimah Holidays Catch Of The
Day
19/6/2007: Qatar Holidays 
19/6/2007: Oman Holidays Water And Rock

19/6/2007: Jordan Holidays Sun Always Shines

19/6/2007: Israel Holidays A Long Time In The
Making
19/6/2007: Fujairah Holidays Land Of The Exotic

19/6/2007: Egypt Holidays Welcome To
Civilisation
19/6/2007: Dubai Holidays Arabian Nights
19/6/2007: Bahrain Holidays 
19/6/2007: Abu Dhabi Holidays 
19/6/2007: About Us 
19/6/2007: OVERNIGHT SAFARI (FROM DUBAI) - £69 PER
PERSON
19/6/2007: EAST COAST MOUNTAIN TOUR (FROM DUBAI) - £69 PER
PERSON
19/6/2007: HATTA TREK (FROM DUBAI) - £59 PER
PERSON
19/6/2007: EAST COAST TOUR (FROM DUBAI) - £38 PER
PERSON
19/6/2007: Al - AIN - TOUR OF OASIS (FROM DUBAI) - £38 PER
PERSON
19/6/2007: ABU DHABI CITY TOUR (FROM DUBAI) - £38 PER
PERSON
19/6/2007: DINNER DHOW CRUISE (FROM DUBAI) - £49 PER
PERSON
19/6/2007: SAND SKIING & CAMEL RIDING (FROM DUBAI) - £35 PER
PERSON
19/6/2007: DESERT SAFARI (FROM DUBAI) - £49 PER
PERSON
19/6/2007: DUBAI AND THE FUTURE (FROM DUBAI) - £21 PER
PERSON
19/6/2007: SHOPPING TOUR (FROM DUBAI) - £21 PER
PERSON
19/6/2007: SHARJAH CITY TOUR (FROM DUBAI) - £21 PER
PERSON
19/6/2007: DUBAI CITY TOUR (FROM DUBAI) - £21 PER
PERSON
19/6/2007: Other Emirates 
19/6/2007: Abu Dhabi - The Capital City
19/6/2007: Dubai... Where to eat, where to
go
19/6/2007: Dubai Dubai... Where to eat, where to go

19/6/2007: You'll get rid of stress in the "Champion Holiday Village"

19/6/2007: In the summer months, Antalya wears a long shirt, Antalya sweats
only to give you a warm embrace. 
17/6/2007: Holidays in Dubai 
16/6/2007: Private Island 

make-messages does not generate any message in .po except dummy header

2007-08-11 Thread Peter Melvyn

Hi all,

I'm trying to generate messages for transaltion in my project folder.

As recommened in Wiki/Localization, I installed gettext utility for
SourceForge and if I run make-messages command with verbose option, it
produces just a .po file containing dummy header :

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <[EMAIL PROTECTED]>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-08-11 22:23+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n"
"Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"


and no messages extracted from my python files or templates.

Please, does have anybody an idea what is wrong?


Thanks, Peter

--~--~-~--~~~---~--~~
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 concerning blank and null in model fields

2007-08-11 Thread [EMAIL PROTECTED]

Hi,

I think I just stumbled across a something others must have
encountered too. But I can'T find any documentation that enlightens
me.

I have a CharField in my model that looks like that.

name = models.CharField(_('Projektname'), max_length = 255)

The result is, that I can't create an instance of the model containing
this CharField in the admin interface if the CharField is empty. So
far so good. But...

>>> Project().save()

works without any problems. Why? I mean, I told my model to include a
CharField called "name", which has to be filled. I expected save() to
raiuse an Exception, but instead it just saves the model which
violates the constraints.

Why is this the case? I like to understand that. Any pointers would be
nice and highly appreciated.

Best regards,
Oliver


--~--~-~--~~~---~--~~
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: Don't Repeat Yourself!

2007-08-11 Thread sago

The more I think about this, the more I think the feed design could be
improved.

For example - what is the purpose of the get_object() method call?

Why not get the feed class creator to implement a constructor, then
pass the information to that? In that way you don't need to mess about
with one or two argument versions of each of the data retrieval
methods: each retrieval method has access to self, after all.

Also, why is the output feed type part of the feed class? Wouldn't it
be better in most cases to allow a feed class to output to any feed
type? Okay in some cases you need specific feeds for specific outputs
(Atom vs RSS, for example), but in most cases you want one feed class
output in any format. Currently adding new formats is a bit of a faff,
but it could be made easier.

Anyway - just riffing. Recently lots of the training I've been
delivering has been to companies who are very interested in putting
feeds on everything and even loading and aggregating feeds.

Ian.

On Aug 11, 5:29 am, sago <[EMAIL PROTECTED]> wrote:
> I was delivering some Django training this week, and it occurred to me
> there is a huge DRY-violation in the Django feed system.
>
> Django has a comprehensive and (in my opinion) superb URL routing
> mechanism. You route urls to views. In many cases you can route a
> number of urls to the same view, adding extra information with a
> dictionary of data. Generic views work very well in this way.
>
> But the feed system gets you to extract a whole section of the url and
> feed it to the feed view. Thereafter the first part of the url is
> matched against a regular dictionary to find the feed class, and any
> further bits of the url are split into sections by slash and given to
> get_object.
>
> The feed approach for routing urls is everything that django's url
> system was designed not to be: it imposes a hierarchical structure on
> the url, distributes the configuration over multiple representations,
> and could be avoided by having a feed view that behaves more like
> generic views:
>
> (r'feeds/rss/comments/(?P\w+)/',
>   'django.contrib.syndication.views.feed',
>   {'feed': LatestEntriesFeedClass}),
>
> And removing the (imho warty) url_elements list of strings that get
> passed to get_object, replacing it with any regular named groups
> pulled from the url:
>
> def feed(request, feed, *args, **kws):
>feed_instance = feed()
>object = feed_instance.get_object(*args, **kws)
>
> and so on...
>
> Am I wrong to feel this way?
>
> Ian.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Developing and testing a model mixin

2007-08-11 Thread Ned

I'm new to Django and fairly new to Python. I'm developing an add-in
for using for using models as nested set trees*

At the moment it's a mixin class which provides methods such as
parent(), descendants(), depth() etc. for examining the tree, and
move_to() for relocating a node within the tree.

You can also run several trees in parallel in one table by specifying
the names of the fields which identify the members of each tree.

For example:

class SimpleTreeNode(models.Model, NestedSet):
lft = models.IntegerField()
rgt = models.IntegerField()
owner = models.IntegerField()
family = models.IntegerField()
identifying_columns = (family,owner)

SimpleTreeNodes can now be used as a tree structure.

Firstly, is a mixin a good way to do this?

Secondly, I'm having a nightmare trying to set up testing for this
class outside of a DJango installation.  Basically, I'm importing
django.core.management and a SimpleTree class like the one above, plus
I have a dummy settings file with database settings in it.

But management.syncdb() doesn't create any tables, which is because it
doesn't have any INSTALLED_APPS. But I don't have any django apps,
just a handful of testing classes.

Advice?

And yes, I will be releasing it as soon as I can test it properly :)

*: See http://dev.mysql.com/tech-resources/articles/hierarchical-data.html


--~--~-~--~~~---~--~~
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: Multilingual site best practices

2007-08-11 Thread yml

Hello,
I have read something today about multi lingual database. There is a
project hosted there: 
http://code.google.com/p/django-utils/wiki/TranslationService
that seems to do what you are looking for.
I have never used  it myself.
I hope that will help you

On Aug 10, 9:52 pm, Francis <[EMAIL PROTECTED]> wrote:
> 1. You should use a quick description and then write the full text in
> the po file.
>
> 2.  You are better of using english in the {%trans%} bloc because
> gettext don't support UTF-8 or character outside the limited ascii.
>
> no clue for 3.
>
> Francis
>
> On Aug 10, 11:42 am, Vincent Foley <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I work for a company who develops web sites and web applications for
> > clients in Quebec.  People in Quebec mainly speak french, but there
> > are english speaking people too.  Most sites we make eventually want
> > to have a french and english version with french being the "main"
> > version.
>
> > I would like to know if anyone could share best practices for
> > multilingual sites.  I also have some questions:
>
> > 1. In the {% trans %} and {% blocktrans %} tags, should I include the
> > full text, or just a quick description and enter the full text in
> > the .po files?
>
> > 2. As I said, french is the main language in Quebec, so if I write a
> > site in french and am later asked to translate it, will the accented
> > characters cause a problem if they're used in the msgid of the .po
> > files?
>
> > 3. It seems the server always has to be restarted after the .po files
> > have been compiled.  Is that so?  If I don't have root access to the
> > server to restart Apache, is there a way I can have the new
> > definitions appear on the site?
>
> > Thanks for the input,
>
> > 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 + multiple sister forms submitted/processed in one user action

2007-08-11 Thread Patrick Anderson

On Sat, 11 Aug 2007 14:36:50 +, Patrick Anderson wrote:

> On Sat, 11 Aug 2007 14:34:05 +, Patrick Anderson wrote:
> 
>> On Fri, 10 Aug 2007 18:46:18 -0700, Doug B wrote:
>> 
>> 
> ---

 If I have 8 people, how should bind POST data to a form object in the
 view?
>>> 
>>> You can use the 'prefix' option when instantiating the forms.  Prefix
>>> the form with the corresponding form 'number' or other unique
>>> identifier.  On post pass it the whole post dict.  It will pull the
>>> data out according to the prefix.
>>> 
>>> 
>> That's what I thought, too. One problem I have right now is to
>> dynamically assign form element id attribute based on count of the for
>> loop in the view.
> 
> Which I solved by manipulating Widget attrs in each form.base_field
> 

Now I have the problem with validation and errors, since I'm submitting 
data in one request to multiple form objects, how can I get to the errors 
and display them properly next to each field?

Perhaps it is better and simpler to deal with each form at a time, even 
if it means to have a separate submit button for each one.

>> 
>> 
> 
> 


--~--~-~--~~~---~--~~
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: Need some advice in new project

2007-08-11 Thread r_f_d

I am not sure why you would want "all companies bank accounts in
different tables." Is it for security?  to ensure that only
appropriate people are able to view the records of any given company?
There is the row-level-permissions branch, but I do not believe it has
been maintained in a while so I rolled my own by implementing a very
simple row-level access based on the 'organization' that a user
belongs to.  You may want to consider something like this.
-r

On Jul 28, 1:47 pm, anna <[EMAIL PROTECTED]> wrote:
> Hello my friends.
>
> I need your help in designing our new based application.
> The goal is to build a kind of backoffice system, which helps to
> organize all data of a specific company.
> No problem with it. Build your models, data structures, input and
> output 'screens'.
>
> But...
> this application goes to a 'proxy' company, who's job is organize
> other companies data. (Assume its an accounting firm, for example)
> All models etc. are the same in each, but we expressly don't want to
> store same data in same table (i mean all companies bank accounts are
> in different tables)
> We have to create new  'database' dynamically from a web based
> interface seamlessly.
> Did you solve similar problem already?
> Prefixing tables, different databases or what?
>
> Thank you for any advice.
>
> Anna


--~--~-~--~~~---~--~~
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 app for managing sending email to users...

2007-08-11 Thread James Tauber

On 10/08/2007, at 11:41 PM, Andrew wrote:

> I'm so happy that you've taken the initiaive with this. I'm happy to
> help code -- just let me know how.

Would be great to have you on board. To help, I suggest you

a) subscribe to the django-mailer list

http://groups.google.com/group/django-mailer

b) look at the use cases and initial design thoughts

http://code.google.com/p/django-mailer/
http://code.google.com/p/django-mailer/wiki/InitialDesignThoughts

c) checkout the latest code (still in its infancy)

http://code.google.com/p/django-mailer/source

> One thing to think about: how does the communication between the  
> email-
> app and the main app work? On Fluther right now we're running our
> django mailer on a different thread because initiating a connection to
> the SMTP server from a web request takes a LONG time -- it looks like
> the page hangs.

For the reasons you give, it's done asynchronously. The main app just  
puts the message on a queue and a separate process picks it up and  
sends it.

James


--~--~-~--~~~---~--~~
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 + multiple sister forms submitted/processed in one user action

2007-08-11 Thread Patrick Anderson

On Sat, 11 Aug 2007 14:34:05 +, Patrick Anderson wrote:

> On Fri, 10 Aug 2007 18:46:18 -0700, Doug B wrote:
> 
>>> 
---
>>>
>>> If I have 8 people, how should bind POST data to a form object in the
>>> view?
>> 
>> You can use the 'prefix' option when instantiating the forms.  Prefix
>> the form with the corresponding form 'number' or other unique
>> identifier.  On post pass it the whole post dict.  It will pull the
>> data out according to the prefix.
>> 
>> 
> That's what I thought, too. One problem I have right now is to
> dynamically assign form element id attribute based on count of the for
> loop in the view.

Which I solved by manipulating Widget attrs in each form.base_field

> 
> 


--~--~-~--~~~---~--~~
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: Support for macros in templates

2007-08-11 Thread Michael Elsdoerfer

> If interested, take the library from here:
> http://www.djangosnippets.org/snippets/363/

Interesting. I too was missing macro support, and implemented something
similar a couple weeks ago:

http://www.djangosnippets.org/snippets/343/

Michael

> -Original Message-
> From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED]
> On Behalf Of Michal Ludvig
> Sent: Saturday, August 11, 2007 4:51 AM
> To: django-users@googlegroups.com
> Subject: Support for macros in templates
> 
> 
> Hi all,
> 
> This is a little announcement of a tag library for {% macro %} support
> in Django templates.
> 
> I have been using TAL template engine in my previous project and got
> used to the concept of "macros" as building blocks of the final HTML
> output. Now in Django I realised the missing support for "macros" is a
> serious limitation. I admit I may be too locked to a different mindset
> and perhaps the same things I need macros for could be achieved with
> pure Django templates. Maybe, maybe not. Anyway, I was missing macros so
> much that I decided to add them to Django.
> 
> If interested, take the library from here:
> http://www.djangosnippets.org/snippets/363/
> 
> Usage is like this:
> 
> 1) Load the macro library:
> {% load macros %}
> 
> 2) Define a new macro called 'my_macro'
>with parameter 'arg1':
> {% macro my_macro arg1 %}
> Parameter: {{ arg1 }} 
> {% endmacro %}
> 
> 3) Use the macro with a String parameter:
> {% usemacro my_macro "String parameter" %}
> 
>or with a variable parameter (provided the
>Context defines 'somearg' variable, e.g. with
>value "Variable parameter"):
> {% usemacro my_macro somearg %}
> 
> The output of the above code would be:
> Parameter: String parameter 
> Parameter: Variable parameter 
> 
> It works pretty well and the only drawback is that the defined macros
> are local to each template file, i.e. are not inherited through
> {%extends ...%} and you can't have for instance some common macros
> defined in a separate file and include that file wherever needed. I'll
> try to solve that problem later. Perhaps through a new tag, for instance
> {%macrofile ...%} or something like that. Maybe someone will contribute
> a patch? ;-)
> 
> Enjoy and sorry for the spam
> 
> Michal
> --
> * http://www.logix.cz/michal
> 
> 
> 
> 
> 
> 
> 
> 
> 

--~--~-~--~~~---~--~~
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 + multiple sister forms submitted/processed in one user action

2007-08-11 Thread Patrick Anderson

On Fri, 10 Aug 2007 18:46:18 -0700, Doug B wrote:

>> ---
>>
>> If I have 8 people, how should bind POST data to a form object in the
>> view?
> 
> You can use the 'prefix' option when instantiating the forms.  Prefix
> the form with the corresponding form 'number' or other unique
> identifier.  On post pass it the whole post dict.  It will pull the data
> out according to the prefix.
> 

That's what I thought, too. One problem I have right now is to 
dynamically assign form element id attribute based on count of the for 
loop in the view.
 
> 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



FileField / ImageField problem on update

2007-08-11 Thread Grupo Django

Hi,
When I update a register that has a ImageField, the old file is not
deleted from the disk, so I have created a custom save method like
this:

def save( self ):

path = self.get_foto_filename()
delete_file(path)
super(Perfil, self).save()

But path is set to the new file I'm uploading instead the oldone, so I
can't access the old file to delete it.
Is this a bug or it works like this? How can I solve this problem? I
thought even creating a custom procedure in the database (postgre) but
I have never done it before, and I prefer to have all the code in the
django application.

Thank you very much.


--~--~-~--~~~---~--~~
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: Don't Repeat Yourself!

2007-08-11 Thread Ivan Sagalaev

sago wrote:
> The feed approach for routing urls is everything that django's url
> system was designed not to be: it imposes a hierarchical structure on
> the url, distributes the configuration over multiple representations,
> and could be avoided by having a feed view that behaves more like
> generic views:
> 
> 
> 
> Am I wrong to feel this way?

Can't say about wrong or not but I certainly felt the same way when I 
first used the syndication framework. Back then I decided not to worry 
too much about it but, yes, it would be nicer to have urlconfs behaving 
like they should in this field also.


So it's basically just mine +1 :-)

--~--~-~--~~~---~--~~
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: Support for macros in templates

2007-08-11 Thread Michal Ludvig

olivier wrote:
> Hi Michal,
> 
> On 11 août, 04:51, Michal Ludvig <[EMAIL PROTECTED]> wrote:
> 
>> It works pretty well and the only drawback is that the defined macros
>> are local to each template file, i.e. are not inherited through
>> {%extends ...%} and you can't have for instance some common macros
>> defined in a separate file and include that file wherever needed. I'll
>> try to solve that problem later. Perhaps through a new tag, for instance
>> {%macrofile ...%} or something like that. Maybe someone will contribute
>> a patch? ;-)
> 
> 
> Are you aware of Jinja (http://jinja.pocoo.org/) ?

Yes I am and actually checked that out before writing the macro support
myself. The difference is that Jinja is a completely independent
template engine, while my code is just a loadable extension to standard
Django templates. And given that Jinja templates aren't 100% compatible
with Django it may not be easy to switch from django.template to jinja
just to get macros. My {% macro %} library does what I needed, nothing more.

And it has been a learning opportunity as well, as I haven't developed
any django template tags before ;-)

Michal
-- 
* http://www.logix.cz/michal






--~--~-~--~~~---~--~~
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: XML output

2007-08-11 Thread Ivan Sagalaev

Alex Nikolaenkov wrote:
> Hello guys,
> I like just about everything in django, but at this point of me reading django
> book I can't imagine the way of xmlizing django.

There are serializers in Django: 
http://www.djangoproject.com/documentation/serialization/

> Is there a way to use XSLT templates instead of standard django template 
> language?

It could look something like this (not tested of course :-) ):

 from django.core import serializers
 from models import MyModel

 def my_view(request):
   object_list = MyModel.objects.all()
   xml = serializers.serialize('xml', object_list)
   return HttpResponse(xml, mimetype='application/xml')

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



XML output

2007-08-11 Thread Alex Nikolaenkov

Hello guys,
I like just about everything in django, but at this point of me reading django
book I can't imagine the way of xmlizing django.

Is there a way to use XSLT templates instead of standard django template 
language?
-- 
Best regards,
 Alex  mailto:[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: return html snippet via XHR with simplejson

2007-08-11 Thread olivier

Hi,

> This seems pretty appropriate to me, but as I am relatively new to
> python and django, I was wondering if others are doing something
> similar or if there are other suggestions for returning the html
> formatted.


Well, I'm doing roughly the same thing...
I would be interested to see if others come up with another (better ?)
solution.

   Olivier


--~--~-~--~~~---~--~~
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: Support for macros in templates

2007-08-11 Thread olivier

Hi Michal,

On 11 août, 04:51, Michal Ludvig <[EMAIL PROTECTED]> wrote:

> It works pretty well and the only drawback is that the defined macros
> are local to each template file, i.e. are not inherited through
> {%extends ...%} and you can't have for instance some common macros
> defined in a separate file and include that file wherever needed. I'll
> try to solve that problem later. Perhaps through a new tag, for instance
> {%macrofile ...%} or something like that. Maybe someone will contribute
> a patch? ;-)


Are you aware of Jinja (http://jinja.pocoo.org/) ?
You're on the way to reinvent it, like I began to do before I
discovered it...


Olivier



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Life (1) ; Working

2007-08-11 Thread Dr. Solve

.

  Life

It is something that everyone has, yet very view people comprehend it,
or at least try to.

If I put a book on your hand and ask you, "What is a book?
I bet you can answer it easily.

If now I put a slice of bread on your hand and ask you, "What is
bread?
Definitely, you'll answer it correctly.

Likewise, sugar, rubber band, money, and many other things, I believe
you know exactly what they are.

But what about Life?

If represented as a little thing and put onto your hand, then I ask
you:
 What is Life?

Can you answer it?
Not easy, right?

While every human being has life, or used to have it, it is absolutely
not easy to define what exactly Life is.

I tell you what, take some time, say 10 minutes, before you continue
reading, to try to answer the question with your own thought and idea.
Not other's idea that you got from a book somewhere, but with your
own.
Now, use your thought, perception, mind, experience, idea, meaning,
and feeling.  Answer this question:
.
 What is LIFE ???


 To be continued.

-

Indonesia ; Bank: BCA ( Bank Central Asia ) ; Code: CENAIDJA

Account number: 526 025 9204 ;  Name:  Bintang Torang Sirait ; Branch:
KCP K.S. Tubun

-
.

 Working

Every human being, like all living creatures, has basic routine needs.

Foods, clothing, medicines, etc.

Without meeting those needs people will die soon.

Most people do not want to die soon, then they have to meet those
basic routine needs.

How?

Have something to exchange: money.

How to get money?

See the title above.




Do you have problem with your boyfriend or girlfriend?
You have problem with your husband or wife, family, job, social-life,
etc?

Something in your mind really disturbing you?
If you have any kind of problem in life and need some advice, please
send me an email to:
[EMAIL PROTECTED]

solveproblem11at gmail dot com

And let me know your problem in detailed. I'll give you some advice to
solve that problem directly to your email address.

Nobody will get your identity, not even me.

Sincerely yours,

Dr. Solve Personal Problem


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How to rewrite SQL for Django

2007-08-11 Thread Pythoni

I need to use  this SQL command in my Django application

select subject, count(subject) as 'count' from mimi_blogs group by
subject order by count desc;

How must I rewrite that command so that Django paginator can
understand  it properly?
Thank you for help

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: mod_python can't find settings

2007-08-11 Thread george

Oh and sorry I meant "Malcolm" that second "l" is a killer...

On Aug 10, 11:48 pm, george <[EMAIL PROTECTED]> wrote:
> Malcom -- Thanks for the quick reply.
>
> I believe the files are set correctly:
>
> ls -l /home/george/testing yields:
> drwxrwxr-x  6 george george 4096 Aug 10 19:14 myapp
> drwxrwxr-x  2 george george 4096 Aug 10 17:13 document_root
> drwxrwxr-x  3 george george 4096 Aug 10 17:14 templates
>
> and
> ls -l /home/george/testing/myapp yields:
> -rw-r--r--  1 george george0 Aug 10 16:57 __init__.py
> -rw-rw-r--  1 george george  129 Aug 10 17:01 __init__.pyc
> -rwxr-xr-x  1 george george  546 Aug 10 16:57 manage.py
> drwxrwxr-x  2 george george 4096 Aug 10 19:14 reports
> drwxrwxr-x  2 george george 4096 Aug 10 17:02 reviews
> -rw-r--r--  1 george george 3046 Aug 10 17:18 settings.py
> -rw-rw-r--  1 george george 1880 Aug 10 19:09 settings.pyc
> -rw-r--r--  1 george george  332 Aug 10 17:12 urls.py
> -rw-rw-r--  1 george george  503 Aug 10 19:09 urls.pyc
>
> On Aug 10, 11:38 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Sat, 2007-08-11 at 06:32 +, george wrote:
> > > I have seen previous posts regarding this issue, and I'm pretty sure
> > > that I'm not running into similar issues that others have faced.  I'm
> > > a bit stuck as to where to go.
>
> > > I'm running Apache2, python2.3, mod_python, latest django and CentOS
> > > 4.5.
>
> > > I've got a django project located at:
>
> > > /home/george/testing/myapp
>
> > > Meaning that my settings.py file is at /home/george/testing/myapp/
> > > settings.py
>
> > > I've got the following configuration in my /etc/httpd/conf.d/
> > > python.conf file:
>
> > > 
> > > SetHandler python-program
> > > PythonHandler django.core.handlers.modpython
> > > PythonPath "['/home/george/testing'] + sys.path"
> > > SetEnv DJANGO_SETTINGS_MODULE myapp.settings
> > > PythonDebug On
> > > 
>
> > > When I try viewing the root in a web browser, I get the following:
>
> > > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > > Traceback (most recent call last):
> > [...]
> > > EnvironmentError: Could not import settings 'myapp.settings' (Is it on
> > > sys.path? Does it have syntax errors?): No module named myapp.settings
>
> > Does Apache have permission to read the settings file, remembering that
> > it runs as a much less powerful user than you? You must have the execute
> > bit set for the "other" set of users for parent directories and the read
> > bit set for the file itself.
>
> > Regards,
> > Malcolm
>
> > --
> > Why be difficult when, with a little bit of effort, you could be
> > impossible.http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: mod_python can't find settings

2007-08-11 Thread george

Malcom -- Thanks for the quick reply.

I believe the files are set correctly:

ls -l /home/george/testing yields:
drwxrwxr-x  6 george george 4096 Aug 10 19:14 myapp
drwxrwxr-x  2 george george 4096 Aug 10 17:13 document_root
drwxrwxr-x  3 george george 4096 Aug 10 17:14 templates

and
ls -l /home/george/testing/myapp yields:
-rw-r--r--  1 george george0 Aug 10 16:57 __init__.py
-rw-rw-r--  1 george george  129 Aug 10 17:01 __init__.pyc
-rwxr-xr-x  1 george george  546 Aug 10 16:57 manage.py
drwxrwxr-x  2 george george 4096 Aug 10 19:14 reports
drwxrwxr-x  2 george george 4096 Aug 10 17:02 reviews
-rw-r--r--  1 george george 3046 Aug 10 17:18 settings.py
-rw-rw-r--  1 george george 1880 Aug 10 19:09 settings.pyc
-rw-r--r--  1 george george  332 Aug 10 17:12 urls.py
-rw-rw-r--  1 george george  503 Aug 10 19:09 urls.pyc




On Aug 10, 11:38 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sat, 2007-08-11 at 06:32 +, george wrote:
> > I have seen previous posts regarding this issue, and I'm pretty sure
> > that I'm not running into similar issues that others have faced.  I'm
> > a bit stuck as to where to go.
>
> > I'm running Apache2, python2.3, mod_python, latest django and CentOS
> > 4.5.
>
> > I've got a django project located at:
>
> > /home/george/testing/myapp
>
> > Meaning that my settings.py file is at /home/george/testing/myapp/
> > settings.py
>
> > I've got the following configuration in my /etc/httpd/conf.d/
> > python.conf file:
>
> > 
> > SetHandler python-program
> > PythonHandler django.core.handlers.modpython
> > PythonPath "['/home/george/testing'] + sys.path"
> > SetEnv DJANGO_SETTINGS_MODULE myapp.settings
> > PythonDebug On
> > 
>
> > When I try viewing the root in a web browser, I get the following:
>
> > Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> > Traceback (most recent call last):
> [...]
> > EnvironmentError: Could not import settings 'myapp.settings' (Is it on
> > sys.path? Does it have syntax errors?): No module named myapp.settings
>
> Does Apache have permission to read the settings file, remembering that
> it runs as a much less powerful user than you? You must have the execute
> bit set for the "other" set of users for parent directories and the read
> bit set for the file itself.
>
> Regards,
> Malcolm
>
> --
> Why be difficult when, with a little bit of effort, you could be
> impossible.http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 app for managing sending email to users...

2007-08-11 Thread Andrew

James -

I'm so happy that you've taken the initiaive with this. I'm happy to
help code -- just let me know how.

One thing to think about: how does the communication between the email-
app and the main app work? On Fluther right now we're running our
django mailer on a different thread because initiating a connection to
the SMTP server from a web request takes a LONG time -- it looks like
the page hangs.

Again, happy to help.

Andrew McClain

On Aug 8, 10:38 am, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 8/8/07, James Tauber <[EMAIL PROTECTED]> wrote:
>
> > My point is that you just need an iterable. Both lists and QuerySets
> > meet this requirement.
>
> > There is no casting in Python. You don't need to "cast" a QuerySet to
> > a list.
>
> Sorry.. I mixed my thoughts a bit. I shouldn't post to the list in times where
> I should be in my bed. :-) I first thought it could be useful  to pass just 
> the
> userids as list ([1, 2, 3]) but the objects are much better! In this case,
> casting is not needed.
>
> > James
>
> Kai


--~--~-~--~~~---~--~~
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: mod_python can't find settings

2007-08-11 Thread Malcolm Tredinnick

On Sat, 2007-08-11 at 06:32 +, george wrote:
> I have seen previous posts regarding this issue, and I'm pretty sure
> that I'm not running into similar issues that others have faced.  I'm
> a bit stuck as to where to go.
> 
> I'm running Apache2, python2.3, mod_python, latest django and CentOS
> 4.5.
> 
> I've got a django project located at:
> 
> /home/george/testing/myapp
> 
> Meaning that my settings.py file is at /home/george/testing/myapp/
> settings.py
> 
> I've got the following configuration in my /etc/httpd/conf.d/
> python.conf file:
> 
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> PythonPath "['/home/george/testing'] + sys.path"
> SetEnv DJANGO_SETTINGS_MODULE myapp.settings
> PythonDebug On
> 
> 
> When I try viewing the root in a web browser, I get the following:
> 
> Mod_python error: "PythonHandler django.core.handlers.modpython"
> 
> Traceback (most recent call last):
[...]
> EnvironmentError: Could not import settings 'myapp.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named myapp.settings

Does Apache have permission to read the settings file, remembering that
it runs as a much less powerful user than you? You must have the execute
bit set for the "other" set of users for parent directories and the read
bit set for the file itself.

Regards,
Malcolm

-- 
Why be difficult when, with a little bit of effort, you could be
impossible. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 can't find settings

2007-08-11 Thread george

I have seen previous posts regarding this issue, and I'm pretty sure
that I'm not running into similar issues that others have faced.  I'm
a bit stuck as to where to go.

I'm running Apache2, python2.3, mod_python, latest django and CentOS
4.5.

I've got a django project located at:

/home/george/testing/myapp

Meaning that my settings.py file is at /home/george/testing/myapp/
settings.py

I've got the following configuration in my /etc/httpd/conf.d/
python.conf file:


SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/george/testing'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE myapp.settings
PythonDebug On


When I try viewing the root in a web browser, I get the following:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 178, in handler
return ModPythonHandler()(req)

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
modpython.py", line 146, in __call__
self.load_middleware()

  File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 22, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:

  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 28, in __getattr__
self._import_settings()

  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 57, in _import_settings
self._target = Settings(settings_module)

  File "/usr/lib/python2.3/site-packages/django/conf/__init__.py",
line 85, in __init__
raise EnvironmentError, "Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
e)

EnvironmentError: Could not import settings 'myapp.settings' (Is it on
sys.path? Does it have syntax errors?): No module named myapp.settings

I'm pretty sure that there isn't some collision happening with a built
in python library because if I open the python interpreter and enter:

import sys
sys.path.append('/home/george/testing')
import myapp.settings

Then I am able to see variables defined in the settings.py file.  For
good measure I also tried adding the parent directory (because I
remember seeing this solution as well) into the python path, both:

PythonPath "['/home/george', '/home/george/testing'] + sys.path"
and
PythonPath "['/home/george/testing', 'home/george'] + sys.path"

But neither of these solutions worked.  I still got the same error.

Is there an easy way to check what the runtime sys.path is?  I don't
see how it could be loading the wrong version of myapp given that a
quick 'find / -name 'myapp' -print' turns up only my /home/george/
testing/myapp.  Is there something else I should be trying?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---