Re: Easy question to the Auth System

2012-09-16 Thread WoHinDu
I love Django. Sometimes it's a bit dificult to find what you need, but if you find it, it's always simpel. If someone have the same problem just add filter_horizontal or filter_vertical thats all! Am Sonntag, 16. September 2012 18:01:34 UTC+2 schrieb WoHinDu: > > Hey, > > sorry for my bad engl

Re: Easy question to the Auth System

2012-09-16 Thread Thomas Orozco
Hi, Use ManyToMany if one event can relate to *several* Users Use ForeignKey if one event relates to a *single* User Cheers, Thomas 2012/9/16 WoHinDu : > Hey, > > sorry for my bad englisch. Englisch is not my nativ language, but i hope you > can understand it and sorry for the stupid question b

Easy question to the Auth System

2012-09-16 Thread WoHinDu
Hey, sorry for my bad englisch. Englisch is not my nativ language, but i hope you can understand it and sorry for the stupid question but i'm new at Django. I have a table called "Event" in this Table i store some events with title, date/time an a description. But how can i "connect" this ev

Re: Easy question (I hope)

2011-10-12 Thread Tom Evans
On Fri, Oct 7, 2011 at 4:25 PM, Shawn Milochik wrote: > On Fri, Oct 7, 2011 at 11:15 AM, Tom Evans wrote: >> >> I do this a lot, and haven't found any problems with doing so. My main >> app has no models.py, but has models/{__init__,foo}.py, and it is >> still found quite happily by syncdb, south

Re: Easy question (I hope)

