Re: Default value for boolean field

2006-06-24 Thread Russell Keith-Magee

On 6/25/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
> Interesting - I get the same behaviour. I've opened ticket #2231 for
> this problem - I'll look into it.

Ok - I take that back - I don't get the same behaviour.

True - the SQL doesn't get a default clause. This is by design.
Default values are created python-side when the python object is
created.

However, I have no difficulty creating an object without specifying a
responded= clause.

Can you elaborate on the error message you are receiving?

Side note - When validating your report, I got an SQL error too - but
the problem wasn't with the default clause - it was with the SQL
cursor. If the SQL cursor gets messed up because of a previous error,
you might be getting misleading error reports.

What do you get if you run the following in the django shell
(substituting for your project names as appropriate)?:

% ./manage.py shell
>>> from datetime import datetime
>>> from testproject.mytest.models import Response
>>> r = Response(email="[EMAIL PROTECTED]", code="xxx",
response_ts=datetime.now(), a1="asdf")
>>> r.save()

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



Re: Default value for boolean field

2006-06-24 Thread Russell Keith-Magee

Interesting - I get the same behaviour. I've opened ticket #2231 for
this problem - I'll look into it.

> I'm using Django-0.95-py2.3.egg.

Where did you get a 0.95 egg? v0.95 hasn't been released - it will be
the version number of the next official release, but that hasn't
happened yet.

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



Re: Model vanishes from Admin

2006-06-24 Thread arthur debert

Hi Russel.

Thanks for the patch. I am sure this one will save newbies a few hours
of starting blankly at the screen.

cheers
Arthur


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



Re: Model vanishes from Admin

2006-06-24 Thread Russell Keith-Magee

On 6/24/06, arthur debert <[EMAIL PROTECTED]> wrote:

> this one got me stuck for hours (grin).
> if your INSTALLED_APPS is right and your admin inner class too, you
> probably have an error on an import on your model class.

FYI - To help avoid this problem in the future, I have just committed
a patch (r3201) that will cause model validation to fail if there is
an error in a model that is listed in INSTALLED_APPS.

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



Re: how can I build this query?

2006-06-24 Thread nkeric

Scott Anderson wrote:
> You could also do this:
>
> ContentType.objects.filter(app_label__exact='aiyo',
> model__in=('content', 'product'))
>
> which is more concise and may treat the query optimizer in your database
> better.

hi Scott,

this is great! however, I'm having another problem, let me put it
straight:

I'm building a generic purpose bookmark app, which could be used to:

1. bookmark models in 'bookmarkable_list' of a django site
2. bookmark external urls

I built the 'bookmarkable_list' from settings.py in the following way:

== settings.py ==

BOOKMARKABLE_APP_MODEL_LIST = ['aiyo.content', 'aiyo.product',
'comments.comment', 'comments.freecomment']

== bookmark.py ==

from agv.settings import BOOKMARKABLE_APP_MODEL_LIST
q = Q()
for app_model in BOOKMARKABLE_APP_MODEL_LIST:
app_label, model = app_model.split('.')
q = q | (Q(app_label__exact=app_label) & Q(model__exact=model))

BOOKMARKABLE_DJANGO_CONTENT_TYPE_ID_LIST = [str(d['id']) for d in
ContentType.objects.filter(q).values('id')]

any advice to make it better?

Regards,

- Eric


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



Re: Simple Model Syntax Errors

2006-06-24 Thread Malcolm Tredinnick

On Sun, 2006-06-25 at 00:18 +, Scott McCracken wrote:
> Don,
> 
> Thank you for that tip - it does have something to do with the
> indenting. I am a bit confused as to why that is happening as I was
> simply trying to follow the example which shows code like:
> 
> class Poll(models.Model):
> # ...
> class Admin:
> pass
> 
> I am using TextMate on OS X and making sure that my file type is set to
> 'python'. I am using tab to indent code, is there a good reference to
> indenting python code on the web? Thanks!

PEP 8 is the more-or-less canonical reference, since it is what is used
in the standard Python libraries (see [1]). Django tends to follow the
guidelines in there, in particular, indenting is done with four spaces
(not tabs). So that is almost certainly your problem in this case.

