Re: Models not being updated when accessed by multiple processes

2010-11-23 Thread Iqbal Abdullah
Since we only run the application on a single server we're using file based locking; fail_to_get_lock() and release_lock() tries to create a file in the tmp directory with the user's unique identification data, and release_lock() deletes it. What I don't understand is, even if the save() method is

Re: Hosting multiple projects

2010-11-23 Thread Reinout van Rees
On 11/22/2010 10:42 PM, Todd Wilson wrote: I teach a course in which I have students developing unrelated Django projects on servers of their own choice. As we near the end of the semester, I would like to set up a single server where I can host all of these student projects together. I will ob

Django 1.3 - JQuery features?

2010-11-23 Thread Derek
In the last Django advent, Zain Memon said: "A lot of implemented features missed the cut for Django 1.2, like drag-and-drop reordering of inlines for models with an ordering field, and an autocomplete widget for Foreign Key and M2M relations to be used instead of the select drop-down (or raw_id_

Re: Hosting multiple projects

2010-11-23 Thread Daniel Roseman
On Nov 22, 9:42 pm, Todd Wilson wrote: > I teach a course in which I have students developing unrelated Django > projects on servers of their own choice.  As we near the end of the > semester, I would like to set up a single server where I can host all > of these student projects together.  I will

Adding manager class to model during runtime

2010-11-23 Thread Vidja
I'm not sure if this is the right way of describing it, but I would like to add a model manager on a model during project loading. This is what I am doing to add new functions to a class: ## in models.py ## class customer(models.Model): customer_id = models.AutoField(primary_key=True) nam

Adding manager class to model during runtime

