Re: DATABASE in settings file not working

2012-02-17 Thread Detectedstealth
Ok it looks like there is an issue with my desktop. I did everything from scratch on my labtop (also running opensuse) and changes to the settings file now work On Feb 17, 9:05 pm, Detectedstealth wrote: > I am starting to wonder if it is an opensuse bug. I am thinking

passing multiple query sets into a url pattern

2012-02-17 Thread Stanwin Siow
Hello, I want to find out if there is anyway to pass two querysets into a url pattern. i have this url pattern at the moment. UserProfile_info = { "queryset" : UserProfile.objects.all(), "extra_context" : {"keyword_list" : Keyword.objects.all} } url(r'^profile/$',

Re: DATABASE in settings file not working

2012-02-17 Thread Detectedstealth
I am starting to wonder if it is an opensuse bug. I am thinking about switching back to Ubuntu. On Feb 17, 9:04 pm, Detectedstealth wrote: > Yeah I have tried removing settings.pyc and __init__.pyc it > regenerates the *.pyc files but still is not reading the database >

Re: DATABASE in settings file not working

2012-02-17 Thread Detectedstealth
Yeah I have tried removing settings.pyc and __init__.pyc it regenerates the *.pyc files but still is not reading the database settings for some reason On Feb 17, 7:56 am, Furbee wrote: > That is strange. This probably won't help, but try deleting the > settings.pyc file

RE: Dumb newbie question

2012-02-17 Thread Bob Carlson
I kind of like that suggestion. I just finished refactoring that way. It has the effect of putting the admin and browse stuff with the data model which makes sense to me. Cheers, Bob -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf

Re: QuerySet exclusion

2012-02-17 Thread akaariai
On Feb 17, 6:33 pm, Lie Ryan wrote: > If I have two querysets, say 'a' and 'b', the goal is to create another > queryset, say 'c', which has all elements in 'a' that is not in 'b'. > > I can write: > >      c = a.exclude(id__in=b.values('id')) > > but this seems a little

Re: Access denied - hostname is percent character ('%')?

2012-02-17 Thread Andres Reyes
Saying that the database doesn't exists would be giving to much information to potential atackers triying to connect 2012/2/17 Ishmael : > Thanks for the reply.  The solution to the problem was excruciatingly > simple.  I accidentally capitalized the name of the database,

Re: Access denied - hostname is percent character ('%')?

2012-02-17 Thread Ishmael
Thanks for the reply. The solution to the problem was excruciatingly simple. I accidentally capitalized the name of the database, when the actual name is not capitalized. (Why on Earth doesn't the error message say: "The database 'Mydatabase' doesn't exist." ?) Thanks a lot for your time

Re: Dumb newbie question

2012-02-17 Thread Tom Evans
On Fri, Feb 17, 2012 at 4:15 PM, Babatunde Akinyanmi wrote: > I'm also a noob. If I had code that would use the same models then I > would keep everything inside one app but divide them into modules > I would say that is slightly sub optimal. There is nothing wrong with an

Re: Access denied - hostname is percent character ('%')?

2012-02-17 Thread Tom Evans
On Fri, Feb 17, 2012 at 4:31 PM, Dennis Lee Bieber wrote: > On Thu, 16 Feb 2012 18:55:14 -0800 (PST), Ishmael > wrote: > > >>_mysql_exceptions.OperationalError: (1044, "Access denied for user >>'myuser'@'%' to database 'Mydatabase'") >> >>My settings

Re: Django Design Patterns and Djen of Django books on Kindle Store

2012-02-17 Thread Gethin Llyn ab Alwyn
Are your Books complete? On 17 February 2012 09:31, Shabda Raaj wrote: > We have published our Ebooks on Kindle Store and would love to get > some reviews. (Just $1 each) > > > http://www.amazon.com/The-Djen-of-Django-ebook/dp/B006P1K0YY/ref=ntt_at_ep_dpt_2 > >

QuerySet exclusion

2012-02-17 Thread Lie Ryan
If I have two querysets, say 'a' and 'b', the goal is to create another queryset, say 'c', which has all elements in 'a' that is not in 'b'. I can write: c = a.exclude(id__in=b.values('id')) but this seems a little tedious, why can't I just write: c = a.exclude(b) is there any way

Re: Dumb newbie question

2012-02-17 Thread Babatunde Akinyanmi
I'm also a noob. If I had code that would use the same models then I would keep everything inside one app but divide them into modules On 2/17/12, Bob Carlson wrote: > I'm well into beginning building my actual app after going through the > tutorial, > but I have no feel yet

Re: Dumb newbie question

2012-02-17 Thread Babatunde Akinyanmi
I'm also a noob. If I had code that would use the same models then I would keep everything inside one app but divide them into modules On 2/17/12, Bob Carlson wrote: > I'm well into beginning building my actual app after going through the > tutorial, > but I have no feel yet

Re: Problem loading integer data into database using fixture

2012-02-17 Thread Bill Freeman
Also, see pg_hba.conf in the postgres documentation. There can be rules as to who can connect at all, let alone who needs a password. On 2/17/12, Sebastian Goll wrote: > On Thu, 16 Feb 2012 22:18:03 -0800 (PST) > Gchorn wrote: > >>

Re: DATABASE in settings file not working

2012-02-17 Thread Furbee
That is strange. This probably won't help, but try deleting the settings.pyc file and then run python manage.py runserver again (without --settings=settings). Furbee On Fri, Feb 17, 2012 at 7:45 AM, Babatunde Akinyanmi wrote: > Yes I do get it. I didn't realize that while

Re: Dumb newbie question

2012-02-17 Thread Furbee
Yes, they just need to import the models from the module that they need. Be aware, of circular imports, though. That is when one module imports from another which also imports from the first one. Check the imports at the top to make sure the module from which you are importing classes, modles,

Re: import problem

2012-02-17 Thread Furbee
Good point, Dennis. I use Apache2, and any time I modify .py files, I need to restart the Apache2 daemon. I wish I didn't have to, but the environment needs to be flushed. Luckily, it doesn't kill the sessions or anything like, say ColdFusion when it restarts. I was wondering if there was

Re: DATABASE in settings file not working

2012-02-17 Thread Babatunde Akinyanmi
Yes I do get it. I didn't realize that while I was typing my reply your message had already been delivered to the group. On 2/17/12, Detectedstealth wrote: > I can connect with the same credentials that isn't the problem. > > The problem is if I set a password in

Dumb newbie question

2012-02-17 Thread Bob Carlson
I'm well into beginning building my actual app after going through the tutorial, but I have no feel yet for the answer to this question. Can apps share a set of models? My application neatly divides into three pieces, but all the pieces share the same data. Should these be 3 apps or 1? Can

Anyone Tested this? Please Participate.

2012-02-17 Thread coded kid
Hello, I’m not getting the usage of the package (Django-Follow) in template, because I keep getting error. What I did is this; I want to use it for following of users. Just like how friends add each other up or follow each other on sites like twitter. So I registered it with UserProfile in

Re: Problem loading integer data into database using fixture

2012-02-17 Thread Sebastian Goll
On Thu, 16 Feb 2012 22:18:03 -0800 (PST) Gchorn wrote: > Unfortunately, that doesn't seem to be the case. I have the database > user and password in my settings.py file, but I still have to do a > "sudo su postgres" to switch to postgres in the terminal before I can >

Re: DATABASE in settings file not working

2012-02-17 Thread Detectedstealth
I can connect with the same credentials that isn't the problem. The problem is if I set a password in settings.py it doesn't use a password as the error message states. However when I force the settings file with the --settings option then it reads the file correctly and uses the password. On

Re: DATABASE in settings file not working

2012-02-17 Thread Babatunde Akinyanmi
Try to connect to mysql with the same credentials on your terminal. If it doesn't work then you need to reset your root password. sudo dpkg-reconfigure mysql-server-5.1 Should do the trick and then restart the server (That works on ubuntu). Also you should consider creating a separate user

Re: How to set a queryset as property on my class and evaluate it every time the class is instantiated?

2012-02-17 Thread andreas
Okay, sounds reasonable. Thanks for your help! andreas On 17 Feb., 13:53, Tom Evans wrote: > On Fri, Feb 17, 2012 at 12:28 PM, andreas wrote: > > Thanks Tom! > > > I somehow was under the impression that each instantiated plugin would > > overwrite

Re: DATABASE in settings file not working

2012-02-17 Thread Detectedstealth
I have it working, however I need to provide the settings file when running all commands: python manage.py runserver --settings=settings On Feb 17, 6:11 am, Detectedstealth wrote: > Hi, > > I am just coming back to django development after a while of > developing with

Re: Testing: Fixtures vs Factories vs ???

2012-02-17 Thread Shawn Milochik
I don't think there's one true way. In other words, the answer is "all of the above," depending on your project and the needs of each individual test. It also depends on your code. If you've done TDD, and therefore made your code easier to test, you can probably do it the simplest way

DATABASE in settings file not working

2012-02-17 Thread Detectedstealth
Hi, I am just coming back to django development after a while of developing with pyramid. I have taking over an application. For some reason with the newest version of django it is not reading the password I set in settings: DATABASES = { 'default': { 'ENGINE':

Re: How to set a queryset as property on my class and evaluate it every time the class is instantiated?

2012-02-17 Thread Tom Evans
On Fri, Feb 17, 2012 at 12:28 PM, andreas wrote: > Thanks Tom! > > I somehow was under the impression that each instantiated plugin would > overwrite the data that is stored on the class level. > > What would be the best approach if i don't want to create an __init__ > for all

Re: How to set a queryset as property on my class and evaluate it every time the class is instantiated?

2012-02-17 Thread andreas
Thanks Tom! I somehow was under the impression that each instantiated plugin would overwrite the data that is stored on the class level. What would be the best approach if i don't want to create an __init__ for all my Plugin-Subclasses? Would it help to define the queryset-attribute as a

Re: How to set a queryset as property on my class and evaluate it every time the class is instantiated?

2012-02-17 Thread Tom Evans
On Fri, Feb 17, 2012 at 12:13 PM, Tom Evans wrote: > On Fri, Feb 17, 2012 at 12:00 PM, andreas wrote: >> Sorry for the vague description, but i find it hard to exactly name >> the problem i am facing. Hopefully my description is clear enough: >> >> I

Re: How to set a queryset as property on my class and evaluate it every time the class is instantiated?

2012-02-17 Thread Tom Evans
On Fri, Feb 17, 2012 at 12:00 PM, andreas wrote: > Sorry for the vague description, but i find it hard to exactly name > the problem i am facing. Hopefully my description is clear enough: > > I am working on a reporting app that collects and displays events/ > actions that

How to set a queryset as property on my class and evaluate it every time the class is instantiated?

2012-02-17 Thread andreas
Sorry for the vague description, but i find it hard to exactly name the problem i am facing. Hopefully my description is clear enough: I am working on a reporting app that collects and displays events/ actions that happened in my application. I wrote a litte plugin base class and added plugins

Re: Django 1.4 beta 1 released

2012-02-17 Thread Mário Neto
Cool! =) 2012/2/16 victoria > I just wanted to let you know that we have also released a new version > of BitNami DjangoStack 1.4b1 which bundles Django 1.4b1. I hope that > will make easier to test this new version without conflicting with > your current stable environment.

Testing: Fixtures vs Factories vs ???

2012-02-17 Thread Paolo
Hi folks, I've been coding away on my latest Django project, and have recently started to think about how best to test the functionality I have so far. Creating fixtures for my tests seems like a good idea initially, but from experience I find fixtures become harder and harder to maintain as

Re: Problem loading integer data into database using fixture

2012-02-17 Thread Gchorn
I figured it out the answer to my original question. One of the fields was a ForeignKey field and I was just giving it the string representation of the foreignkey object, rather than its primary key (which is an integer and not a string). Thanks for the help though, Bill! cheers, Guillaume On

Django Design Patterns and Djen of Django books on Kindle Store

2012-02-17 Thread Shabda Raaj
We have published our Ebooks on Kindle Store and would love to get some reviews. (Just $1 each) http://www.amazon.com/The-Djen-of-Django-ebook/dp/B006P1K0YY/ref=ntt_at_ep_dpt_2 http://www.amazon.com/Django-Design-Patterns-ebook/dp/B006OYO9SK/ref=ntt_at_ep_dpt_1 (They are also available for free