[1] http://www.python.org/dev/peps/pep-0008/

Regards,
Malcolm


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



Re: How do I import a module in a subdirectory of an app?

2006-06-24 Thread James Bennett

On 6/24/06, Andrew <[EMAIL PROTECTED]> wrote:
> import mysite.myapp.testdir.foo  doesn't work. Why?

Via IRC, we were able to help Andrew figure out he needed to add an
__init__.py in the directory he wanted to import from; roughly
speaking, this tells Python that the directory is a module from which
thins can be imported.

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

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



Re: Simple Model Syntax Errors

2006-06-24 Thread Don Arbow
On Jun 24, 2006, at 11:18 AM, Scott McCracken wrote:from webmules.polls.models import Poll, Choice Traceback (most recent call last):   File "", line 1, in ?   File "/Users/swm/Sites/webmules/../webmules/polls/models.py", line 8     def __str__(self):     ^ When you get a syntax error where it's pointing to the beginning of a line, make sure that your Python indenting is correct. Note that your def does not line up with the field definitions above it.Don
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django users" group.  To post to this group, send email to django-users@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---



How do I import a module in a subdirectory of an app?

2006-06-24 Thread Andrew

Say I have a file structure like this:

mysite
myapp
__init__.py
models.py
views.py
testdir
foo.py


import mysite.myapp.testdir.foo  doesn't work. Why?

Is testdir not in my pythonpath?

Am I missing something?

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



Re: Simple Model Syntax Errors

2006-06-24 Thread Scott McCracken

Sorry, I didn't know this forum doesn't accept HTML in it's message
bodies. Hopefully my message is still readable.


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



Simple Model Syntax Errors

2006-06-24 Thread Scott McCracken

This is my second time going through the http://www.djangoproject.com/documentation/tutorial1/;>Django
tutorials. The first time I ran through the whole process on my
dreamhost server without any errors. This time I'm using the local
development server on my computer (Mac OS X v10.4.6 / Python 2.4)

In http://www.djangoproject.com/documentation/tutorial1/;>tutorial
one, you are to define a simple Poll model as well as a Choice
model. Everything works fine (able to access and save records via the
API) until I try to add a __str__() method to represent the model.


from django.db import models

class Poll(models.Model):
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('Date Published')

def __str__(self):
return self.question


Once I add this simple representation and start the Python Interactive
Prompt I get syntax errors (prooject name is webmules):


>>> from webmules.polls.models import Poll, Choice
Traceback (most recent call last):
  File "", line 1, in ?
  File "/Users/swm/Sites/webmules/../webmules/polls/models.py", line 8
def __str__(self):
^
SyntaxError: invalid syntax
>>>


What's odd is if I remove the method and add an inner Admin() class,
like:


from django.db import models

class Poll(models.Model):
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('Date Published')

class Admin:
pass


I get syntax errors when I start the development server:


Django version 0.95 (post-magic-removal), using settings
'webmules.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[24/Jun/2006 13:21:02] "GET /admin/ HTTP/1.1" 200 2753
Validating models...
Unhandled exception in thread started by 
Traceback (most recent call last):
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py",
line 992, in inner_run
validate()
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py",
line 959, in validate
num_errors = get_validation_errors(outfile)
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/core/management.py",
line 816, in get_validation_errors
for cls in models.get_models(app):
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/db/models/loading.py",
line 43, in get_models
app_list = get_apps() # Run get_apps() to populate the _app_list
cache. Slightly hackish.
  File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/db/models/loading.py",
line 20, in get_apps
mod = __import__(app_name, '', '', ['models'])
  File "/Users/swm/Sites/webmules/../webmules/polls/models.py", line 8
class Admin:
^


If I don't have the  __str__() method the API works great, if I don't
define the inner Admin class my development server starts without any
problems. It seems like anything I add to my models breaks everything
else. Has anyone ever seen anything like that?

Apologies for the long message, just wanted to be thorough. Thanks 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
-~--~~~~--~~--~--~---