2010-11-23 Thread Vidja
I'm not sure if it is possible, but I'm trying to add a model manager defined outside of the model.py to a modelclass, in a similar way as I add functions to a model class. this is how I add a new function to a model class (leaving out ## in models.py class Customer(models.Model): customer_id

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-23 Thread bruno desthuilliers
On 23 nov, 01:27, Christophe Pettus wrote: > Apologies if this is a FAQ... Not AFAIK > I'd like to take a QuerySet and order it in memory, rather than using > 'order_by'.  However, I need it to stay a QuerySet, since I'll be feeding it > to the .queryset attribute of a ModelChoiceField.  Is th

Adding manager class to model during runtime

2010-11-23 Thread Vidja
I'm not sure if it is possible, but I'm trying to add a model manager defined outside of the model.py to a modelclass, in a similar way as I add functions to a model class. (my model classes (> 100) are automatically generated from the database and I don't want to edit that file every time) this i

tree hierarchy

2010-11-23 Thread rattanpriya bhasin
Hi I want to implement a tree hierarchy of customers in my django application. If i want to add customers then manager at root can add cistomers of gold class(say Level 1) and further customer 1 can add people at (level 2 ) in tree.This is howi want my customer tree hierarchy .Can any body give me

Re: Hosting multiple projects

2010-11-23 Thread Graham Dumpleton
On Nov 23, 8:18 pm, Daniel Roseman wrote: > On Nov 22, 9:42 pm, Todd Wilson wrote: > > > > > > > I teach a course in which I have students developing unrelated Django > > projects on servers of their own choice.  As we near the end of the > > semester, I would like to set up a single server whe

Modifying client.session from a testcase

2010-11-23 Thread leandrodemarco
Hi, I'm testing, and I need to set/modify the session dictionary before doing the client.get(), as that get, calls a view that expects that the session dictionary has certain keys. According to the documentation, I should store de self.client.session in a variable, modify the variable and, finally

Is there a way to create a new database table other than model?

2010-11-23 Thread vbs
Hi all, This is my situation, I want to make a web based game-hall. I have a model named Game. When I add a new game from the admin panel, a new record will be added to the database table assigned to model Game. This is what django does. And at the same time, I also want a new database table to be

Re: tree hierarchy

2010-11-23 Thread Manoj Kumar
hi How about the people in level 2 whether they can add more peoples?? On Tue, Nov 23, 2010 at 4:12 PM, rattanpriya bhasin < bhasin.rattanpr...@gmail.com> wrote: > Hi > I want to implement a tree hierarchy of customers in my django application. > If i want to add customers then manager a

Re: Debugging Unit Tests

2010-11-23 Thread Murray
Aah no, I'm using xmlrunner. Looks like switching back to the default works for me too. On Nov 22, 4:18 pm, Shawn Milochik wrote: > This works for me. Are you certain the code you think is being executed is > where it's "freezing"? > > Try some logging statements. How are you running your tests

Re: how to configure database?

2010-11-23 Thread Michael Sprayberry
have you done python manage.py syncdb? --- On Mon, 11/22/10, pa_ree wrote: From: pa_ree Subject: how to configure database? To: "Django users" Date: Monday, November 22, 2010, 3:32 PM hello, i'm new to django framework. i want to know how can i configure a single database to two applicatio

Conflict trying to save models when roles metaclass is applied.

2010-11-23 Thread Ben Scherrey
We are attempting to apply the concepts of Domain-Context Interaction (DCI) to our python/django development. Unfortunately, the metaclass mechanism which the main python library supporting this uses conflicts with that of Django's metaclass for db.models. What happens is that a metaclass and n

Re: Hosting multiple projects

2010-11-23 Thread Brian Bouterse
We use Opus to do our django deployments. It creates a secure version of the setup described in this thread (with apache not nginx), and even takes care of deploying the databases also (if you don't mind postgres). my 2 cents, Brian On Tue, Nov 23, 2010 at 6:14

Re: Set Language in the Admin

2010-11-23 Thread Federico Capoano
I got rid of the LocaleMiddleware. To translate the frontend of the application I'm using http://bitbucket.org/carljm/django-localeurl/overview It seems the best solution for me. On Nov 18, 1:29 pm, Federico Capoano wrote: > Thanks > > On Nov 16, 11:19 am, Tom Evans wrote: > > > > > > > > >

Re: django charts

2010-11-23 Thread Pablo Ilardi
My 2 cents, I'm using http://code.google.com/p/flot/ does the job on the browser side, you just have to pass it the data from django, it works very good and is cross browser. - Pablo On Nov 19, 3:56 am, Priya wrote: > Hi, > I am a new user to django ,can anybody please help me resolve this > iss

Re: Do Fixtures have a limit?

2010-11-23 Thread Ryno in Stereo
Hey Reinot, Thanks so much for replying! It wasn't quite as simple as those rows were duplicates but that got me on the right track and now it works perfectly. Cheers, Ryan On Nov 23, 12:22 am, Reinout van Rees wrote: > On 11/22/2010 03:16 PM, Ryno in Stereo wrote: > > > I'm trying to create ar

Announces django-guardian 1.0.0.pre

2010-11-23 Thread lukaszb
Recently I've finally write down first part of integration with admin. Positive side effect are reusable forms for object permissions management. There are still some caveats (i.e. queries number, not needed generic fk with content_type, test runner and other small things) but they should be remov

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread ringemup
Perhaps there's another way to accomplish your goal. Why do you want a table for each game? On Nov 23, 5:14 am, vbs wrote: > Hi all, > > This is my situation, I want to make a web based game-hall. > I have a model named Game. When I add a new game from the admin panel, > a new record will be add

Re: User additional profile

2010-11-23 Thread Carlos Daniel Ruvalcaba Valenzuela
What you want is to add more field to the User model, the common way to do this is to create an UserProfile model which will be linked to a given user, check the documentation on the django book on this: http://www.djangobook.com/en/1.0/chapter12/#cn222 Regards, Carlos Ruvalcaba On Mon, Nov 22,

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread S Basl
If you absolutely need to do so, you can execute raw sql queries to do whatever you need using Django. The docs are here: http://docs.djangoproject.com/en/1.2/topics/db/sql/ However, it's probably a 'bad' idea to go mucking about with sql if you

how do i get access to json data?

2010-11-23 Thread alecx
Hello django users, after several try outs, i am not able to figure out how to access data in a serialized object. E. g. how do I get the name "Douglas", "Adams" in the example: http://docs.djangoproject.com/en/dev/topics/serialization/#deserialization-of-natural-keys In javascript i can get e. g

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread Li You
Is there a prettier way to do it? Maybe a dynamic model, or nested model, or something like? On Tue, Nov 23, 2010 at 9:42 PM, S Basl wrote: > If you absolutely need to do so, you can execute raw sql queries to do > whatever you need using Django. The docs are > here: http://docs.djangoproject.co

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread Li You
Because I want to save user's info about each game. And the best way is to save the info by each game. On Tue, Nov 23, 2010 at 9:26 PM, ringemup wrote: > Perhaps there's another way to accomplish your goal.  Why do you want > a table for each game? > > On Nov 23, 5:14 am, vbs wrote: >> Hi all, >

Re: how do i get access to json data?

2010-11-23 Thread Li You
Maybe this is what you want: from json import JSONDecoder s = '''{ "pk": 1, "model": "store.book", "fields": { "name": "Mostly Harmless", "author": ["Douglas", "Adams"] } } ''' d = JSONDecoder().decode(s) print a['fields']['author'] On Tue, Nov 23, 2010 at 9:45 PM

Re: how do i get access to json data?

2010-11-23 Thread Li You
sorry but a mistake. On Tue, Nov 23, 2010 at 10:01 PM, Li You wrote: > Maybe this is what you want: > > from json import JSONDecoder > s = '''{ >    "pk": 1, >    "model": "store.book", >    "fields": { >        "name": "Mostly Harmless", >        "author": ["Douglas", "Adams"] >    } > } > ''' >

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread S Basl
None that I know of, but I am no Django guru. I get the feeling I'm missing something about your situation however. It seems like you should be able to accomplish what you want, saving unique info about each game, without per-game tables. You have a many to many relationship between games and users

Re: Django 1.3 - JQuery features?

2010-11-23 Thread Russell Keith-Magee
On Tue, Nov 23, 2010 at 5:18 PM, Derek wrote: > In the last Django advent,  Zain Memon said: > > "A lot of implemented features missed the cut for Django 1.2, like > drag-and-drop reordering of inlines for models with an ordering field, and > an autocomplete widget for Foreign Key and M2M relation

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread bruno desthuilliers
On 23 nov, 14:55, Li You wrote: > Because I want to save user's info about each game. And the best way > is to save the info by each game. This doesn't mean having a distinct table per game - unless of course the database table schema is specific for each game but then you want something a bit mo

Re: User additional profile

2010-11-23 Thread bruno desthuilliers
On 22 nov, 20:19, robos85 wrote: > As Django noob I successfully created user validation and managed to > add user. But I also created additional table for user profile, > registered it in settings. But when I save() user to create it, my > additional table is still empty. You need to create a

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread David De La Harpe Golden
On 23/11/10 13:55, Li You wrote: > Because I want to save user's info about each game. And the best way > is to save the info by each game. > It sounds like you have some db modelling confusion here. Are you sure you don't just want a many-to-many between Game and User with some data on an expli

Re: How can I set a flatpage to be my homepage?

2010-11-23 Thread mongoose
Hi There, I've specified the URL as / in the admin. Now I get an error from firefox telling me "The page isn't redirecting properly". This is what I'm using for the URLs.py urlpatterns += patterns('', (r'^$', include('django.contrib.flatpages.urls')), ) On Nov 21, 8:43 pm, "Joseph (Driftwo

Re: Conflict trying to save models when roles metaclass is applied.

2010-11-23 Thread bruno desthuilliers
On 23 nov, 13:08, Ben Scherrey wrote: >     We are attempting to apply the concepts of Domain-Context > Interaction (DCI) to our python/django development. Unfortunately, the > metaclass mechanism which the main python library supporting this uses > conflicts with that of Django's metaclass for db

Django locale/mn doesn't work.

2010-11-23 Thread Tsolmon Narantsogt
Hi fellows. I'm using Django 1.1 version. I make some languages in my settings.py LANGUAGE_CODE = 'en' LANGUAGES = ( ('en','English'), ('mn','Mongolia'), ('ru','Russia'), ) LANGUAGE_COOKIE_NAME = 'lang' Then create po and mo files . ( using django-admin.py makemessages -l ru , m

Re: how to configure database?

2010-11-23 Thread Reeti Pal
i saw the tables getting created in the terminal by using python manage.py sql appname but when on entering the url http://127.0.0.1:8000/admin/ m getting dis error on the admin page AttributeError at /admin/ 'str' object has no attribute '_meta' Request Method: GET Request URL: http://127.0.0.

Re: Issue uploading photos through the admin. PIL issue.

2010-11-23 Thread Reeti Pal
could you plz elaborate on wot u did to solve the problem, even i want to add images on my admin page. > > -- reeti -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubs

Reusing actions "Save and continue editing" and "Save"

2010-11-23 Thread lom276
Hi all. I want to ask you if there is a best way to implement the actions "Save and add another", "Save and continue editing" and "Save" for my own forms. Is it possible to reuse the functionality from the Admin- Interface or do I have to invent the wheel again and implement it without reusing any

Re: Static files ...

2010-11-23 Thread jonno
Slight update: I ran the command: python manage.py findstatic /imgs/cellohome.jpg and received a message that ended with: django.core.exceptions.SuspiciousOperation: Attempted access to '/imgs/ cellohome.jpg' denied. I think that command applies only to a production environment, though, so I d

Re: how do i get access to json data?

2010-11-23 Thread alecx
Thanks for your answer Li. This solution works for python, I figured this out too. But how does this work inside a template with javascript? I use $.getJSON() inside the template to get the data. Inside the javascript I can access the data with: this.fields.name but this.fields.author does n

Re: Django locale/mn doesn't work.

2010-11-23 Thread Tom Evans
On Tue, Nov 23, 2010 at 2:41 PM, Tsolmon Narantsogt wrote: > Hi fellows. > I'm using Django 1.1 version. > I make some languages in my settings.py > LANGUAGE_CODE = 'en' > LANGUAGES = ( >     ('en','English'), >     ('mn','Mongolia'), >     ('ru','Russia'), >     ) > LANGUAGE_COOKIE_NAME = 'lang'

Re: how to configure database?

2010-11-23 Thread lom276
python manage.py sql appname just prints the create table sql statements, but does not sync them with you DB. user python manage.py syncdb Michael. On Nov 23, 2:47 pm, Reeti Pal wrote: > i saw the tables getting created in the terminal by using python manage.py > sql appname > but when on enter

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread Li You
>> Because I want to save user's info about each game. And the best way >> is to save the info by each game. >> > > It sounds like you have some db modelling confusion here. > > Are you sure you don't just want a many-to-many between Game and User > with some data on an explicit through model "User

Re: Is there a way to create a new database table other than model?

2010-11-23 Thread Tom Evans
On Tue, Nov 23, 2010 at 3:13 PM, Li You wrote: > Let me describe this problem in more detail: > I have a Game model for each game. This model can be seen as a list of > all games, such as, > > class Game(models.Model): >    name = models.CharField(max_length = 128, unique = True) >    available =

Re: how to configure database?

2010-11-23 Thread Reeti Pal
i ve used syncdb for database creation, i think the problem is sumthing at the admin page not at the models level. > > -- reeti -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.c

tutorial part 4: ImportError

2010-11-23 Thread steph
Hi group, I'm new - just worked thgough the tutorial. In part 4 about the use of generic views I've got a problem - I can't import ListView and DetailView: >>> from django.views.generic import DetailView Traceback (most recent call last): File "", line 1, in ImportError: cannot import name Det

Re: tutorial part 4: ImportError

2010-11-23 Thread Michael Sprayberry
Steph,   those instructions are incorrect try from djanog.views.generic import list_view, list_detail   Michael --- On Tue, 11/23/10, steph wrote: From: steph Subject: tutorial part 4: ImportError To: "Django users" Date: Tuesday, November 23, 2010, 11:06 AM Hi group, I'm new - just work

Re: tutorial part 4: ImportError

2010-11-23 Thread Robbington
Firstly friend, 1.3 alpha has been released as a testing package. It isnt the most stable version and not meant for production, I would revert back to 1.2 unless your plan is to help the django team with bug fixes. Also, you are reading the wrong tutorial for your version, that is why you are g

Re: tutorial part 4: ImportError

2010-11-23 Thread Daniel Roseman
On Nov 23, 4:06 pm, steph wrote: > Hi group, > > I'm new - just worked thgough the tutorial. In part 4 about the use of > generic views I've got a problem - I can't import ListView and > DetailView: > > >>> from django.views.generic import DetailView > > Traceback (most recent call last): >   File

Re: how to configure database?

2010-11-23 Thread Michael Sprayberry
share a little bit of your code so that we know what you are seeing. Just saying that you aren't getting things in your admin does not provide enough information. --- On Tue, 11/23/10, Reeti Pal wrote: From: Reeti Pal Subject: Re: how to configure database? To: django-users@googlegroups.com

Re: how to configure database?

2010-11-23 Thread rattanpriya bhasin
Me n reeti have been working on same project. So it was like we made two independent projects with independent application and dedicated independent server to each.Now i want to link my application with reeti's n vice versa. So to do that,she included my app name in her settings.py and modified her

Re: Problem with Mysql Queries in django

2010-11-23 Thread Jagdeep Singh Malhi
On Nov 22, 11:28 pm, Rogério Carrasqueira wrote: > Hi Jagdeep, > > Consider to use a query like this example: > > sales = > Sale.objects.extra(select={'month':'month(date_created)','year':'year(date_created)'}).values('year','month').annotate(month=11,year=2010) > Not working Error : File "",

HELP NEEDED

2010-11-23 Thread Dipo Elegbede
Hi, I have done some extensive reading on python. i want to design a classifieds site for jobs. The service is meant to send people who register an sms with available jobs that fit their criteria/cv. But the main idea is that people come and register for quick jobs(like www.freelancer.com) and put

Cheetah templates

2010-11-23 Thread Tim
Hi, I use the conventional Django template system for everything except for one task in which I would like to use Cheetah. I've got the following code in a view: source, loader = django.template.loader.find_template_source('tools/example.tmpl') contents=Cheetah.Template.Template(source,sear

Re: HELP NEEDED

2010-11-23 Thread Huy Ton That
I would recommend selecting an easier first project. Good luck. On Nov 23, 2010 1:28 PM, "Dipo Elegbede" wrote: Hi, I have done some extensive reading on python. i want to design a classifieds site for jobs. The service is meant to send people who register an sms with available jobs that fit the

list_filter doesn't appear for model with ForeignKey to auth.models.User

2010-11-23 Thread Carsten Fuchs
Hi all, developing my app with Django 1.2.1 and having completed large parts of the main functionality already, I've now started with familiarizing myself with user authentication. I understand that django.contrib.auth.models.User is best extended as described at

Re: User model optional

2010-11-23 Thread VB
Thanks, Joseph and Scot. I'll take a look at using Django's User model. VB On Nov 21, 9:29 am, Scot Hacker wrote: > On Nov 20, 2:55 pm, VB wrote: > > > If I intend to write my own authentication, can I use my define my own > > User model? Or, am I better off naming the model something else? > >

Re: how to configure database?

2010-11-23 Thread Reeti Pal
tnkuu ppl... the problem has been solved... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.

Re: HELP NEEDED

2010-11-23 Thread Michael Sprayberry
I would definitely go Django for this project and maybe divide out the project and get some people to help you seeing as this is your first project. Not only do you have to take into account the look up the website, the models for employers and freelancers, but you are also going to need to take

How do I get tracebacks printed to terminal?

2010-11-23 Thread Markus Barth
I am using quite a lot of asynchronous calls for updating a page. The problem is that this way you never see a traceback. In turbogears the development server prints all tracebacks to the terminal. Is there any way to get a similar behaviour with django? -- You received this message because you a

Re: How do I get tracebacks printed to terminal?

2010-11-23 Thread Javier Guerra Giraldez
On Tue, Nov 23, 2010 at 3:48 PM, Markus Barth wrote: > I am using quite a lot of asynchronous calls for updating a page. The > problem is that this way you never see a traceback. In turbogears the > development server prints all tracebacks to the terminal. Is there any > way to get a similar behav

Re: How do I get tracebacks printed to terminal?

2010-11-23 Thread Markus Barth
I have just found a post from beginning of last year pointing out that this feature got "lost" during the transition from 0.9 to 1.0. I have digged a bit through the code but must admit that fixing this definitely should be done by someone who is familiar with django internals. Tracebacks are one

Re: How do I get tracebacks printed to terminal?

2010-11-23 Thread Markus Barth
On 23 nov, 23:19, Javier Guerra Giraldez wrote: > On Tue, Nov 23, 2010 at 3:48 PM, Markus Barth > > wrote: > > I am using quite a lot of asynchronous calls for updating a page. The > > problem is that this way you never see a traceback. In turbogears the > > development server prints all traceb

Re: How do I get tracebacks printed to terminal?

2010-11-23 Thread Markus Barth
On 23 nov, 23:33, Markus Barth wrote: > On 23 nov, 23:19, Javier Guerra Giraldez wrote: > > > On Tue, Nov 23, 2010 at 3:48 PM, Markus Barth > > > wrote: > > > I am using quite a lot of asynchronous calls for updating a page. The > > > problem is that this way you never see a traceback. In turb

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-23 Thread Christophe Pettus
On Nov 23, 2010, at 2:25 AM, bruno desthuilliers wrote: > Strictly speaking, you don't need the queryset attribute of a > ModelChoiceField to be a QuerySet instance - as long as the object you > pass in has a '.all()' method that returns an iterable, you should be > fine (cf django/forms/models.py

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-23 Thread Christophe Pettus
On Nov 23, 2010, at 2:25 AM, bruno desthuilliers wrote: > Strictly speaking, you don't need the queryset attribute of a > ModelChoiceField to be a QuerySet instance - as long as the object you > pass in has a '.all()' method that returns an iterable, you should be > fine (cf django/forms/models.py

New ManyToManyField Approach

2010-11-23 Thread sh...@bogomip.com
I've recently started using the following approach when attempting to reduce the size of ManyToManyField type reference tables. Currently I'm working on implementing this in a limited fashion into my own work. I would like to share what I'm working on with you all and see if it's worth a reaction

makemessages failing to extract all strings from Javascript

2010-11-23 Thread Lau
I'm having some trouble with makemessages failing while parsing my javascript files. I'm running it with domain set to djangojs and it's successfully finding all my javascript files but keeps halting during the parsing. I did a bit of debugging in the makemessages command (Django version 1.2.1 and

Re: New ManyToManyField Approach

2010-11-23 Thread Christophe Pettus
On Nov 23, 2010, at 5:40 PM, sh...@bogomip.com wrote: > Without test data I'm not sure where the trade offs are with the > following. However it should improve the ability to look up items > that reference a certain set of keys as well as easily check to see if > a set already exists. This shoul

Re: New ManyToManyField Approach

2010-11-23 Thread sh...@bogomip.com
On Nov 23, 6:42 pm, Christophe Pettus wrote: > On Nov 23, 2010, at 5:40 PM, sh...@bogomip.com wrote: > > > Without test data I'm not sure where the trade offs are with the > > following.  However it should improve the ability to look up items > > that reference a certain set of keys as well as eas

Re: New ManyToManyField Approach

2010-11-23 Thread Christophe Pettus
On Nov 23, 2010, at 9:09 PM, sh...@bogomip.com wrote: > Since you've noticed it I have to ask.. since I didn't think it would > be any different.. how does this differ from the current Django > method? The standard Django implementation creates an intermediate table with foreign keys back to the