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
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
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
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
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
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
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
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
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
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
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
> $
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
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
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
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
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
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
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
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
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
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
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
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
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
--~--~-~--~~~---
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
--~--~-~--~~--
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
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
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
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
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
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
31 matches
Mail list logo