Re: how can I build this query?

2006-06-24 Thread Scott Anderson

Not a problem, Eric, glad to be of help.

You could also do this:

ContentType.objects.filter(app_label__exact='aiyo',
model__in=('content', 'product'))

which is more concise and may treat the query optimizer in your database
better.

Regards,
-scott


On Sat, 2006-06-24 at 17:00 +, nkeric wrote:
> >>> ContentType.objects.filter((Q(app_label__exact='aiyo') & 
> >>> Q(model__exact='content')) | (Q(app_label__exact='aiyo') & 
> >>> Q(model__exact='product')))
> [, ]
> >>> c.queries [{'time': '0.000', 'sql': 'SELECT 
> >>> "django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
> >>>  FROM "django_content_type" WHERE ((("django_content_type"."app_label" = 
> >>> aiyo AND "django_content_type"."model" = content) OR 
> >>> ("django_content_type"."app_label" = aiyo AND 
> >>> "django_content_type"."model" = product))) ORDER BY 
> >>> "django_content_type"."name" ASC'}]
> >>>
> 
> wow! that works, perfect! big thanks to Scott, you've been a great
> help!
> 
> Regards,
> 
> - eric
> 
> 
> > 


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



Re: how can I build this query?

2006-06-24 Thread nkeric

James Bennett wrote:
> Also keep in mind that as a query gets more and more complex, the odds
> of any ORM syntax being able to express it cleanly and concisely get
> smaller and smaller; there will be times when it'll be faster and
> easier (well, easier so long as you know SQL) to drop down into SQL to
> execute exactly the query you want.

hi James,

thanks a lot for your reminding :) I used to check django's actual
queries by using the django shell before I apply it to my code. Me, a
so call "perfectionist" too :p

Regards,

- Eric


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



Re: Same name on project and app causes error

2006-06-24 Thread Adrian Holovaty

On 6/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Maybe there should be a check in django-admin.py startapp  if the
> project i am in has the same name, or a better errormessage.

Hi Kim,

"django-admin.py startapp" does indeed throw an error if the app has
the same name as the project. See line 685 of
django/core/management.py (in the latest trunk).

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

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



Default value for boolean field

2006-06-24 Thread jacob

Hi,

I'm working up a simple, one-off web-based survey (so pls don't knock
me for not normalizing).

Here's my model:

class Response(models.Model):
   email = models.EmailField(maxlength=24)
   code = models.CharField(maxlength=24)
   response_ts = models.DateTimeField(null=True)
   responded = models.BooleanField(default=False)
   a1 = models.CharField(maxlength=24,null=True)
   a2 = models.CharField(maxlength=24,null=True)
   a3 = models.CharField(maxlength=24,null=True)

The postgresql table that gets created does not have a default value
for the "responded" column and I get a sql exception if I don't
manually set responded to 'f' when I save each new Response object.

I'm using Django-0.95-py2.3.egg.

Thanks!

jacob


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



Re: how can I build this query?

2006-06-24 Thread James Bennett

On 6/24/06, Scott Anderson <[EMAIL PROTECTED]> wrote:
> ContentType.objects.filter(
>(Q(app_label__exact='aiyo') & Q(model__exact='content')) |
>(Q(app_label__exact='aiyo') & Q(model__exact='product'))
>)

Also keep in mind that as a query gets more and more complex, the odds
of any ORM syntax being able to express it cleanly and concisely get
smaller and smaller; there will be times when it'll be faster and
easier (well, easier so long as you know SQL) to drop down into SQL to
execute exactly the query you want.


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

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



Re: how can I build this query?

2006-06-24 Thread nkeric

