Re: has more than 1 ForeignKey to

2008-11-10 Thread jd.strickler

Klaas,

When you create a Foreign Key to another model, Django also sets up
the "reverse relation".  If you specify more than one foreign key to
the same model, you must give different names for this reverse
relationship.

http://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects

js

On Nov 10, 3:50 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a UserProfile connected to auth.models.User using
>
>     user = models.ForeignKey(User, unique=True)
>
> Additionally, I'd like to connect users to each other with manager/
> managed hierarchical relationships, whereby everyone has one manager
> (except the big boss who has none):
>
>     manager = models.ForeignKey(User, blank=True,
> related_name='employees_userprofile_manager')
>
> My models fail to load with the exception:
>  has more than 1
> ForeignKey to 
>
> This doesn't seem logical to me at all: the above is a perfectly fine
> example of two foreign keys being meaningful. Why is this not possible
> and what is the workaround, or rather, the proper way to do this?
>
> I'm using Django 1.0.
>
> Any help is much appreciated.
>
> regards,
> Klaas van Schelven
--~--~-~--~~~---~--~~
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: Query

2008-10-22 Thread jd.strickler

It took about 15 seconds with Google to find these:

http://www.devshed.com/c/a/Python/Writing-CGI-Programs-in-Python/
http://www.cs.virginia.edu/~lab2q/lesson_7/
http://gnosis.cx/publish/programming/feature_5min_python.html

Anytime you find yourself asking for materials, Google first!  Then,
if you still have questions, use the mailing lists.  Otherwise it
looks like you're just too lazy to do your own research.

On Oct 22, 11:16 am, Anurag <[EMAIL PROTECTED]> wrote:
> Hello,
>
> It is actually that I want to develop a Graphical User Interface for
> submitting some jobs (presently doing it as command line interface
> only). I would like to use Python-CGI for it.
> I would be thankful if someone could suggest me some focused tutorial/
> book/web-link etc with regard to this.
>
> Thanking you once again.
> Regards.
>
> On Oct 22, 2:41 pm, bruno desthuilliers
>
> <[EMAIL PROTECTED]> wrote:
> > On 22 oct, 14:11, Anurag <[EMAIL PROTECTED]> wrote:
>
> > > Hello Gerard,
>
> > > Thank you so much for your suggestion. I have tried working in the
> > > direction suggested by you.
> > > The next step of difficulty that I find is that there are lot of
> > > materials available on the internet in this regard but I could not
> > > find some really good working examples and tutorials with respect to
> > > developing a Web-server using Python-CGI.
>
> > Why do you want to develop a web server ? Just use Apache.
--~--~-~--~~~---~--~~
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 crashes Python without traceback on Mac OS X (Release 1.0)

2008-10-19 Thread jd.strickler

Just as a heads up: if you have a 64-bit Intel chip running OS X

The cross-compiling/Universal Binary issue may come up to bite you (it
did me).  Apache runs in 64-bit mode while most of the system runs in
32-bit mode, meaning that every part of your Django stack has to be
compiled for both into a UB.

Specifically, I had to hack around with mod_python, Postgresql,
psycopg2, and python-ldap (for an LDAPBackend I wrote; not needed for
a vanilla Django setup).  Ccompiling this stuff correctly usually
means adding a few tags in the right file.

(Because I'm an idiot) this took me ~2 months to get right.  So, if
you solve your stack overflow issue and run into any of these, email
me and I'll send over the documentation I have.

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