Re: mod_python vs. mod_wsgi

2008-05-08 Thread Graham Dumpleton


> > Whether you use Apache worker MPM or not, when using mod_wsgi you can
> > also use it in daemon mode. This is similar to fastcgi in the sense
> > that your web application is run in separate process(es), but mod_wsgi
> > will handle all the management of those processes, starting them up
> > and restarting them as necessary.
>
> Thanks for all the links, I've already set up one application using
> wsgi
> in deamon mode at Webfaction :)
> It works, setup was easy, memory usage seems to be lower, but it is
> only one application so far. Now I have to setup virtual hosts and
> other
> applications with wsgi and see how it works altogether and in which
> configuration.

BTW, you might keep an eye on the following thread:

  http://groups.google.com/group/modwsgi/browse_frm/thread/aae1bf2787e393f3

I've been a bit busy and so have been answering the original question
in bits and pieces. The thread brings together various aspects of
using mod_wsgi. The discussion is mainly targeted at how one may use
it for a small scale shared hosting system, but covers issues such as
virtual hosts, and in time some more detail on running multiple
applications across multiple daemon process groups, so may be
relevant.

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: mod_python vs. mod_wsgi

2008-05-08 Thread Graham Dumpleton

On May 9, 4:09 pm, Pigletto <[EMAIL PROTECTED]> wrote:
> > If you mean compared to Apache prefork and mod_python then answer is
> > yes.
>
> Yes
>
> > Even without using mod_wsgi though, one can do better than prefork
> > with mod_python by using Apache worker MPM instead. Because Apache
> > worker MPM processes are multithreaded you don't need as many to be
> > running and so less copies of your application in memory.
>
> I've tried MPM worker. Indeed memory usage is much lower with this
> setup,
> but I had a lot of strange errors that were possibly related to
> thread safety. For example template loader stated that template
> doesn't exist, but in fact template was there. I've found a ticket
> for this, with a patch, but after applying it I've received other
> errors,
> that I was not able realize why they happen and I was not
> able to find any possible thread safety problems within error related
> code, eg.:
>
> (...)
> File "/xyz/django/template/__init__.py", line 785, in render
>    output = force_unicode(self.filter_expression.resolve(context))
>  File "/xyz/django/template/__init__.py", line 518, in resolve
>    obj = self.var.resolve(context)
> AttributeError: 'FilterExpression' object has no attribute 'var'
>
> I'm not 100% sure that these errors are because of multithreading,
> but I suppose they are. As my apache stopped working twice in the
> last 2 days I've decided to switch back to prefork immediately
> without further investigation.
>
> > Whether you use Apache worker MPM or not, when using mod_wsgi you can
> > also use it in daemon mode. This is similar to fastcgi in the sense
> > that your web application is run in separate process(es), but mod_wsgi
> > will handle all the management of those processes, starting them up
> > and restarting them as necessary.
>
> Thanks for all the links, I've already set up one application using
> wsgi
> in deamon mode at Webfaction :)
> It works, setup was easy, memory usage seems to be lower, but it is
> only one application so far. Now I have to setup virtual hosts and
> other
> applications with wsgi and see how it works altogether and in which
> configuration.

Obviously be aware that in daemon mode you will still have multithread
issues to contend with if they run with multiple threads. To avoid it
you would need a config such as:

  ... processes=5 threads=1

Ie., use prefork model with mod_wgsi daemon mode. This isn't going to
get you much if anything over running prefork MPM and using embedded
mode though as you still need to have sufficient processes to handle
request. At least with embedded mode Apache will create additional
child processes to meet demand, where as with mod_wsgi daemon mode
that number of processes is fixed.

Anyway, if you see the same sorts of issues as you did with
mod_python, perhaps bring them up again as maybe can work out where
the multithread issues may be.

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: Add RDF store as database

2008-05-08 Thread Roland Hedberg

What I don't like about this is that I have to make an object based 
database look like a SQL-database which is then made to look like a 
object based database.

Makes my head spinn :-)

So, can't I attack this problem at another level where it's all about 
objects.

-- Roland

Ben Ford wrote:
> Or you could use something that's already fairly far along (AFAIK) 
> RDFAlchemy is a project  to wrap triple stores in an SQLAlchemy kind of 
> syntax. If it isn't right for you, it should at least give you some 
> pointers to get you started. I believe the queryset-refactor branch has 
> some changes that yould make a non-relational db backend a bit easier.
> Cheers,
> Ben
> 
> On 03/04/2008, *Karen Tracey* <[EMAIL PROTECTED] 
> > wrote:
> 
> On Thu, Apr 3, 2008 at 9:00 AM, Roland Hedberg
> <[EMAIL PROTECTED] > wrote:
> 
> 
> Hi!
> 
> I'd like to add the possibility to use a RDF store as database
> to Django.
> 
> Where should I start ?
> 
> I've made a brief walk-through the code and I'm not absolutely sure
> about the right place to enter my changes and I'd like to be
> that before
> attempting anything.
> 
> 
> From: 
> http://www.djangoproject.com/documentation/settings/#database-engine
> 
> In the Django development version, you can use a database backend
> that doesn't ship with Django by setting DATABASE_ENGINE to a
> fully-qualified path (i.e. mypackage.backends.whatever). Writing a
> whole new database backend from scratch is left as an exercise to
> the reader; see the other backends for examples.
> 
> There was a rather lengthy and spirited discussion on the
> developer's list recently about the lack of a more formal spec for 
> writing a database backend, which might result in some better doc,
> but for right now the recommendation is to look at the code under
> django/db/backends for guidance on what you need to do.


--~--~-~--~~~---~--~~
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 vs. mod_wsgi

2008-05-08 Thread Pigletto

> If you mean compared to Apache prefork and mod_python then answer is
> yes.
Yes

> Even without using mod_wsgi though, one can do better than prefork
> with mod_python by using Apache worker MPM instead. Because Apache
> worker MPM processes are multithreaded you don't need as many to be
> running and so less copies of your application in memory.
I've tried MPM worker. Indeed memory usage is much lower with this
setup,
but I had a lot of strange errors that were possibly related to
thread safety. For example template loader stated that template
doesn't exist, but in fact template was there. I've found a ticket
for this, with a patch, but after applying it I've received other
errors,
that I was not able realize why they happen and I was not
able to find any possible thread safety problems within error related
code, eg.:

(...)
File "/xyz/django/template/__init__.py", line 785, in render
   output = force_unicode(self.filter_expression.resolve(context))
 File "/xyz/django/template/__init__.py", line 518, in resolve
   obj = self.var.resolve(context)
AttributeError: 'FilterExpression' object has no attribute 'var'

I'm not 100% sure that these errors are because of multithreading,
but I suppose they are. As my apache stopped working twice in the
last 2 days I've decided to switch back to prefork immediately
without further investigation.

> Whether you use Apache worker MPM or not, when using mod_wsgi you can
> also use it in daemon mode. This is similar to fastcgi in the sense
> that your web application is run in separate process(es), but mod_wsgi
> will handle all the management of those processes, starting them up
> and restarting them as necessary.
Thanks for all the links, I've already set up one application using
wsgi
in deamon mode at Webfaction :)
It works, setup was easy, memory usage seems to be lower, but it is
only one application so far. Now I have to setup virtual hosts and
other
applications with wsgi and see how it works altogether and in which
configuration.

--
Maciej Wisniowski
--~--~-~--~~~---~--~~
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: Why are my parameters gettings mangled?

2008-05-08 Thread Peter Rowell

Well, I'm not quite sure exactly what is being done to it, but it
appears to happen at:

=
django/http/__init__.py:
...
class QueryDict(MultiValueDict):
...
 def appendlist(self, key, value):
self._assert_mutable()
key = str_to_unicode(key, self.encoding)
value = str_to_unicode(value, self.encoding)
MultiValueDict.appendlist(self, key, value)
<<<
=

Before the call to appendlist value looks reasonable, afterwards it's
been converted to ...? unicode or something.

That and $3.50 will get you a latte, but there it is.

--~--~-~--~~~---~--~~
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: gpl3 question

2008-05-08 Thread Kenneth Gonsalves


On 09-May-08, at 4:21 AM, Rho wrote:

> Hi, hope somebody can clarify my doubt.
>
> How affects using a gpl3 app in a project?
>
> I meant a website project using an app under gpl3, like django-
> profile.

while you are free to choose any license whatsoever for your project,  
it is generally a good idea to use the license of the parent project  
- for django, this is the BSD license

-- 

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




--~--~-~--~~~---~--~~
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: Admin : Select category -> show subcategory

2008-05-08 Thread Diego Ucha

You're welcome, Martyn.

You changed the argument of this nested function and didn't change the
reference to it in the subsequent code:
function(d){

What about replacing it for:
function(j){

Your code would look like that:

http://127.0.0.1/django-medias/chantier/js/
jquery-1.2.3.js" type="text/javascript">
 
$(function(){
  $("select#id_categorie").change(function(){
$.getJSON("/admin/boutique/produit/getsubcategory/",{id: $
(this).val()},
function(j){
alert("here")
  var options = '';
  for (var i = 0; i < j.length; i++) {
options += '';
  }
  $("select#id_sous_categorie").html(options);
})
alert("there")
  })

})



[]s
Diego Ucha


On 8 maio, 11:22, martyn <[EMAIL PROTECTED]> wrote:
> The Javascript Function does not seem to be executed.
> In admin_form.html :
>
> {% extends "admin/change_form.html" %}
>
> {% block extrahead %}
>  http://127.0.0.1/django-medias/chantier/js/
> jquery-1.2.3.js" type="text/javascript">
> 
> $(function(){
>   $("select#id_categorie").change(function(){
> $.getJSON("/admin/boutique/produit/getsubcategory/",{id: $
> (this).val()},
> function(d){
> alert("here")
>   var options = '';
>   for (var i = 0; i < j.length; i++) {
> options += '';
>   }
>   $("select#id_sous_categorie").html(options);
> })
> alert("there")
>   })
>
> })
>
> 
> {% endblock %}
>
> The only alert I've got is [[there]] and never [[here]].
> All seems to be fine except this...
>
> An idea ?
>
> On 8 mai, 15:22, martyn <[EMAIL PROTECTED]> wrote:
>
> > That's it !
> > I'm discovering JQuery, not very "sexy" for the first time, but seems
> > to be really powerfull.
>
> > Thank you Diego.
> > Django community really rocks.
--~--~-~--~~~---~--~~
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 vs. mod_wsgi

2008-05-08 Thread Graham Dumpleton

On May 9, 5:16 am, Pigletto <[EMAIL PROTECTED]> wrote:
> > The only thing thatmod_wsgiwould still give you through its daemon
> > mode is the ability to isolate WSGI applications into their own
> > processes so they do not interfere with each other. As I understand it
> > though, WebFaction has limits on the number of persistent processes
> > you have, thus am not sure you can effectively use daemon mode in
> > their environment without hitting these limits.
>
> There are no limits for a number of long running processes at
> Webfaction.
>
> Is there a kind ofmod_wsgisetup that allows to considerably reduce
> memory usage in comparision with apache prefork mode?

If you mean compared to Apache prefork and mod_python then answer is
yes.

Even without using mod_wsgi though, one can do better than prefork
with mod_python by using Apache worker MPM instead. Because Apache
worker MPM processes are multithreaded you don't need as many to be
running and so less copies of your application in memory.

Of course, your application has to be multithread safe. If you are
also trying to use PHP on same server, that can be a big problem as
not all PHP code and/or third party packages for it may be thread safe
depending on what versions you use.

If using mod_wsgi, you have two choices. Use it in embedded mode but
use Apache worker MPM. This will comparable results to mod_python,
although memory footprint of mod_wsgi by itself will be slightly less.

Whether you use Apache worker MPM or not, when using mod_wsgi you can
also use it in daemon mode. This is similar to fastcgi in the sense
that your web application is run in separate process(es), but mod_wsgi
will handle all the management of those processes, starting them up
and restarting them as necessary.

For a description of the various process/thread combinations when
using Apache/mod_wsgi read:

  http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading

Examples of using daemon mode described in section 'Defining Process
Groups' of:

  http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines

Also refer to the rest of that documentation, documentation about
configuration directives and integration guide for Django as well.

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: GeoDjangoFriendly?

2008-05-08 Thread Tyler Erickson

Alex,

I would be interested in hearing if your remaining issues with the
GeoDjango install get resolved.

Following the WebFaction forum post, it looks like there is another
user with a successful GeoDjango install (overcoming a GEOS config
problem).
http://forum.webfaction.com/viewtopic.php?id=957

I'm still undecided on WebFaction vs. SliceHost... both seem to have
their advantages.  For now I think I will just wait and watch for a
little while...

- Tyler


Alex Ezell wrote:
> >  WebFaction had a few issues with GeoDjango at first but I think
> >  they've now resolved them because they were able to setup GeoDjango on
> >  3 of my accounts with no problem.
> >
> >  Kevin.
>
> Hmmm...I wonder why mine is still not working after nearly two weeks
> of back and forth with them. Can you fix it? :)
>
> /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: gpl3 question

2008-05-08 Thread Brian Jackson

I preface this by saying: ASK A LAWYER!

The gist of the gpl is if you modify something and distribute it, you have to 
contribute the changes you've made back.

If you merely use some app inside of your project, my interpretation is you 
only have to contribute back the changes to that app. Since you could take 
out the app and still have functionality (assuming that the apps are written 
well).

There in lies the problem with asking for legal advice on a technical mailing 
list. You could very well get 40 perfectly logical interpretations back.

--Brian Jackson


On Thursday 08 May 2008 5:51:30 pm Rho wrote:
> Hi, hope somebody can clarify my doubt.
>
> How affects using a gpl3 app in a project?
>
> I meant a website project using an app under gpl3, like django-
> profile.
>
> Thanks,
>
> ./Rho
> 

--~--~-~--~~~---~--~~
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: Mailing List Filtering

2008-05-08 Thread Russell Keith-Magee

On Fri, May 9, 2008 at 12:52 AM, Dave Murphy <[EMAIL PROTECTED]> wrote:
>
> I'm signed up to a number of mailing lists, but django-users is the
> only one that is giving a significant number of spam messages (i.e. >0). Is 
> the list filtered, or is it just a free-for-all?

It's not a free for all. Google provides filtering, which catches most
of the spam. However, a large list like Django-users (7000+ readers)
makes an attractive target for spammers, so we get more than our fair
share of their attention, and some spam slips through. When that
happens, we manually block the author. This means that unfortunately,
some spam does slip through.

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: Logging framework (like log4j)?

2008-05-08 Thread msoulier

On May 8, 2:54 pm, ydjango <[EMAIL PROTECTED]> wrote:
> Is there a application level logging framework/utility in django or
> python that I can use in views to log to file and/or database.
> Something similar to log4j in java.

I'm using the Python standard library's logging module. Works fine.

Mike
--~--~-~--~~~---~--~~
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: No request.FILES, but file is still uploaded?

2008-05-08 Thread Karen Tracey
On Thu, May 8, 2008 at 3:51 PM, Beals <[EMAIL PROTECTED]> wrote:

> Correction: request.FILES does exist -- it just wasn't getting printed
> out with "print request".  An explicit "print request.FILES" did the
> trick.
>
> However, my question still stands: is form.save(commit=False) supposed
> to be writing the file out to disk?  Is this the newforms way of
> handling uploads, and therefore is checking for request.FILES and
> writing the file out ourselves passé?
>

Does your model have a FileField?  If so, then yes, I'd expect save of a
ModelForm for that model to save the file to disk.  Haven't checked the doc
to see if it explicitly says that will happen, that is just how I would
expect it to behave.

Not sure if/how this is different from oldforms, since I never used them.
But checking request.FILES etc is not necessarily passé, it just depends on
your model setup.  In my own app, I do upload files, but I don't use
FileField (nor ModelForms), so I have to handle writing the uploaded file to
the appropriate place myself.

Karen




>
> On May 8, 3:43 pm, Beals <[EMAIL PROTECTED]> wrote:
> > A while back, I looked for code snippets for uploading files.  Almost
> > every site I found contained something like the following:
> >
> > if 'file' in request.FILES:
> > file = request.FILES['file']
> > filename = file['filename']
> > fd = open('%s/%s' % (MEDIA_ROOT, filename), 'wb')
> > fd.write(file['content'])
> > fd.close
> > else:
> > print "No file attached."
> >
> > This seemed to work -- files were uploaded and the pointers from the
> > model worked fine, so I never thought to look at the logs... until
> > today, and I noticed that even though the uploads were working
> > properly, the "No file attached" message kept showing up.  Drilling
> > in, I found that FILES wasn't even in the request object!  Yet the
> > file was still written to disk... weird.
> >
> > So I started putting breakpoints in to figure out where in my view the
> > file was getting written out.  The fourth line is the culprit:
> >
> > if request.method == 'POST':
> > form = FooForm(request.POST, request.FILES)
> > if form.is_valid():
> > new_artifact = form.save(commit=False)
> > *BREAKPOINT*
> >
> > So how/why is form.save(commit=False) writing the file out to disk??
> > Is this expected behavior for ModelForms?  (NOTE: in case it matters,
> > I'm using the built-in Django webserver.)
> >
> > -Aaron
> >
>

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



gpl3 question

2008-05-08 Thread Rho

Hi, hope somebody can clarify my doubt.

How affects using a gpl3 app in a project?

I meant a website project using an app under gpl3, like django-
profile.

Thanks,

./Rho
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



a slightly complex .extra() question

2008-05-08 Thread Roboto

Hey all,
I'm trying to do something really simple and I was wondering if it is
possible within django.


There is 1 main table lets call it 'Team' - it contains teams all
unique
there are 2 sub tables that FK to Team, called Bulletin and Wall
posts.
There is a 3rd subtable called TeamAccess which FK to Team as well.
TeamAccess is a special table because users can be associated with
different teams and have a different experience with each team etc, so
this table holds that information.

What I want to try to accomplish is that when a user logs in, it
basically informs the user how many new bulletins and wall posts have
been made per team since their last visit to that team.  So it's a
simple date compare between TeamAccess objects and TeamBulletin
objects (and then I count them)

Is this query too hard to do?
Team
id

TeamAccess
id
team_id
last_bulletin_visit
last_wall_visit

TeamBulletin
id
team_id
create_date

TeamWall
id
team_id
create_date


here is my attempt that isn't working, there isn't much syntax
information I can compare with, so I'm not even sure if I'm on the
right track.  For the below, I'm just going to grab the number of
bulletins per team - my take on it from the examples that I have read.

Here is the sql (which I know works - that I want to build but not
using custom sql =P)
select *,(select count(0) from team t, teambulletin tb where t.id =
tb.team_id and team_id = ta.id group by team_id) as bulletinCount from
teamaccess ta where ta.user_id = '1'

teams = TeamAccess.objects.extra(select={'bulletinCount':'SELECT
COUNT(*) FROM team_teambulletin where team_teambulletin.team_id =
team_team.id and team_teamaccess.team_id = team_team.id'}).filter(user
= user.id)

but when I pump that into my shell the following error always shows up
Traceback (most recent call last):
  File "", line 1, in 
  File "/Library/Python/2.5/site-packages/django/db/models/query.py",
line 102, in __repr__
return repr(self._get_data())
  File "/Library/Python/2.5/site-packages/django/db/models/query.py",
line 470, in _get_data
self._result_cache = list(self.iterator())
  File "/Library/Python/2.5/site-packages/django/db/models/query.py",
line 183, in iterator
cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "")
+ ",".join(select) + sql, params)
  File "/Library/Python/2.5/site-packages/django/db/backends/util.py",
line 12, in execute
return self.cursor.execute(sql, params)
ProgrammingError: current transaction is aborted, commands ignored
until end of transaction block

--~--~-~--~~~---~--~~
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: legacy database

2008-05-08 Thread marcoshernandez

Thanks, Thougt was included in the python distribution. what a shame!
XD

On 7 mayo, 22:05, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Wed, May 7, 2008 at 6:53 PM, marcoshernandez <[EMAIL PROTECTED]> wrote:
> > I have a legacy database in mysql and i tried to create the models
> > with the manage.py inspectdb --settings =path.to.settings command, but
> > the script crashes and says MySQLdb module doesn't exists (literally
> > it says: "Error loading MySQLdb module: %s" % e
> > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> > module: No mo
> > dule named MySQLdb")
> > I'm running Django 0.96 with activePython 2.5.
> > Thanks in advance for the help...
>
> You need to install MySQLdb on your machine.  This is the piece of software
> that provides a python interface to MySQL.  You don't mention your system
> type.  Most will have pre-built packages for MySQLdb but where to find them
> depends on exactly what OS you are running.
>
> Karen
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Ma.gnolia API Django and time zone

2008-05-08 Thread brian mckinney

Does anyone happen to know the proper way to interact with an API that
won't convert trailing UTC time zone specifications?

I'm trying to sync up a Django app with the Ma.gnolia's api, and
Ma.gnolia will not convert UTC adjusted times. The two hour
differential will not allow me to sync up my local db with the api
results I get from Ma.gnolia. The only choice I can think of is to
grab the datetime, convert to Magnolia's local time, do a query from
Ma.gnolia's api and let Django convert it back to my local time.

Any suggestions?
--~--~-~--~~~---~--~~
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: Class Admin prob (tut)

2008-05-08 Thread jonknee

> class Poll(models.Model):
>         """docstring for Poll"""
>         question = models.CharField(maxlength=200)
>         pubdate = models.DateTimeField("date published")
>         def __str__(self):
>                 """docstring for __unicode__"""
>                 return self.question
>                 class Admin:
>                         pass
>

Your indenting is off. The Admin class should be one indented level
in, not two. As for your routing issue, you need to tack admin onto
your url (localhost/admin/) to view the admin. The error page is
basically saying, "here's what you gave (/) and I found no matches
among the following regular expressions (^admin/)". It's 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: No request.FILES, but file is still uploaded?

2008-05-08 Thread Beals

Correction: request.FILES does exist -- it just wasn't getting printed
out with "print request".  An explicit "print request.FILES" did the
trick.

However, my question still stands: is form.save(commit=False) supposed
to be writing the file out to disk?  Is this the newforms way of
handling uploads, and therefore is checking for request.FILES and
writing the file out ourselves passé?

On May 8, 3:43 pm, Beals <[EMAIL PROTECTED]> wrote:
> A while back, I looked for code snippets for uploading files.  Almost
> every site I found contained something like the following:
>
> if 'file' in request.FILES:
>     file = request.FILES['file']
>     filename = file['filename']
>     fd = open('%s/%s' % (MEDIA_ROOT, filename), 'wb')
>     fd.write(file['content'])
>     fd.close
> else:
>     print "No file attached."
>
> This seemed to work -- files were uploaded and the pointers from the
> model worked fine, so I never thought to look at the logs... until
> today, and I noticed that even though the uploads were working
> properly, the "No file attached" message kept showing up.  Drilling
> in, I found that FILES wasn't even in the request object!  Yet the
> file was still written to disk... weird.
>
> So I started putting breakpoints in to figure out where in my view the
> file was getting written out.  The fourth line is the culprit:
>
> if request.method == 'POST':
>     form = FooForm(request.POST, request.FILES)
>     if form.is_valid():
>         new_artifact = form.save(commit=False)
>         *BREAKPOINT*
>
> So how/why is form.save(commit=False) writing the file out to disk??
> Is this expected behavior for ModelForms?  (NOTE: in case it matters,
> I'm using the built-in Django webserver.)
>
> -Aaron
--~--~-~--~~~---~--~~
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 request.FILES, but file is still uploaded?

2008-05-08 Thread Beals

A while back, I looked for code snippets for uploading files.  Almost
every site I found contained something like the following:

if 'file' in request.FILES:
file = request.FILES['file']
filename = file['filename']
fd = open('%s/%s' % (MEDIA_ROOT, filename), 'wb')
fd.write(file['content'])
fd.close
else:
print "No file attached."

This seemed to work -- files were uploaded and the pointers from the
model worked fine, so I never thought to look at the logs... until
today, and I noticed that even though the uploads were working
properly, the "No file attached" message kept showing up.  Drilling
in, I found that FILES wasn't even in the request object!  Yet the
file was still written to disk... weird.

So I started putting breakpoints in to figure out where in my view the
file was getting written out.  The fourth line is the culprit:

if request.method == 'POST':
form = FooForm(request.POST, request.FILES)
if form.is_valid():
new_artifact = form.save(commit=False)
*BREAKPOINT*

So how/why is form.save(commit=False) writing the file out to disk??
Is this expected behavior for ModelForms?  (NOTE: in case it matters,
I'm using the built-in Django webserver.)

-Aaron
--~--~-~--~~~---~--~~
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 vs. mod_wsgi

2008-05-08 Thread Pigletto

> The only thing that mod_wsgi would still give you through its daemon
> mode is the ability to isolate WSGI applications into their own
> processes so they do not interfere with each other. As I understand it
> though, WebFaction has limits on the number of persistent processes
> you have, thus am not sure you can effectively use daemon mode in
> their environment without hitting these limits.
There are no limits for a number of long running processes at
Webfaction.

Is there a kind of mod_wsgi setup that allows to considerably reduce
memory usage in comparision with apache prefork mode?
--~--~-~--~~~---~--~~
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 tutorial .rst

2008-05-08 Thread Hernan Olivera

Thanks! I shoud have to guess it!

--~--~-~--~~~---~--~~
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: Logging framework (like log4j)?

2008-05-08 Thread Jeff Anderson

ydjango wrote:

Is there a application level logging framework/utility in django or
python that I can use in views to log to file and/or database.
Something similar to log4j in java.
  

Is this what you are looking for?

http://www.red-dove.com/python_logging.html

Jeff Anderson



signature.asc
Description: OpenPGP digital signature


Logging framework (like log4j)?

2008-05-08 Thread ydjango

Is there a application level logging framework/utility in django or
python that I can use in views to log to file and/or database.
Something similar to log4j in java.
--~--~-~--~~~---~--~~
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 tutorial .rst

2008-05-08 Thread Jeff Anderson

Hernan Olivera wrote:

Hello
Is it possible to get the .rst files for the Django tutorial, for
translating it to spanish?
Thanks
  

¡Buenos Dias!

The .rst files are freely available. They exist in the source tree for 
django.


AUTHORS
INSTALL
LICENSE
MANIFEST.in
README
django/ <--- the django python module lives here.
docs/  <--- They live in here.
examples/
extras/
scripts/
setup.cfg
setup.py
tests/

Si necesitas alguín más para ver tus translaciones, te puedo ayudar.

¡Que tengas un buen día!

Jeff Anderson



signature.asc
Description: OpenPGP digital signature


get at *the* cursor

2008-05-08 Thread Jim

I am trying to debug an application which raises a dB exception
(unable to adapt), and I'd like to get the cursor that Django was
using when the exception happened.

The reason is that psycopg2 has a couple of attributes attached to the
cursor telling exactly what was the query and what was the response
from PstgreSQL, and I'd like to read them.

I can get the connection as django.db.connection, but even after some
spelunking of the source I'm having trouble getting the cursor.
Anyone know?

Thanks in advance,
Jim
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django tutorial .rst

2008-05-08 Thread Hernan Olivera

Hello
Is it possible to get the .rst files for the Django tutorial, for
translating it to spanish?
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: 0.96.1 lighttpd + FastCGI

2008-05-08 Thread Jeff Anderson

Panos Laganakos wrote:

This post[1] seems to have the same issue. Ticket 6063, which was
fixed at rev.6895.

Problem is that the whole project is written for 0.96.1. Any way this
can be fixed in 0.96.1?
  

My guess is that you'd have to backport the patch yourself.

This is one of the reasons that using the latest trunk is the fact that 
you get the bugfixes and features. 0.96 will only get security updates, 
hence the 0.96.1 release.


I'd recommend that you go ahead and forwardport your whole project to 
the latest svn revision. The latest development version is much closer 
to 1.0 than 0.96 is. Forward porting django apps developed for 0.96 to 
the latest svn version is actually much easier than I thought it would 
be. This is because the devs have done a magnificent job of documenting 
the backwards incompatible changes.


Either way, you're going to end up refactoring either your project or 
the patch. If you backport the patch, you'd be stuck running a custom 
patched version of django.


Good luck!

Jeff Anderson



signature.asc
Description: OpenPGP digital signature


Re: Class Admin prob (tut)

2008-05-08 Thread sebey

also on the homepage it says this

""

Page not found (404)
Request Method: GET
Request URL:http://localhost:8000/

Using the URLconf defined in ubertester.urls, Django tried these URL
patterns, in this order:

   1. ^admin/

The current URL, /, didn't match any of these.
""

what does this mean?

On May 8, 3:15 pm, sebey <[EMAIL PROTECTED]> wrote:
> ok so I am on page two of the django tutorial in the .96 docs and its
> says to get the poll model into the admin interface and I type
>
> class Poll(models.Model):
> """docstring for Poll"""
> question = models.CharField(maxlength=200)
> pubdate = models.DateTimeField("date published")
> def __str__(self):
> """docstring for __unicode__"""
> return self.question
> class Admin:
> pass
>
> and this is all I am importing
>
> from django.db import models
>
> help please thanking you in advance
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Mailing List Filtering

2008-05-08 Thread Dave Murphy

I'm signed up to a number of mailing lists, but django-users is the
only one that is giving a significant number of spam messages (i.e. >0). Is the 
list filtered, or is it just a free-for-all?
-- 
Dave Murphy - http://schwuk.com
Get in touch - http://schwuk.com/contact

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



worlds new free webhosting directory(more than 500 free website hostings)

2008-05-08 Thread siva

Free web hosting directory


www.webhostingsfree.com


This is the nice and having morethan 500 free webhosting directory


Go and view this website use it for your websites

Enjoy guys!!!







--~--~-~--~~~---~--~~
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: Unique Users Per Site in 'users' & 'sites' Frameworks

2008-05-08 Thread Tim

You might consider using django profiles [1] for this. You could add a
field to a user profile that would be their mini-site user name and
put some random username in the Django User field. That way you could
do all your own logic around the user name. All you'd need to do is
override the login method to look at your username instead of the
django version.

http://code.google.com/p/django-profiles/

Tim

On May 7, 8:59 pm, Brian <[EMAIL PROTECTED]> wrote:
> I have a feeling we'll be rolling our own for this one. That's a lot
> of time to invest though :-/ At least the admin will still be usable.
> Has anybody else run into a similar scenario?
>

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



pre_save signal called twice when adding model to db & change to instance object during pre_save don't get saved

2008-05-08 Thread Alen Ribic

The pre_save signal seems to be called twice when adding the model
object to db and change to the instance object during pre_save don't
get saved.

{{

def do_negative_amount(sender, instance, signal, *args, **kwargs):
print instance.transaction_type

if instance.id is None and instance.transaction_type == 'M':
instance.amount = float(instance.amount) * float(-1)

class FinancialTransaction(models.Model):
transaction_type = models.ForeignKey(TransactionType)
...

dispatch.connect(do_negative_amount, signal=signals.pre_save,
sender=FinancialTransaction)

}}

I registered the FinancialTransaction with Admin (nfa branch).

No 1.) The above print statement in the do_negative_amount() function
prints twice when I click the add button 'once' in the nfa to add the
entry to db. Surely this shouldn't happen?

No 2.) The *** instance.amount = float(instance.amount) * float(-1)
*** in the do_negative_amount() function does make the change to the
instance.amount attribute (e.g. 850 becomes -850). However, the change
is not reflected in the new database entry. (In db, its 850 instead of
the modified -850.) I would expect the instance reference passed
through the do_negative_amount() function to be modifiable. Its a
pre_save signal / step. Maybe I'm missing something.

Regards,
-Alen Ribic

--~--~-~--~~~---~--~~
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: A twist on cross importing models

2008-05-08 Thread Matthias Kestenholz

On Thu, 2008-05-08 at 16:29 +0200, Christian Joergensen wrote:
> Matthias Kestenholz wrote:
> > I can think of two methods of loading Variable inside your calculate
> > function:
> > 
> > - Write the import statement in the function instead of writing it at
> > the top of the module.
> 
> You may only use module level imports* out off the main scope. And then 
> you could just as well import it at the top of the file as you would 
> otherwise.
> 
> * that is, `import ...` not `from ... import ...`.

I'm not sure I understand. The following example may not follow good
practice guidelines, but it worked for me in one of my early projects.

Is this going to break sometime? Why?

-- 8< --
class Entry(models.Model):
   author = models.ForeignKey(User)
   # ...
   def save(self):
  if not self.author_id
 from middleware import get_current_user
 self.author_id = get_current_user()
  super(Entry, self).save()
-- 8< --


Thanks,
Matthias

--~--~-~--~~~---~--~~
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-admin.py not working on OS X 10.5

2008-05-08 Thread Brandon Taylor

Hello everyone,

Sorry for the late reply. I have changed the shebang line to /usr/
local/bin, which is where the Python interpreter is installed. I have
changed permissions on django-admin.py to be executable.

Here is my .bash_profile:

PATH=$PATH:/usr/local/bin
PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:$
{PATH}"
export PATH

And STILL - django-admin.py startproject foo = command not found

WTF? I'm at a loss!

On May 8, 6:45 am, "Shane Emmons" <[EMAIL PROTECTED]> wrote:
> Did you, "chmod +x django-admin.py"?
>
>
>
> On Thu, May 8, 2008 at 6:52 AM, Francis <[EMAIL PROTECTED]> wrote:
>
> > It works without problem here.
>
> > 1. I copy my trunk into the default python site-package /Library/
> > Python/2.5/site-packages/django
>
> > Normally I use /usr/bin, since local/bin doens't exist on Leopard
> > (exept if you are using something like fink or macport)
> > But I tried it to see if it works.
> > 2. I create the directory : sudo mkdir /usr/local/bin
> > 3. then symlink : sudo ln -sf /Library/Python/2.5/site-packages/django/
> > bin/django-admin.py /usr/local/bin/django-admin.py
>
> > it works. /usr/local/bin is already in your path.
>
> > Francis
>
> > On May 7, 6:46 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> > > Hello everyone,
>
> > > I'm setting up a dev environment on a co-worker's Mac running 10.5.2
>
> > > I have Django cehcked out from trunk, and symlinked into Python 2.5.2.
> > > I can successfully import Django from within a Python terminal
> > > session.
>
> > > I have django-admin.py symlinked from the trunk checkout to /usr/local/
> > > bin.
>
> > > When I try to execute: django-admin.py startproject foo, I get an
> > > error saying:
> > > django-admin.py: command not found
>
> > > I have added /usr/local/bin to my .bash_profile, resourced, and
> > > restarted, but still no dice. Anyone have any ideas on what I did
> > > wrong? I've doen this many times, just not on 10.5.
>
> > > TIA,
> > > Brandon
>
> --
> Shane Emmons
> E: [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: A twist on cross importing models

2008-05-08 Thread Christian Joergensen

Matthias Kestenholz wrote:
> I can think of two methods of loading Variable inside your calculate
> function:
> 
> - Write the import statement in the function instead of writing it at
> the top of the module.

You may only use module level imports* out off the main scope. And then 
you could just as well import it at the top of the file as you would 
otherwise.

* that is, `import ...` not `from ... import ...`.

/Christian

-- 
Christian Joergensen
http://www.technobabble.dk

--~--~-~--~~~---~--~~
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: Admin : Select category -> show subcategory

2008-05-08 Thread martyn

The Javascript Function does not seem to be executed.
In admin_form.html :

{% extends "admin/change_form.html" %}

{% block extrahead %}
 http://127.0.0.1/django-medias/chantier/js/
jquery-1.2.3.js" type="text/javascript">

$(function(){
  $("select#id_categorie").change(function(){
$.getJSON("/admin/boutique/produit/getsubcategory/",{id: $
(this).val()},
function(d){
alert("here")
  var options = '';
  for (var i = 0; i < j.length; i++) {
options += '';
  }
  $("select#id_sous_categorie").html(options);
})
alert("there")
  })
})


{% endblock %}


The only alert I've got is [[there]] and never [[here]].
All seems to be fine except this...

An idea ?




On 8 mai, 15:22, martyn <[EMAIL PROTECTED]> wrote:
> That's it !
> I'm discovering JQuery, not very "sexy" for the first time, but seems
> to be really powerfull.
>
> Thank you Diego.
> Django community really rocks.
--~--~-~--~~~---~--~~
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 Tutorial

2008-05-08 Thread Martin Diers

On May 8, 2008, at 7:39 AM, Boodlooder wrote:

>
> I'm logged in as root, trying to execute:
>
> python mange.py syncdb
>
> the command is returning:
>
...
>super(Connection, self).__init__(*args, **kwargs2)
> _mysql_exceptions.OperationalError: (1049, "Unknown database
> 'reinhardt'")
>
> When I check MySQL for the db, I only have the default MySQL db's.  I
> am new to python, but have extensive programming experience.

syncdb does not create the database for you, except with SQLite.

In MySQL you need to create the DB, and possibly assign it a username  
and password with a GRANT ALL command.

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



Class Admin prob (tut)

2008-05-08 Thread sebey

ok so I am on page two of the django tutorial in the .96 docs and its
says to get the poll model into the admin interface and I type

class Poll(models.Model):
"""docstring for Poll"""
question = models.CharField(maxlength=200)
pubdate = models.DateTimeField("date published")
def __str__(self):
"""docstring for __unicode__"""
return self.question
class Admin:
pass

and this is all I am importing

from django.db import models

help please thanking you in advance
--~--~-~--~~~---~--~~
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-admin.py not working on OS X 10.5

2008-05-08 Thread Roboto

I will second Francis here
1. I copy my trunk into the default python site-package /Library/
Python/2.5/site-packages/django

The key thing is that Leopard comes with it's own built in Python 2.5,
where it give priority when it comes to utilizing python.

You will need to put anything python related into the /Library/Python/
2.5/site-packages directory, psycopg2, etc.

On May 8, 7:45 am, "Shane Emmons" <[EMAIL PROTECTED]> wrote:
> Did you, "chmod +x django-admin.py"?
>
>
>
> On Thu, May 8, 2008 at 6:52 AM, Francis <[EMAIL PROTECTED]> wrote:
>
> > It works without problem here.
>
> > 1. I copy my trunk into the default python site-package /Library/
> > Python/2.5/site-packages/django
>
> > Normally I use /usr/bin, since local/bin doens't exist on Leopard
> > (exept if you are using something like fink or macport)
> > But I tried it to see if it works.
> > 2. I create the directory : sudo mkdir /usr/local/bin
> > 3. then symlink : sudo ln -sf /Library/Python/2.5/site-packages/django/
> > bin/django-admin.py /usr/local/bin/django-admin.py
>
> > it works. /usr/local/bin is already in your path.
>
> > Francis
>
> > On May 7, 6:46 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> > > Hello everyone,
>
> > > I'm setting up a dev environment on a co-worker's Mac running 10.5.2
>
> > > I have Django cehcked out from trunk, and symlinked into Python 2.5.2.
> > > I can successfully import Django from within a Python terminal
> > > session.
>
> > > I have django-admin.py symlinked from the trunk checkout to /usr/local/
> > > bin.
>
> > > When I try to execute: django-admin.py startproject foo, I get an
> > > error saying:
> > > django-admin.py: command not found
>
> > > I have added /usr/local/bin to my .bash_profile, resourced, and
> > > restarted, but still no dice. Anyone have any ideas on what I did
> > > wrong? I've doen this many times, just not on 10.5.
>
> > > TIA,
> > > Brandon
>
> --
> Shane Emmons
> E: [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
-~--~~~~--~~--~--~---



Rapid CSS Editor

2008-05-08 Thread Tatyana Sveatna
Rapid CSS Editor Haz 17,
2007 *Author: sdc | Filed under:
**Program*

[image:
rapidcss] 
Rapid
CSS Editor ile hızlı ve kolay bir şekilde, hiçbir zorluk çekmeden CSS
kodları oluşturabilir ve düzenleyebilirsiniz. CSS kodlarını el ile
yazabileceğiniz gibi, programın sizin için yazmasını da sağlayabilirsiniz.
Yazılımın otomatik tamamlama, kod denetleyici ve CSS denetleyici gibi
kolaylık sağlayan birçok yardımcı özelliği bulunmaktadır. Sonuçları,
programın dahili önizlemesiyle anında görebilirsiniz.
(more…)

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



Firefox Ultimate Optimizer

2008-05-08 Thread Tatyana Sveatna
Firefox Ultimate
OptimizerMar
15, 2008 *Author: sdc | Filed under:
**Program*

Firefox Ultimate Optimizer adındaki
minik ve kurulum gerektirmeyen yazılımla Firefox'unuzun yüksek ram
tüketiminin önene geçmiş oluyorsunuz. İnanılmaz ama gerçek! Kurulum
gerektirmeyen dosyayı çalıştırdığınız anda işini yapmaya başlıyor ve sonucu
görüyorsunuz. 
(more…)

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

2008-05-08 Thread Tatyana Sveatna
windows xp live
editionMar
19, 2008 *Author: sdc | Filed under:
**Program*

[image: 
winpe]Öncelikle
herkesin elinde kesinlikle bulunması gereken bir işletim sistemidir..

CD den Çalışan Windows live edition 54.2 MB , Sadeleştirilmiş windows live
edition'u sistem çökmelerinde bilgisayarınızı kolaylıkla açmakta
kullanabilirsiniz.Hardiskten çalışan xp ye göre dezavantajı biraz geç
açılmasıdır ama verilerinizi kurtarmak için beklemeye değer.

Ayrıca normalde değiştiremediğiniz sistem dosyalarını da değiştirme şansını
bulursunuz.ISO dosyasıdır herhangi bir cd yazma programı ile Nero vs.. cd ye
yazdırıp cd den çalışan xp nizi kullanabilirsiniz.

Download yazının devamında
(more…)

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



Vista Service Pack 1 Downlaod

2008-05-08 Thread Tatyana Sveatna
Vista Service Pack 1 Nis
28, 2008 *Author: sdc | Filed under:
**Program*

[image: 
windows-logo]

Vista SP1 çıktı çıkacak derken, sonunda indirilmeye sunuldu. 32bit, 64bit ve
DVD ISO linkleri burada Service Pack 1′i indirmeden önce Vista'nızın 32 bit
mi, 64 bit mi olduğunu kontrol edin, en düşük download boyutu 500 mb'ın
üstünde.Eğer Windows Vista SP1 indirme boyutu size yüksek geliyorsa, Windows
Update ile gelecek güncellemeyi bekleyebilirsiniz. (Download
Now…)

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



Messenger for Mac 7

2008-05-08 Thread Tatyana Sveatna
Messenger for Mac 7 May
2, 2008 *Author: sdc | Filed under:
**Program*

[image: mac] 
Microsoft'un
Mac  kullanıcıları için hazırladığı
Messenger for Mac  7 tamamlandı.
Windows'taki MSN  (Windows Live) Messenger
ile benzer şekilde bağlantılarınızla iletişim kurmanıza ve anlık
mesajlaşmanıza imkan tanıyan Messenger for
Mac7, hem PowerPC hem de Intel
tabanlı
Mac  bilgisayarlarda çalışıyor. Kişi
listesi ayarlarında bazı geliştirmelerin göze çarptığı Messenger for
Mac7 yazılımının 21 MB'lık DMG
kurulum dosyasını
burayatıklayarak
indirebilirsiniz. Donwload
Now 

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



Trojan Remover 6.6.9 Download Now

2008-05-08 Thread Tatyana Sveatna
Trojan Remover 6.6.9 May
6, 2008 *Author: sdc | Filed under:
**Program*

[image: Trojan Remover
6.6.9]
Trojan  Remover bir
truvaatı algılama ve temizleme
yazılımıdır.
Truva  atları bilgisayar korsanları
tarafından yazılmış olan zararlı kodlardır.
Bilgisayarkorsanlarının temel
amacı sisteminizin denetimini elinizden alıp kendi
denetimine geçirmektir.

Trojan Remover was written to aid in
the removal of Trojan  Horses from a
computer  where standard anti-virus
software has either failed to detect the
or is unable to effectively eliminate it. In no way should it be considered
as an alternative to regularly using good to protect your computer.

Download edebilmek  için yazının  devamını  okuyun (Download
Now…)

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



Ashampoo Music Studio 3.40 Download

2008-05-08 Thread Tatyana Sveatna
Ashampoo Music Studio
3.40May
6, 2008 *Author: sdc | Filed under:
**Program*

[image: Ashampoo Music Studio
3.40]Ashampoo
Music  Studio bir ses dosyası düzenleme
yazılımıdır. Yazılım ile Audio CD'lerinizi ripleme, ses dosyalarının
biçimlerini değiştirme, CD, DVD ve BLU-RAY
disklere yazdırabilme, çalma liseleri
oluşturma işlemlerini kusursuz biçimde gerçekleştir.

The complete digital Music  solution:
Rip, edit, convert, record, repair and burn. Do you like music? Do you use a
computer? Then you need *Ashampoo *Music Studio 3. This program always been
a favorite of digital music fans and the latest version now includes
everything you need to create, edit and manage your digital music
collection. And using it is nearly as simple as operating a CD player.
Ashampoo Music  Studio 3 can rip CDs,
import CD data, create playlists, burn, edit, record, repair.

Donwload edebilmeniz  için yazının  devamını okuyun (Donwload
Now…)

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



Spyware Doctor Download

2008-05-08 Thread Tatyana Sveatna
Spyware Doctor May 7, 2008
*Author: sdc | Filed under:
**Program*

[image: Spyware Doctor]Spyware  Doctor
5.0.0.182 *Spyware* Doctor, dunyanın  en popüler
casusyazılım temizleyicisi ve
gercek zamanlı koruma aracıdır.

*Spyware* Doctor; bilgisayarınızı gercek zamanlı olarak tehditlerden
engellemek, gelismis sistem taraması ve bilinen tarayıcı enfeksiyonlarına
karşı bagışıklı kazandırmak için üç  adet
casusyazılım koruma yolu sağlar.
bir çok ödül kazanmış olan
*Spyware* Doctor, bilgisayarınızı casus
yazılım ,
reklam  içeren yazılım , truva atı
(trojan), keylogger (klavye günlükcüsü), cerez (cookie), tarayıcı hijacker
ve diger tehditlere karşı korur.

(Donwload now …) 

--~--~-~--~~~---~--~~
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 Service Pack 3 Download

2008-05-08 Thread Tatyana Sveatna
Windows XP Service Pack 3 Türkçe
DownloadMay
7, 2008 *Author: sdc | Filed under:
**Program*

[image: Windows XP Service Pack 3
Türkçe]
 Windows XP  Service Pack 3 Türkçe
yazılımı *Windows XP* den vazgeçemeyen ve üstelik *Windows XP*yi Türk'çe
olarak kullanan kullanıcılar  için geliştirilen
SP3güncellemesi.
*Windows XP *daha güvenli ve güncel halde tutmak istiyorsanız 3. servis
paketini kullanmanızı öneririz.


(Donwload 
Now…)

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



Aston Windows Xp Theme

2008-05-08 Thread Tatyana Sveatna
Aston Windows Xp
ThemeMay
7, 2008 *Author: sdc | Filed under:
**Program*

Normal Windows görünümünden sıkılanlar için yapılmış çok harika bir kabuk
programı. Masaüstünü, Windows Gezgini'ni, Explorer'i tamamen
değiştirebiliyor.Bu program sayesinde bilgisayarınızın görünümünü Windows
XP, Linux vs. yapabilirsiniz. Programda ile birlikte 3 adet arayüz paketi
hazır olarak bulunmakta. Ayrıca üreticinin web sitesinden de yüzlerce arayüz
paketinden istediğinizi indirebilirsiniz. (Download
Now…)

--~--~-~--~~~---~--~~
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: Admin : Select category -> show subcategory

2008-05-08 Thread martyn

That's it !
I'm discovering JQuery, not very "sexy" for the first time, but seems
to be really powerfull.

Thank you Diego.
Django community really rocks.
--~--~-~--~~~---~--~~
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 SQL Query

2008-05-08 Thread Tourneur Henry-Nicolas

Sorry, the python indentation was wrong:

query = SiteEquipment.objects.extra(tables=['sites_site'])
if asset != '':
query |= SiteEquipment.objects.filter(asset__icontains=asset)

if mark_sel != -1:
query |
=SiteEquipment.objects.filter(equipment__mark__id=mark_sel)

if eq_sel != -1:
query |= SiteEquipment.objects.filter(equipment__id=eq_sel)

if fqdn != '':
fqdn = '%%' + fqdn + '%%'
query |= SiteEquipment.objects.extra(

where=['equipments_siteequipment.site_id=equipments_siteequipment.name || 
sites_site.name ILIKE \'%s\'' %fqdn])



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



Problem with SQL Query

2008-05-08 Thread Tourneur Henry-Nicolas
Hi,

I'm trying to execute a "special" request. The request is based on
multiple OR statement. I create the querysets via objects.filter and, at
the end there is an extra statement. I do not know how to remove this
extra() call because I have to do a concatenation (the || part, in SQL
is a concatenate of 2 fields).

query = SiteEquipment.objects.extra(tables=['sites_site'])
if asset != '':
query |= SiteEquipment.objects.filter(asset__icontains=asset)

if mark_sel != -1:
query |=SiteEquipment.objects.filter(equipment__mark__id=mark_sel)

if eq_sel != -1:
query |= SiteEquipment.objects.filter(equipment__id=eq_sel)

if fqdn != '':
fqdn = '%%' + fqdn + '%%'
query |=SiteEquipment.objects.extra(
where=['equipments_siteequipment.site_id =
equipments_siteequipment.name || sites_site.name ILIKE \'%s\'' % fqdn])

The problem is that the previous code will output (if we only activate
the mark_sel if and the fqdn if):

SELECT equipments_siteequipment.id, equipments_siteequipment.site_id,
equipments_siteequipment.equipment_id, equipments_siteequipment.name,
equipments_siteequipment.asset 

FROM equipments_siteequipment INNER JOIN equipments_equipment AS
equipments_siteequipment__equipment ON
equipments_siteequipment.equipment_id=equipments_siteequipment__equipment.id,  
sites_site 

WHERE equipments_siteequipment.site_id = sites_site.id AND
equipments_siteequipment.name || sites_site.name ILIKE '%RTR2%' AND
((equipments_siteequipment__equipment.mark_id = 1))

As you can see (in red) the 2 queries are ANDed but I wrote |=. My whish
is that the red AND should be an OR.

I don't especially wan to use an extra, if you have any idea about howto
do a concatenation with filter, please tell me.

TIA.


--~--~-~--~~~---~--~~
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: Gradually porting an established site to Django

2008-05-08 Thread Valts Mazurs
Hi, Nick,

I would recommend to use webserver tools to route the traffic to different
handlers.
For example, to handle legacy URLs for bsdradius.org I use mod_redirect in
lighttpd:

-
# legacy urls
url.redirect = (
"index\.php$" => "/",
"about\.php$" => "/about/",
"doc\.php$" => "/doc/",
"changelog\.php$" => "/changelog/",
"license\.php$" => "/license/",
"downloads\.php$" => "/downloads/",
"contact\.php$" => "/contact/",
)


I think that it would not be too complicated to define some prefix for the
old site and some prefix for the new Django powered site and then use
mod_redirect to route the traffic.

Best regards,
Valts.

On Thu, May 8, 2008 at 3:42 PM, Nick Mellor <[EMAIL PROTECTED]>
wrote:

>
> Hi all,
>
> I'm a CS-graduate, but out of the game for a while, and a beginner at
> web programming. I've written database apps to generate static HTML
> pages. I could do with some pointers.
>
> I have a working site, written by someone else, to maintain and
> develop:
>
> www.behandlerlisten.dk
>
> It's a site for Danish alternative therapists, implemented using raw
> Python, PostgreSQL and LibXSLT. The plan is to internationalise and
> extend it in various ways.
>
> I want to port it to Django, bit by bit, leaving the old site live,
> with new pages handled by Django operating side by side with old page
> handled by the old behandlerlisten code. We would then gradually move
> over entirely to Django.
>
> In the mean time I might want Django to handle
>
> .../therapists/nick_mellor.html
>
> but the old behandlerlisten to handle:
>
> .../resultat?ids=1007
>
> I think Django will raise an exception if it meets a pattern it can't
> handle. Is this true?
>
> How can I get Django to handle some URL patterns, and leave others to
> the "old" site code?
>
> Many thanks for any hints to get me going.
>
> Nick
> >
>

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



Gradually porting an established site to Django

2008-05-08 Thread Nick Mellor

Hi all,

I'm a CS-graduate, but out of the game for a while, and a beginner at
web programming. I've written database apps to generate static HTML
pages. I could do with some pointers.

I have a working site, written by someone else, to maintain and
develop:

www.behandlerlisten.dk

It's a site for Danish alternative therapists, implemented using raw
Python, PostgreSQL and LibXSLT. The plan is to internationalise and
extend it in various ways.

I want to port it to Django, bit by bit, leaving the old site live,
with new pages handled by Django operating side by side with old page
handled by the old behandlerlisten code. We would then gradually move
over entirely to Django.

In the mean time I might want Django to handle

.../therapists/nick_mellor.html

but the old behandlerlisten to handle:

.../resultat?ids=1007

I think Django will raise an exception if it meets a pattern it can't
handle. Is this true?

How can I get Django to handle some URL patterns, and leave others to
the "old" site code?

Many thanks for any hints to get me going.

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



Problem with Tutorial

2008-05-08 Thread Boodlooder

I'm logged in as root, trying to execute:

python mange.py syncdb

the command is returning:

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 1672, in execute_manager
execute_from_command_line(action_mapping, argv)
  File "/usr/lib/python2.5/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.5/site-packages/django/core/management.py",
line 492, in syncdb
_check_for_validation_errors()
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 1167, in _check_for_validation_errors
num_errors = get_validation_errors(s, app)
  File "/usr/lib/python2.5/site-packages/django/core/management.py",
line 990, in get_validation_errors
db_version = connection.get_server_version()
  File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/
base.py", line 127, in get_server_version
self.cursor()
  File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/
base.py", line 99, in cursor
self.connection = Database.connect(**kwargs)
  File "/usr/lib/python2.5/site-packages/MySQLdb/__init__.py", line
74, in Connect
return Connection(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line
170, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1049, "Unknown database
'reinhardt'")

When I check MySQL for the db, I only have the default MySQL db's.  I
am new to python, but have extensive programming experience.

MySQL working fine, can access as root w/out password

[EMAIL PROTECTED] reinhardt]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


All suggestions would be greatly appreciated!

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



情色影片

2008-05-08 Thread 歐小姐

台灣兼職~空姐.護士.專櫃.OL
模特兒.3C展美眉.大學生.熟女
讓您安心!我們一律現金交易!!
外送:台北縣(市)/台中市/旅館
營業時間:下午2點~凌晨3點
Skype連絡 : hihi168168
 MSN連絡: kirara168
請聯絡~歐小姐
http://forum.europeanservers.us/cgi-bin/lst.eur?didi168
http://forum.europeanservers.us/cgi-bin/lst.eur?fifi168
http://forum.europeanservers.us/cgi-bin/lst.eur?gigi168
http://forum.europeanservers.us/cgi-bin/lst.eur?kiki168
http://forum.europeanservers.us/cgi-bin/lst.eur?mimi168

新光三越信義店, 新光三越台中店, 新光三越百貨公司, 台中新光三越, 新光三越站前店,
台中新光三越百貨公司, 新光三越百貨公司周年慶, 新光三越百貨, 新光三越A11館,
台南新光三越, 新光三越南西店, 新光三越A11, 高雄新光三越, 新光三越台南新天地,
新光三越信義店A8館, 新光三越天母店, 天母新光三越, 新光三越信義新天地,
高雄新光三越百貨公司, 新光三越台南中山店, 台北新光三越, 信義新光三越, 新光三越A9館,
台中新光三越gucci專賣店, 新光三越福華雲彩餐廳, 桃園新光三越, 信義新光三越A11,
新光三越A4館, 新光三越中山店, 新光三越高雄店

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



Foreignkey(self) ProgrammingError: (2014,, "Commands out of sync; you can't run this command now")

2008-05-08 Thread super

Concider this:
parent = models.ForeignKey('self', null=True, blank=True,
related_name='children')

So my user makes a database that has

root
level1
level2
level3

If the user moves level1 under level3 than the database breaks and I
get this error.
ProgrammingError: (2014,, "Commands out of sync; you can't run this
command now")

This is because the chain is broken where each level point to its
parent up to root! How can I avoid this in the admin!
--~--~-~--~~~---~--~~
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-admin.py not working on OS X 10.5

2008-05-08 Thread Shane Emmons
Did you, "chmod +x django-admin.py"?

On Thu, May 8, 2008 at 6:52 AM, Francis <[EMAIL PROTECTED]> wrote:

>
> It works without problem here.
>
> 1. I copy my trunk into the default python site-package /Library/
> Python/2.5/site-packages/django
>
> Normally I use /usr/bin, since local/bin doens't exist on Leopard
> (exept if you are using something like fink or macport)
> But I tried it to see if it works.
> 2. I create the directory : sudo mkdir /usr/local/bin
> 3. then symlink : sudo ln -sf /Library/Python/2.5/site-packages/django/
> bin/django-admin.py /usr/local/bin/django-admin.py
>
> it works. /usr/local/bin is already in your path.
>
> Francis
>
> On May 7, 6:46 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> > Hello everyone,
> >
> > I'm setting up a dev environment on a co-worker's Mac running 10.5.2
> >
> > I have Django cehcked out from trunk, and symlinked into Python 2.5.2.
> > I can successfully import Django from within a Python terminal
> > session.
> >
> > I have django-admin.py symlinked from the trunk checkout to /usr/local/
> > bin.
> >
> > When I try to execute: django-admin.py startproject foo, I get an
> > error saying:
> > django-admin.py: command not found
> >
> > I have added /usr/local/bin to my .bash_profile, resourced, and
> > restarted, but still no dice. Anyone have any ideas on what I did
> > wrong? I've doen this many times, just not on 10.5.
> >
> > TIA,
> > Brandon
> >
>


-- 
Shane Emmons
E: [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
-~--~~~~--~~--~--~---



help with limit_choices_to

2008-05-08 Thread Matias Surdi

Hi.

I've the following model:

class ExamAttributeCalification(models.Model):
exam_result = models.ForeignKey(ExamResult, 
edit_inline=models.TABULAR, num_in_admin=1)
exam_attribute = 
models.ForeignKey(ExamAttribute,limit_choices_to={"exam__id":1})
 calification = models.IntegerField(core=True)


As you can see, in the last line I've a hardcoded "1". This id should be 
taken dynamically from exam_result.exam.id model attribute.

How could I accomplish this?

Thanks for your 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: django-admin.py not working on OS X 10.5

2008-05-08 Thread Francis

It works without problem here.

1. I copy my trunk into the default python site-package /Library/
Python/2.5/site-packages/django

Normally I use /usr/bin, since local/bin doens't exist on Leopard
(exept if you are using something like fink or macport)
But I tried it to see if it works.
2. I create the directory : sudo mkdir /usr/local/bin
3. then symlink : sudo ln -sf /Library/Python/2.5/site-packages/django/
bin/django-admin.py /usr/local/bin/django-admin.py

it works. /usr/local/bin is already in your path.

Francis

On May 7, 6:46 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm setting up a dev environment on a co-worker's Mac running 10.5.2
>
> I have Django cehcked out from trunk, and symlinked into Python 2.5.2.
> I can successfully import Django from within a Python terminal
> session.
>
> I have django-admin.py symlinked from the trunk checkout to /usr/local/
> bin.
>
> When I try to execute: django-admin.py startproject foo, I get an
> error saying:
> django-admin.py: command not found
>
> I have added /usr/local/bin to my .bash_profile, resourced, and
> restarted, but still no dice. Anyone have any ideas on what I did
> wrong? I've doen this many times, just not on 10.5.
>
> TIA,
> Brandon
--~--~-~--~~~---~--~~
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: Newbie

2008-05-08 Thread Cesar Mojarro
hey us it cool if i tell you that im a newby too

On 5/5/08, Rajath Stanley D'Souza <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> I'm new to this whole area of web development. New to Django, Python, et
> al. I've only done some C,C++ coding for mobile phones before, but have a
> need to get into it now. Specifically planning on a creating a website that
> caters to PC and different devices like mobile phones, PDAs, etc. I have
> briefly evaluated a few CMSs and web frameworks, and overall, Django (
> djangoproject.com) seems very promising. I have a few questions I'm
> interested to find out before I get too deep into my studies of Python and
> Django.
>
> - Is it possible to create WML files (or for that matter any customised
> output that is not out there) easily? Especially by way of XML/XSLT.
> - If so, are there many standard templates that can be downloaded and
> customised?
> - Is there an IDEs that can be used for development?
> - Given my basic needs, do you think Django is good, or some other tech is
> better?
>
> Thanks,
> Rajath
>
> >
>

--~--~-~--~~~---~--~~
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: beware: make-messages is file extension sensitive

2008-05-08 Thread afro

Hi Omar,

Your message saved my day, I didn't think it would be because of such
a simple reason that make-messages.py omits my template files. I
actually just opened make-messages.py and changed '.html' to '.htm' in
two places, and that solved it. I just have to watch out the next time
I do an update, I guess.

Cheers,
Ulas

On Apr 30, 2:48 pm, omat <[EMAIL PROTECTED]> wrote:
> And ...
>
> If you would like to add a few words to the translation, like menu
> items, etc. without going into views and database, donotput them
> into the .po file directly. They will be commented out each time you
> run make-messages. Also there can be duplications that will result in
> errors.
>
> More maintainable (though hacky) way is to create a template file such
> as translation.html and put the strings to betranslatedinto that
> file such as:
>
> {% load i18n %}
> {% trans "Home page" %}
> {% trans "Continue" %}
>
> On Apr 30, 3:14 pm, omat <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I was wondering why my emailtemplateswerenotgettingtranslated. It
> > took me hours before I check the bin/make-messages.py and figure out
> > that only some files, depending on their extensions, aretranslated.
>
> > I thought make-messageswereworking in more django-aware manner and
> > inspects the projects (settings, models, views, etc) to find related
> > files and extract text to betranslated.
>
> > The way it actually is is more simple and straight-forward, so it is
> > quite ok. But dependency on file extension (especially fortemplates)
> > was something I wouldn't expect.
>
> > Regards,
> > omat
--~--~-~--~~~---~--~~
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: A twist on cross importing models

2008-05-08 Thread Matthias Kestenholz

Hey,

I might have some ideas now. I have not understood the problem earlier.

On Wed, 2008-05-07 at 12:52 +0200, Christopher Mutel wrote:
> Hello all-
> 
> I have tried a couple of tips found on the list to solve my problem
> with circular model imports, but with no lucks. Here is my basic
> schema:
> 
> #foo/models.py
> 
> from bar.models import Formula
> 
> class Variable(models.Model):
>   amount = models.FloatField(null=True)
>   is_formula = models.BooleanField(default=False)
>   formula = models.OneToOneField(Formula, null=True,
> related_name="variable_formula")
> 
>   def get_amount(self):
> if self.is_formula:
>   return self.formula.evaluate()
> else:
>   return self.amount
> 
> #bar/models.py
> 
> from foo.models import Variable
> 
> class Formula(models.Model):
>   formula = models.TextField() # Where formula is a text string like
> 'var:1337*var:42', and the numbers are id numbers.
> 
>   def calculate(self):
> # re stuff
> for each_found_variable in groups(): # Simplified to show process
> - this obviously doesn't work.
>   raw_string.append(Variable.objects.get(id=this_id).get_amount())
> return eval(raw_string, stuff_to_make_eval_safe)
> 
> In this case, the circular reference occurs only in a method of the
> class - I don't know if this makes a difference. How can I structure
> my import statements so that this is possible? I should note that
> there are more than one variable, so that combining everything into
> one models file is not really possible (and doesn't really address the
> chicken/egg problem either).
> 
> I thought I saw a recent svn commit that addressed this problem, but
> can't find it now.
> 
> Any help would be greatly appreciated?
> 

The commit you refer to might be something from the now merged qs-rf
branch, where you can specify models from other django applications with
a new syntax like ForeignKey('app.Variable')

I can think of two methods of loading Variable inside your calculate
function:

- Write the import statement in the function instead of writing it at
the top of the module.
- Use django.db.models.loading.get_model('app', 'Variable')

I hope that helps,

Matthias


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