>>> ContentType.objects.filter((Q(app_label__exact='aiyo') & 
>>> Q(model__exact='content')) | (Q(app_label__exact='aiyo') & 
>>> Q(model__exact='product')))
[, ]
>>> c.queries [{'time': '0.000', 'sql': 'SELECT 
>>> "django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
>>>  FROM "django_content_type" WHERE ((("django_content_type"."app_label" = 
>>> aiyo AND "django_content_type"."model" = content) OR 
>>> ("django_content_type"."app_label" = aiyo AND "django_content_type"."model" 
>>> = product))) ORDER BY "django_content_type"."name" ASC'}]
>>>

wow! that works, perfect! big thanks to Scott, you've been a great
help!

Regards,

- eric


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



Re: how can I build this query?

2006-06-24 Thread Scott Anderson

Try:

ContentType.objects.filter(
   (Q(app_label__exact='aiyo') & Q(model__exact='content')) | 
   (Q(app_label__exact='aiyo') & Q(model__exact='product'))
   )

Regards,
-scott


On Sat, 2006-06-24 at 09:06 -0700, nkeric wrote:
> sqlite> select * from django_content_type where (app_label='aiyo' and
> model='content') or (app_label='aiyo' and model='product');
> 17|Product|aiyo|product
> 24|Content|aiyo|content
> 
> hi all,
> 
> I've tried:
> 
> ContentType.objects.filter(Q(app_label__exact='aiyo',
> model__exact='content') | Q(app_label__exact='aiyo',
> model__exact='product'))
> 
> result in:
> 
> SELECT
> "django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
> FROM "django_content_type" WHERE (("django_content_type"."app_label" =
> aiyo OR "django_content_type"."model" = content OR
> "django_content_type"."app_label" = aiyo OR
> "django_content_type"."model" = product)) ORDER BY
> "django_content_type"."name" ASC
> 
> it just OR'd everything together;
> 
> and:
> 
> ContentType.objects.filter(Q(app_label__exact='aiyo',
> model__exact='content'), Q(app_label__exact='aiyo',
> model__exact='product'))
> 
> which ends with:
> 
> SELECT
> "django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
> FROM "django_content_type" WHERE (("django_content_type"."app_label" =
> aiyo AND "django_content_type"."model" = content AND
> "django_content_type"."app_label" = aiyo AND
> "django_content_type"."model" = product)) ORDER BY
> "django_content_type"."name" ASC
> 
> now it AND'd everything :(
> 
> what I need is:
> 
> ...WHERE
> ("django_content_type"."app_label" = aiyo AND
> "django_content_type"."model" = content)
> OR
>  ("django_content_type"."app_label" = aiyo AND
> "django_content_type"."model" = product)...
> 
> how could I do that?
> 
> TIA :)
> 
> regards,
> 
> eric
> 
> 
> > 


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



how can I build this query?

2006-06-24 Thread nkeric

sqlite> select * from django_content_type where (app_label='aiyo' and
model='content') or (app_label='aiyo' and model='product');
17|Product|aiyo|product
24|Content|aiyo|content

hi all,

I've tried:

ContentType.objects.filter(Q(app_label__exact='aiyo',
model__exact='content') | Q(app_label__exact='aiyo',
model__exact='product'))

result in:

SELECT
"django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
FROM "django_content_type" WHERE (("django_content_type"."app_label" =
aiyo OR "django_content_type"."model" = content OR
"django_content_type"."app_label" = aiyo OR
"django_content_type"."model" = product)) ORDER BY
"django_content_type"."name" ASC

it just OR'd everything together;

and:

ContentType.objects.filter(Q(app_label__exact='aiyo',
model__exact='content'), Q(app_label__exact='aiyo',
model__exact='product'))

which ends with:

SELECT
"django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
FROM "django_content_type" WHERE (("django_content_type"."app_label" =
aiyo AND "django_content_type"."model" = content AND
"django_content_type"."app_label" = aiyo AND
"django_content_type"."model" = product)) ORDER BY
"django_content_type"."name" ASC

now it AND'd everything :(

what I need is:

...WHERE
("django_content_type"."app_label" = aiyo AND
"django_content_type"."model" = content)
OR
 ("django_content_type"."app_label" = aiyo AND
"django_content_type"."model" = product)...

how could I do that?

TIA :)

regards,

eric


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



Re: Symlink Error? Please help.

2006-06-24 Thread RajeshD

