Re: Returning values from calculations done by custom methods in models

2012-02-18 Thread Gchorn
Whoops, wow that really was basic Python. Sorry for the spam; of course I know there's a difference between calling a method and calling an attribute...how embarassing. =) Thanks for your help Anssi. Also thanks for not adding, ", you moron!" to the end of each sentence... On Feb 19, 9:47 am,

Re: Returning values from calculations done by custom methods in models

2012-02-18 Thread akaariai
On Feb 19, 3:38 am, Gchorn wrote: > Hello All, > > So in my models.py file, I have: > > class Player(models.Model): >         team = models.ForeignKey(Team) >         first_name = models.CharField(max_length=100) >         last_name = models.CharField(max_length=100) >  

Returning values from calculations done by custom methods in models

2012-02-18 Thread Gchorn
Hello All, So in my models.py file, I have: class Player(models.Model): team = models.ForeignKey(Team) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) gp = models.IntegerField(max_length=2) #games played mp =

Re: Script to call loaddata on multiple fixtures

2012-02-18 Thread LJ
Thanks, Dennis. Some of the fixtures are order dependent. I will have to do some more research on how to use glob.glob() and spawn. For now, just adding the list of python loaddata commands to a shell script seem to work great. Thanks again for the info! L J On Feb 18, 4:33 pm, Dennis Lee Bieber

Re: Script to call loaddata on multiple fixtures

2012-02-18 Thread LJ
That worked great. I haven't done much shell scripting, but it was easier than I thought. Thanks, Shawn! L J On Feb 18, 9:46 am, LJ wrote: > I have quite a number of fixtures that I call loaddata to insert > fixtures into my sqlite database using the following syntax: > >

Re: Django with fastcgi: hangs

2012-02-18 Thread akaariai
On Feb 19, 12:58 am, pistacchio wrote: > I'm trying to run Django with fastcgi. With runserver I've already > tested that the site works fine in production. When I run > >     python manage.py runfcgi host=127.0.0.1 port=9500 > > the daemon runs, but every call just hangs,

Re: Unable to open database file

2012-02-18 Thread akaariai
On Feb 18, 11:24 pm, "j...@jsdey.com" wrote: > I'm another newbe and need you patient consideration. > > I've worked my way through the polls tutorial.  Thinks seem to be > working with django server.  When I use Django/Wsgi I vote from an > external site but django is unable to

Re: Testing: Fixtures vs Factories vs ???

2012-02-18 Thread Alvaro
Hello, You can try django-pyxtures [1] to generate data for running tests. It's simply and clear. It also has an option to autogenerate data for your models. [1] https://github.com/igav/django-pyxtures On Feb 17, 11:16 am, Paolo wrote: > Hi folks, > > I've been coding away

Django with fastcgi: hangs

2012-02-18 Thread pistacchio
I'm trying to run Django with fastcgi. With runserver I've already tested that the site works fine in production. When I run python manage.py runfcgi host=127.0.0.1 port=9500 the daemon runs, but every call just hangs, like this: pistacchio@amaterasu:~/sites/comesichiama$ python

error: could not post to database from apache2/wsgi

2012-02-18 Thread j...@jsdey.com
I posted an email that hasn't appeared yet. I went to #django and my problem is solved with the help received. I changed permissions on database file and parent directory. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Unable to open database file

2012-02-18 Thread j...@jsdey.com
I'm another newbe and need you patient consideration. I've worked my way through the polls tutorial. Thinks seem to be working with django server. When I use Django/Wsgi I vote from an external site but django is unable to open database from the line selected_choice.save(). The error message

Re: Error on cascade deletion OneToOneField link with django-pyodbc backend

2012-02-18 Thread akaariai
>From the looks of it, it seems MSSQL isn't following the standard regarding null equality in unique indexes. You might be interested in: http://connect.microsoft.com/SQLServer/feedback/details/299229/change-unique-constraint-to-allow-multiple-null-values Depending on your server version you

Re: Script to call loaddata on multiple fixtures

2012-02-18 Thread Shawn Milochik
Why not just put all those manage.py commands in a shell script and run that? -- 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

Error on cascade deletion OneToOneField link with django-pyodbc backend

2012-02-18 Thread Eugeny Klementev
I have two models with OneToOne relation class Unit (models.Model): label = models.CharField(max_length=32) datastream = models.OneToOneField ('Datastream', null=True, blank=True, related_name="unit") ... class Datastream (models.Model): idd = models.AutoField(primary_key=True,

Re: Starting a new Python blog

2012-02-18 Thread Kevin
Hello Everyone! Great news! The blog's theme has been redone completely using help from Twitter's brilliant Bootstrap. The site is now much easier to navigate and find all the content with only 2 clicks from anywhere on the site(you don't even need to scroll). On top of the new site

Re: passing multiple query sets into a url pattern

2012-02-18 Thread Alfredo Alessandrini
Hi, I'm not sure that I've understand your question: url(r'^profile/(?P\d+)/(?P\d+)$', ..) and now you can use the variable var_1 and var_2 in your function. Alfredo 2012/2/18 Stanwin Siow > Hello, > > I want to find out if there is anyway to pass two

Script to call loaddata on multiple fixtures

2012-02-18 Thread LJ
I have quite a number of fixtures that I call loaddata to insert fixtures into my sqlite database using the following syntax: python ./manage.py loaddata ./apps/addresses/fixtures/cities.json python ./manage.py loaddata ./apps/addresses/fixtures/addresses.json ... I would like to create a script

Re: Creating a hospital erp (hospital management) in Django

2012-02-18 Thread Marc Aymerich
On Sat, Feb 18, 2012 at 2:52 PM, Saadat wrote: > Alec, I've tried including this css file everywhere, but it doesn't show up > anywhere. What exactly do i do with it to include this script on any page, > say index. i tried doing it through html as well as django. I don't know

Re: Creating a hospital erp (hospital management) in Django

2012-02-18 Thread Saadat
Alec, I've tried including this css file everywhere, but it doesn't show up anywhere. What exactly do i do with it to include this script on any page, say index. i tried doing it through html as well as django. I don't know what I'm doing wrong? On 18-Feb-2012, at 6:49 PM, Alec Taylor wrote:

Re: Creating a hospital erp (hospital management) in Django

2012-02-18 Thread Alec Taylor
http://divitodesign.com/css/how-to-dropdown-css-menu/ When you're doing template stuff, read: - HTML - CSS - JS - Python tutorials. Also, get a book. The questions you are asking are textbook level questions. On Sat, Feb 18, 2012 at 11:53 PM, Saadat wrote: > Hello all > Can

Re: Creating a hospital erp (hospital management) in Django

2012-02-18 Thread Saadat
Hello all Can someone guide me to create a drop down menu (single-level).. i need to put this menu in a header file that will be included in every page. A bit of code and some explanation is required. tried searching on the Internet, but couldn't find anything. thanks a lot On Feb 17, 7:50 am,