2011-10-12 Thread Tom Evans
On Fri, Oct 7, 2011 at 8:31 PM, Oscar Carballal wrote: > I was watching this thread for a while now, and I've got a question. > > What is the reason to split the models.py file? I mean, I'm currently > working on a django project, and the models are pretty "simple" (I > usually split them into app

Re: Easy question (I hope)

2011-10-07 Thread Javier Guerra Giraldez
On Fri, Oct 7, 2011 at 2:31 PM, Oscar Carballal wrote: > Should I split it? Why? you already have. splitted in apps, which is often the best way. but, since most of the 'business methods' code should be in the model (and not in the views as many PHP-refugees tend to do), sometimes a models.py

Re: Easy question (I hope)

2011-10-07 Thread Oscar Carballal
I was watching this thread for a while now, and I've got a question. What is the reason to split the models.py file? I mean, I'm currently working on a django project, and the models are pretty "simple" (I usually split them into apps) the biggest models file has five or six models in the same fil

Re: Easy question (I hope)

2011-10-07 Thread Javier Guerra Giraldez
On Fri, Oct 7, 2011 at 1:06 PM, bcrem wrote: >  I don't think this format is > S eccentric that a python purist who comes along later to maintain > my code can't figure it out pretty quickly. nobody said that. what we're saying is: 1- one-model/one-file isn't a goal by itself. nothing wron

Re: Easy question (I hope)

2011-10-07 Thread bcrem
Thanks Bill F - caught my import error when I tried the second method. Just went back & tried the models/ approach; as long as I import my classes to a models.py file and add 'models' to INSTALLED_APPS in settings.py syncdb works fine. So basically I'm creating a models 'app' without any views to

Re: Easy question (I hope)

2011-10-07 Thread Javier Guerra Giraldez
On Fri, Oct 7, 2011 at 10:57 AM, Calvin Spealman wrote: > On Fri, Oct 7, 2011 at 10:39 AM, bcrem wrote: >> Howdy, >> >> I come from a C/C++ background, getting into some django/python now. >> I'm used to a one-class/one-file paradigm, and don't much like >> sticking all the models for an app in m

Re: Easy question (I hope)

2011-10-07 Thread Bill Freeman
I think that you want: from poll import * in dummy/models/__init__.py On Fri, Oct 7, 2011 at 11:30 AM, bcrem wrote: > The separate models/ directory bit didn't work for me; maybe I'm not > understanding what you mean exactly?  Here's what I did... > > $ django-admin.py startproject dummy > $

Re: Easy question (I hope)

2011-10-07 Thread Calvin Spealman
On Fri, Oct 7, 2011 at 10:39 AM, bcrem wrote: > Howdy, > > I come from a C/C++ background, getting into some django/python now. > I'm used to a one-class/one-file paradigm, and don't much like > sticking all the models for an app in models.py.  It's a minor thing, > I know... > > Is there any way

Re: Easy question (I hope)

2011-10-07 Thread bcrem
The separate models/ directory bit didn't work for me; maybe I'm not understanding what you mean exactly? Here's what I did... $ django-admin.py startproject dummy $ cd dummy/ $ mkdir models $ vi settings.py ...filled in my db info... $ cd models $ vi poll.py $ cat models/poll.py from django.db

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
On Fri, Oct 7, 2011 at 11:15 AM, Tom Evans wrote: > I do this a lot, and haven't found any problems with doing so. My main > app has no models.py, but has models/{__init__,foo}.py, and it is > still found quite happily by syncdb, south, the admin interface, the > app template loader etc. > > Is t

Re: Easy question (I hope)

2011-10-07 Thread Tom Evans
On Fri, Oct 7, 2011 at 3:57 PM, Shawn Milochik wrote: > Tom, > The 'magic' I was referring to was the check for the existence of a > 'models.py,' thus preventing you from replacing it with a models directory > containing __init__.py. That's what a Pythonista would normally do in this > case. That

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
Tom, The 'magic' I was referring to was the check for the existence of a 'models.py,' thus preventing you from replacing it with a models directory containing __init__.py. That's what a Pythonista would normally do in this case. That 'magic' requires you to import the things from models.py instead

Re: Easy question (I hope)

2011-10-07 Thread Tom Evans
On Fri, Oct 7, 2011 at 3:43 PM, Shawn Milochik wrote: > Make as many files as you want, and make sure you import their classes in > models.py so they get picked up by syncdb. > Normally, to do something like this you'd replace the file (in this case > models.py) with a folder named 'models' contai

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
On Fri, Oct 7, 2011 at 10:47 AM, Chris Czub wrote: > Shawn -- what do you recommend instead? A friend and I recently had > this debate. His suggestion was to split off as much behavior into > smaller apps with only a handful of models in the models.py as > possible, but I said that if it's not re

Re: Easy question (I hope)

2011-10-07 Thread Chris Czub
Shawn -- what do you recommend instead? A friend and I recently had this debate. His suggestion was to split off as much behavior into smaller apps with only a handful of models in the models.py as possible, but I said that if it's not reusable, it shouldn't be an app. I still haven't found a solut

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
Make as many files as you want, and make sure you import their classes in models.py so they get picked up by syncdb. Normally, to do something like this you'd replace the file (in this case models.py) with a folder named 'models' containing a file called __init__.py, and import all the additional

Re: Easy question (I hope)

2011-10-07 Thread Xavier Ordoquy
Hi, Create a models directory and have an __init__.py file within. Put the models you want to import in that file and you are good to go. Regards, Xavier. Le 7 oct. 2011 à 16:39, bcrem a écrit : > Howdy, > > I come from a C/C++ background, getting into some django/python now. > I'm used to a o

Easy question (I hope)

2011-10-07 Thread bcrem
Howdy, I come from a C/C++ background, getting into some django/python now. I'm used to a one-class/one-file paradigm, and don't much like sticking all the models for an app in models.py. It's a minor thing, I know... Is there any way to seperate out these classes, and still have syncdb pick the

Re: Easy question

2009-08-13 Thread Margie
When you pass in an instance, when you later use the form.save() method, it will save any new data back to that instance. IE, if you pass in both an instance and POST data, it will basically give you a form that merges the instance data with the POST data, and now you can just save back to the in

Easy question

2009-08-13 Thread George Laskowsky
Hi, I was wondering about forms (and modelforms), what is the difference between passing it an object (in the 'instance' attribute) and passing it an dictionary with the same data (in the 'initial' attribute)? Thanks -- George Laskowsky Ziguilinsky --~--~-~--~~~---

Re: Very Easy Question

2008-01-10 Thread koenb
Especially take note of the hint to use junction.exe [1]. It allows you to use kind of like symlinks on windows. Especially interesting if you use different versions and branches. Koen [1] http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx --~--~-~--~~--

Re: Very Easy Question

2008-01-10 Thread MariusB
I had the same problem on Vista with v0.96.1... Following Richards solution, I've copied the django subfolder into C: \Pythong25\lib\site-packages\ and I get no error for import django Are there any problems for this solution or is this all there is to it? On Dec 20 2007, 9:06 pm, "Richard

Re: Very Easy Question

2007-12-30 Thread Trev
Thanks Malcom for clarifying that. I suspected there was some sort of bug so I installed the subversion instead of the official release and I now have everything up and running. Also, I am now using a Postgre database and I'm very impressed so far. Thanks to everone who replied. On Dec 22, 4:32 

Re: Very Easy Question

2007-12-21 Thread Malcolm Tredinnick
On Wed, 2007-12-19 at 12:55 -0800, Trev wrote: > Hi, This should take 2 seconds for an experience Django user. > I'm trying to install Django on windows XP. I've installed python 2.5 > and MySQL with MySQLdb as the interface. > However when I try installing django from DOS I get this error > > C

Re: Very Easy Question

2007-12-20 Thread Richard D. Worth
Don't know why you're getting that (I've never tried 0.96, only svn), but the easiest thing is just to copy the django subfolder into C:\Pythong25\lib\site-packages\ To test that it works, enter a python prompt and type: >>> import django >>> - Richard On Dec 19, 2007 3:55 PM, Trev <[EMAIL PROTE

Re: Very Easy Question

2007-12-20 Thread Alexey Moskvin
Looks strange, I have never used "install.py" for WinXP, see this tutorial: http://thinkhole.org/wp/django-on-windows/. On 19 дек, 23:55, Trev <[EMAIL PROTECTED]> wrote: > Hi, This should take 2 seconds for an experience Django user. > I'm trying to install Django on windows XP. I've installed py

Very Easy Question

2007-12-19 Thread Trev
Hi, This should take 2 seconds for an experience Django user. I'm trying to install Django on windows XP. I've installed python 2.5 and MySQL with MySQLdb as the interface. However when I try installing django from DOS I get this error C:\Django-0.96.1>setup.py install running install running bui