I would suggest that, before you attempt to setup Django with
Apache/FCGI, you try the built-in development server. It's faster to
get up and running with it and you will know quickly if anything is
wrong with your installation. With the Apache/FCGI setup, it would be
difficult to track down any problems as there would be many more
potential points of failure.

It looks like you have Django installed. You should start following the
main tutorials now. The best way to confirm the installation for you is
to see if you are able to create a simple project following the
tutorials and then do the built-in "python manage.py runserver". You
don't need to cd to the python path you mentioned in order to run this
command. You run it from your project's root directory.

Good luck!


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



Re: Symlink Error? Please help.

2006-06-24 Thread Scott McCracken

Thanks Rajesh, you were right on! The 'pwd' was the culprit and now I
know for future reference. Thank you so much.

One more UNIX question. According to the documentation to http://code.djangoproject.com/wiki/OsxFcgi;>Setup Django with
Apache 1.3 and FCGI I can check to see if Django is running
correctly by running 'python2.4 manage.py runserver' from the command
prompt.

To do this I need to 'cd' into:

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/django/conf/project_template

Is there anyway I can setup an alias so I can run this command from the
main prompt without having to traverse into that directory? Thanks in
advance!!


So now that the symlink is setup, how can I check to see if Django is
properly installed?
RajeshD wrote:
> I think it may have been the `pwd` in your original symlink command
> that caused the problem. That specific command requires you to be in
> /usr/local/src before you run it.
> 
> -Rajesh
> 
> [EMAIL PROTECTED] on IRC


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



Re: Symlink Error? Please help.

2006-06-24 Thread RajeshD

Open a terminal and check which version of Python you have (python -V).
Chances are that you are running 2.3. The instructions you tried above
assume 2.4.

You can get 2.4 for Mac from here: http://www.python.org/download/mac/
I am running Django with Python installed from the Universal Installer
Build on Tiger with no problems.


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



Re: Having many of one application.

2006-06-24 Thread Frankie Robertson

On 24/06/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> On Fri, 2006-06-23 at 17:58 +0100, Frankie Robertson wrote:
> > Please, is there any way of doing this? I've dumped the last approach,
> > I'm planning on using inclusion tags to query the database, but the
> > templates would still need to know the slug of the hostee's current
> > page. So generic views don't work because they don't know what the
> > blog_slug is, as it is I'm not replacing the generic views with my
> > own, not very DRY, but hey. To be honest I feel this is a bit of
> > failing in django and may file a bug, not sure how it would be
> > corrected to be honest though.
>
> Any time you want to pass extra information to a generic view that you
> cannot just pass in from the URLConf, call your own view function that
> works out the extra information and then calls the generic view as its
> last step. You can still use the generic views, but you do a little bit
> of pre-processing first to get the information you need (in this case,
> populating extra_context, but sometimes even working out a more
> complicated queryset to pass in).
>
> That is not a flaw in the generic views, since it is so easy to write
> the wrapper function and if Django accommodated every single
> customisation possibility in the generic views that would become very
> difficult to maintain and understand.
>
> So you would write
>
> def my_view(request, ):
> # ... work out whatever you need from the passed in params,
> etc.
> # Collect the information you need for passing to the
> generic
> # view and then just call it
>
> extra_context = {...}
>
> return list_detail(..., extra_context = extra_context)
>
> This is a very common pattern.

Thanks, that's great! I'll start using that.

I have another, smaller related problem with urls.
I can't do this
(r'^blogs/([_A-Za-z0-9-]+)/', include('bloghost.blog.urls')),
because then the captured bit after blogs doesn't go anywhere.
I have to do this:
..
(r'^blogs/([_A-Za-z0-9-]+)/', 'frontpage')),
(r'^blogs/([_A-Za-z0-9-]+)/feed/', 'rss')),
...

Which is fine really, more of an itch than anything else, but it'd be
nice to do it the Right Way(TM).

Thanks,
Frankie.

>
> Regards,
> Malcolm
>
>
> >
>

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



Re: Forein keys from application tables to Authentication tables

2006-06-24 Thread [EMAIL PROTECTED]

Yes this is exact what i was searching for. Thank you very much.

regards, Kim


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