Re: multi_db support for doctests? How to enable?

2010-08-04 Thread Xavier Ordoquy
Hi, >> So far, the only issue I found with testing on multi database is that django >> 1.2 expects all the tables are created on the second database which may not >> always be the case (bug reported, I just uploaded a patch for that). > > Which patch/ticket is that? With my router, the second

Need help with my Form.save() method. Trouble with ForeignKey and ManyToMany Fields.

2010-08-04 Thread strayhand
So I'm rolling out my own registration form that should update the following models: - User (auth module) - UserProfile Everything seems to be coming together but I'm having a hard time with the save() method for the form. My UserProfile model has a couple of fields that refer to other models

Re: Forms and 'prefix' parameter

2010-08-04 Thread Ed Schofield
On Aug 5, 2:23 pm, Karen Tracey wrote: > On Thu, Aug 5, 2010 at 12:10 AM, Ed Schofield wrote: > > Hi everyone, > > > I'm trying to use a view with multiple forms under Django 1.2.1. I'm > > puzzled that the prefix parameter seems to screw up validation.

Re: Forms and 'prefix' parameter

2010-08-04 Thread Karen Tracey
On Thu, Aug 5, 2010 at 12:10 AM, Ed Schofield wrote: > Hi everyone, > > I'm trying to use a view with multiple forms under Django 1.2.1. I'm > puzzled that the prefix parameter seems to screw up validation. Here's > a test case: > > > >>> from django import forms > >>> >

Re: first app

2010-08-04 Thread yalda nasirian
hi sameer can you Give me more explanation? and i don't know how can i access to freenode for IRC .please guide me tanx On Wed, Aug 4, 2010 at 4:30 PM, Sameer Rahmani wrote: > hi , congratulation. > > why don't you use a VCS like git or mercurial ? > > -- > You received

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Pedro Brandao
Hi André. In Django, the presentation is handled by means of templates (in other words, the "View" of the MVC). What we call "views" in Django actually correlate more closely to the "Controller" of the MVC. Take a look at the link Xavier posted, it explains the terminology better. If you still

Error with Apache and mod_wsgi

2010-08-04 Thread Vikas Mahajan
Hello to all. I am new baby to python and django. I have installed the django-1.21 in my pc. I am able to create mysite as mentioned in tutorial and mysite also works fine using django web server (on port 8000), but now I am trying to run mysite on my apache server but I am facing problems. Apache

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Kenneth Gonsalves
On Wed, 2010-08-04 at 21:42 -0500, Michael Hipp wrote: > On 8/4/2010 7:47 PM, André A. Santos wrote: > > wow this is different to me because Java is different follows MVC... > > so, the business rules stay on View (GUI)? > > All the view does is create the http response. If the particular >

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Michael Hipp
On 8/4/2010 7:47 PM, André A. Santos wrote: wow this is different to me because Java is different follows MVC... so, the business rules stay on View (GUI)? All the view does is create the http response. If the particular request requires any significant business logic, I would put that in a

Re: Django IDE

2010-08-04 Thread llanitedave
I'm surprised nobody's mentioned SPE yet. I've not gone very far with either Python nor Django yet, but from what I've done so far, particularly with conveniently grouping modules, SPE seems to be a natural tool. -- You received this message because you are subscribed to the Google Groups

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Kenneth Gonsalves
On Wed, 2010-08-04 at 21:47 -0300, André A. Santos wrote: > wow this is different to me because Java is different follows MVC... > so, the business rules stay on View (GUI)? views is not gui - what views do is get/put data from/to the database and also process the data either for presentation or

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
wow this is different to me because Java is different follows MVC... so, the business rules stay on View (GUI)? On Wed, Aug 4, 2010 at 9:11 PM, Kenneth Gonsalves wrote: > On Wed, 2010-08-04 at 12:02 -0300, André A. Santos wrote: > > for exemple using MVC parttern how it works

Re: TypeError: decoding Unicode is not supported

2010-08-04 Thread sohesado
i've found the solution. There was missing some language support packages. It's kind of embarrassing :)... My initial apache configuration was ok. The fact that manage.py runserver just worked , was misleading. Thanks for your help , Alec. I've learned a couple of things dealing with this issue.

debugging template inheritance

2010-08-04 Thread Michael P. Soulier
Hi, I have a framework on a product that allows new django projects to make use of an existing project's code, so new projects can reduce duplication. It does this in templates by some trickery with the TEMPLATE_DIRS. For example, I have a base project here

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Kenneth Gonsalves
On Wed, 2010-08-04 at 12:02 -0300, André A. Santos wrote: > for exemple using MVC parttern how it works -> > > M - model (Python) > V - view (JSP) > C - controller (Django or also Django on Model tier?) no this is not correct. django follows the Model View Template roughly: database structure

Re: Flexible relationships - tips/advice?

2010-08-04 Thread v0idnull
Sorry, I screwed up my description: Photos, Videos, other Articles, etc, can be related to one Article. However, an Article can also be related to a Photo, though the relationship would symbolize something different then say, the assets of the content. On Aug 4, 7:32 pm, v0idnull

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Kenneth Gonsalves
On Wed, 2010-08-04 at 11:04 -0300, André A. Santos wrote: > hmmm... > Dr thanks for answering... my doubt is if is better put the business > rules > code on Python or Django... got it? let us put it this way: in java programming, where do you put the business rules? -- regards Kenneth

Auto-truncated fields at max_length

2010-08-04 Thread Samuel Clay
I have a field that has a max_length set. When I save a model instance, and the field's value is > than max_length, Django enforces that max_length at the database level. (See Django docs on models: http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.CharField.max_length)

Flexible relationships - tips/advice?

2010-08-04 Thread v0idnull
I want to be able to link one model to another model, regardless of what models they are. Articles can be related to Photos, Videos, other Articles, etc etc etc. I have created a Relationship model to represent these relationships, but I'm unsure if this is the best solution. First off, my

Re: how to make readonly in change but editable in add?

2010-08-04 Thread shmengie
Shamefully, I didn't even give it a good once over before posting it. However, I have read through it, and I'm not too ashamed ;) More comments would be nice, but I was more concerned with the results at the time and it's not terribly complex code, so I think it stands well on it's own. I

Re: Django IDE

2010-08-04 Thread Carlos Daniel Ruvalcaba Valenzuela
If you are looking for a "Full IDE" I have used Eclipse+PyDev (and other plugins) and works quite well, completion is reasonable and you have a wealth of extensions such as VCS support, Mylyn Integration (to work with remote task/issue managers), HTML editing, etc. It is a little bloated if you

Issue with change_view save redirect

2010-08-04 Thread herbal
I am attempting to change the redirected for the django admin save button. What I pasted below works on saving an already existing entry (updating) but not on saving a new one. Any thoughts? def change_view(self, request, object_id, extra_context=None): result = super(TodoAdmin,

Re: TypeError: decoding Unicode is not supported

2010-08-04 Thread Alec Shaner
Ah, maybe that makes more sense then. It does indeed sound like locale issue with your apache + mod_python envrionment. I see an old django ticket that sounds pretty similar: http://code.djangoproject.com/ticket/8965 Sounds like you're still getting ASCII as the default encoding despite the env

Re: Python question about subprocess.Popen() and stdout

2010-08-04 Thread Hassan
> Ok, so it appears that (in Python 2.5 at least) there is no way to capture > the stdout of subprocess.Popen() just do this from subprocess import Popen, PIPE p = Popen([cmd], stdout=PIPE) p.stdout.readlines() thats it! -- You received this message because you are subscribed to the Google

Re: How to get the model name of an object in template?

2010-08-04 Thread v0idnull
i know this isn't what you want, but I'd use the Content Type middleware. def getType(self): if (self._type == None): self._type = ContentType.objects.get_for_model(self) return self._type for me personally this worked out well, but mostly because I have an

importing models to script file

2010-08-04 Thread Tony
Hi, Im trying to import my models to another python file that I am making to use the database data. The problem is, I can't import the models for some reason. It keeps saying "ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined." The thing

importing models to script file

2010-08-04 Thread Tony
Hi, Im trying to import my models to another python file that I am making to use the database data. The problem is, I can't import the models for some reason. It keeps saying "ImportError: no module named " The thing is, it works on my home computer when I do it, but when I do it on

Odd behavior with reverse()

2010-08-04 Thread Seth
I've just spent the better part of an afternoon dealing with this issue, then finally figured it out this morning. Supposing you have this situation (which I saw in a django app that I've been using lately): urls.py: (r'^viewtest1$', 'testapp.views.viewtest1'), (r'^viewtest2$',

Re: moving to django 1.2.1

2010-08-04 Thread Michael P. Soulier
On 31/07/10 Russell Keith-Magee said: > Ok - I'm repeating myself here, but we take backwards compatibility > *very* seriously. If anyone can point at a specific backwards > incompatible change that was introduced in Django 1.2, then that is a > bug that we need to address, and would in all

Re: multi_db support for doctests? How to enable?

2010-08-04 Thread Reinout van Rees
On 08/04/2010 06:08 PM, Xavier Ordoquy wrote: The second database should be created. Maybe you want to double check you setup a database router. I *do* have a database router. The router makes sure that 5 tables end up in the second database (and the others end up in the default database).

Re: TypeError: decoding Unicode is not supported

2010-08-04 Thread sohesado
On Aug 4, 6:48 pm, Alec Shaner wrote: > I'm no expert on encodings so I can only suggest some alternatives that > might get around the issue: > > First, maybe you can find something here:http://docs.python.org/howto/unicode i've read , pretty much everything,

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
wow thank you so much... you have helped me a lot... AS On Wed, Aug 4, 2010 at 3:48 PM, Renne Rocha wrote: > André, > > It seems that you don't understand what Django is. Your question > make no sense. > > Take a look at this website: www.aprendendodjango.com/ (it is in

Re: Announces django-guardian: per object permissions for Django 1.2

2010-08-04 Thread lukaszb
Thanks for the comment! I really do think that this "backends ready && included" parts of Django are extremely useful (and fun to extend if needed). About the admin, I haven't really get into admin integration yet as I cannot answer this: should user with "flatpages.change_flatpage" permission

Re: Django IDE

2010-08-04 Thread bagheera
For python/django development i'm using... NetBeans! It fails to autocomplete items properly, but still, i find it most comfortable also for html, javaScript, CSS. Sometimes i use Geany, it's really simple, yet nice IDE. All under Linux. -- You received this message because you are

Re: Announces django-guardian: per object permissions for Django 1.2

2010-08-04 Thread lukaszb
Welll, at the django.contrib.auth there are only those (User and Group) models for which one may define permission sets and I wanted guardian to be as simply as possible - so it is not possible to assign permission to other model even if it "groups users". At one point I thought it could be nice

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Renne Rocha
André, It seems that you don't understand what Django is. Your question make no sense. Take a look at this website: www.aprendendodjango.com/ (it is in portuguese) It will explain what Django is and what you can do with it. On Wed, Aug 4, 2010 at 12:02 PM, André A. Santos

Re: Free Django Hosting

2010-08-04 Thread Mykola Lys
I have one dedicated server of my client where we are hosting Plone/ Django sites. Just mail me and I believe can help you with hosting for a while. Bests, Mykola Lys. On 3 Сер, 19:57, kostia wrote: > I'm looking for a free Django hosting. Please, write me, if you can

Re: How to get the model name of an object in template?

2010-08-04 Thread David.D
I just wonder if there's some way requires writing nothing. Just like an attribute. thanks. On Aug 4, 11:53 pm, Scott Gould wrote: > Not that I'm aware of, in which case I'd say a tag (or even a filter) > *is* the "built-in way". No great hardship: > > @register.filter > def

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
thanks On Wed, Aug 4, 2010 at 12:28 PM, Xavier Ordoquy wrote: > This relates to: > >

Re: moving to django 1.2.1

2010-08-04 Thread dadeng
Hi, I have tried to follow the tutorial for 1.2.1 but i'm having problems the explanation for adding __unicode__() or __str__() to the class to make it to list the polls correctly without any success. addition of this code did not really fix anything in the polls listings; lass

Uploading Large Files Through Django

2010-08-04 Thread brodle
Im working on an application which will act as a middleware between my CMS (multiple) and my Video provider. People will be uploading files through this django application. Im currently leveraging Django built in file upload handler with the default settings for chunking. We run django under

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Steve Holden
On 8/4/2010 1:38 PM, didier rano wrote: > Back to django development ? > Probably the best idea. regards Steve -- I'm no expert. "ex" == "has-been"; "spurt" == "drip under pressure" "expert" == "has-been drip under pressure". -- You received this message because you are subscribed to the

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread didier rano
Back to django development ? 2010/8/4 Masklinn > On 2010-08-04, at 19:30 , didier rano wrote: > > I think that you know the answer, no ? > Of course. The answer is that you're making up everything on the spot and > arbitrarily tagging languages as "mainstream" or

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Masklinn
On 2010-08-04, at 19:30 , didier rano wrote: > I think that you know the answer, no ? Of course. The answer is that you're making up everything on the spot and arbitrarily tagging languages as "mainstream" or "non-mainstream" in a feeble attempt to try and support whatever point you believe

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread didier rano
I think that you know the answer, no ? Fortran was a mainstream language Objective-C is not a mainstream language. But, mainstream language doesn't mean that these languages are the best. Python is a good language, and same for Java, C#, Objective-C or Fortran. Cobol is a good language (Hum,

overriding model.save()

2010-08-04 Thread Sells, Fred
I would like to prevent saving a new value if the database contains a specific value. This is on a per field, per record basis. If I override the save() method; is there a way to find the existing (in the DB) values and the new (to be stored) values? -- You received this message because you

Re: Free Django Hosting

2010-08-04 Thread roberto
Free django hosting: http://www.alwaysdata.com/ Two details: - It is in French. - Not sure if it is allowed for commercial sites so please, be careful. Good luck ! On Aug 4, 3:38 am, kostia wrote: > I'm looking for private person from some government institution/ >

Re: Django IDE

2010-08-04 Thread Masklinn
On 2010-08-04, at 06:15 , Alexander Jeliuc wrote: > gvim, emacs, eclipse, eric Don't forget pycharm, whose specific Django support is one of the majorly pushed features. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Django IDE

2010-08-04 Thread Daniel França
I'm using Editra now, it seems fine and lightweight and have plugin support. 2010/8/4 Рогалевич (Ковалевич) > gedit + plugins + snippets is easier to learn than vim(gvim) and looks more > beautiful :) , but on windows there is bad support of python plugins (if you > really

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Masklinn
On 2010-08-04, at 17:59 , didier rano wrote: > About "mainstream language"... > > If you ask to Java, C# developers about Python, then some of them should be > know Python and have a good definition about it. > If you ask to Java developers about C#, then all of them should be know it > and have

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread didier rano
One more thing... I have an iphone and a macbook air !!! It could be dangerous to imagine be "different". Sometimes it is my case too. 2010/8/4 didier rano > Effectively, my next post should be better. Maybe focus on more technical > subjects. And, I would like to work

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Xavier Ordoquy
> If you ask to Java, C# developers about Python, then some of them should be > know Python and have a good definition about it. > If you ask to Java developers about C#, then all of them should be know it > and have a good definition about it. > If you ask to C# developers about Java, then

Re: multi_db support for doctests? How to enable?

2010-08-04 Thread Xavier Ordoquy
Hi, The second database should be created. Maybe you want to double check you setup a database router. You also want to take care to fixture file name which expects you to add the database name in the file name. So far, the only issue I found with testing on multi database is that django 1.2

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread didier rano
Effectively, my next post should be better. Maybe focus on more technical subjects. And, I would like to work with someone to correct my bad english ! 2010/8/4 Steve Holden > I don't believe anybody *was* offended - the OP asked "What do you think > about this post ?", and

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread didier rano
About "mainstream language"... If you ask to Java, C# developers about Python, then some of them should be know Python and have a good definition about it. If you ask to Java developers about C#, then all of them should be know it and have a good definition about it. If you ask to C# developers

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Steve Holden
I don't believe anybody *was* offended - the OP asked "What do you think about this post ?", and he got sincere responses that would, if taken to heart, help to improve that post. regards Steve On 8/4/2010 11:35 AM, Sithembewena Lloyd Dube wrote: > Surprising that anybody would be offended by

Re: multi_db support for doctests? How to enable?

2010-08-04 Thread Reinout van Rees
On 08/04/2010 01:49 PM, Russell Keith-Magee wrote: Doctests don't do any database flushing, so there is no analog for the multi-db flag. Just make your calls on the database as you normally would. Ah, ok. Then I'm doing something else wrong (I've only got doctests right now): my second

Re: How to get the model name of an object in template?

2010-08-04 Thread Scott Gould
Not that I'm aware of, in which case I'd say a tag (or even a filter) *is* the "built-in way". No great hardship: @register.filter def class_name(value): return value.__class__.__name__ On Aug 4, 11:13 am, "David.D" wrote: > There's no django's built-in way? > > On

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Masklinn
On 2010-08-04, at 16:24 , didier rano wrote: > Why Google has updated Youtube framework for Java, .NET and PHP, but not > for Python ? > > It was a real question. It isn't, however, one which has any reason to be asked on this mailing list does it? > because Python is not yet a mainstream

Re: TypeError: decoding Unicode is not supported

2010-08-04 Thread Alec Shaner
I'm no expert on encodings so I can only suggest some alternatives that might get around the issue: First, maybe you can find something here: http://docs.python.org/howto/unicode You could try the literal method of generating a unicode string: path = u'%s%s' % (ROOT, name) Where exactly do you

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Masklinn
On 2010-08-04, at 17:35 , Sithembewena Lloyd Dube wrote: > Surprising that anybody would be offended by the OP's post. Why do people so > readily see red? As for the "think special" part, one would have to be > pretty intent on getting upset to miss the sarcasm. Surprising that anybody would read

How to record users ip address every-time user logs in

2010-08-04 Thread vishy
Hi, I want to record an entry in admin log,everytime a user logs in.How can I do this.I am using django's default authentication modules. thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread Sithembewena Lloyd Dube
Surprising that anybody would be offended by the OP's post. Why do people so readily see red? As for the "think special" part, one would have to be pretty intent on getting upset to miss the sarcasm. The English is not perfect, but this isn't a language course. On Wed, Aug 4, 2010 at 4:24 PM,

Re: View Decorator

2010-08-04 Thread Steve Holden
On 8/4/2010 10:52 AM, Dan Gentry wrote: > When I attempt to use the decorator logic, the view becomes this: > > views.py > @institution_required > def list_type(request): > > inst_id=request.session.get('inst_id',None) > > queryset = RecordType.objects.filter(institution=inst_id) >

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Xavier Ordoquy
This relates to: http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names Le 4 août 2010 à 17:02, André A. Santos a écrit : > for exemple using MVC parttern how

Re: How to get the model name of an object in template?

2010-08-04 Thread David.D
There's no django's built-in way? On Aug 4, 10:37 pm, Scott Gould wrote: > How about writing a simple template tag that takes an object and > returns object.__class__.__name__? > > On Aug 4, 10:20 am, "David.D" wrote: > > > > >  I did it by adding

WAP communicating with server-side Python

2010-08-04 Thread shi shaozhong
Is there an equivalent mailling list for WAP? I am in need of a very simple demo website/webpage accessible by mobile handset and simply get a few critical data, e.g. its id, or/and x, y, z position. http://www.google.co.uk/search?hl=en=how+to+mobile+website=8=g10==how+to+mobile_rfai= I want to

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
for exemple using MVC parttern how it works -> M - model (Python) V - view (JSP) C - controller (Django or also Django on Model tier?) On Wed, Aug 4, 2010 at 12:00 PM, André A. Santos wrote: > now i got it... thx > > > > > On Wed, Aug 4, 2010 at 11:09 AM, Masklinn

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
now i got it... thx On Wed, Aug 4, 2010 at 11:09 AM, Masklinn wrote: > On 2010-08-04, at 16:04 , André A. Santos wrote: > > hmmm... > > Dr thanks for answering... my doubt is if is better put the business > rules > > code on Python or Django... got it? > > > As Daniel

Re: TypeError: decoding Unicode is not supported

2010-08-04 Thread sohesado
Well your example clarifies the problem. I removed the unicode calls. The initial problem was an UnicodeEncodeError exception. I tried to solve it by encoding the strings to utf-8. It seems that's not the case. So i'm at square one. Note that.. -with python manage.py runserver the app runs

Re: Saving formsets with multiple databases

2010-08-04 Thread Paulo Almeida
Sorry if this is obvious and you're looking for a more direct way, but If it's only the formset save that fails, I would suggest: instances = formset.save(commit=False) for instance in instances: instance.save(using=database) I have never used multiple databases though, so I don't know if

Re: View Decorator

2010-08-04 Thread Dan Gentry
Forgot to paste in the urls. urls.py from django.conf.urls.defaults import * from django.views.generic.simple import redirect_to from views import * urlpatterns = patterns('person', url(r'^create_type/$',create_type,name='type_create'),

Re: View Decorator

2010-08-04 Thread Dan Gentry
When I attempt to use the decorator logic, the view becomes this: views.py @institution_required def list_type(request): inst_id=request.session.get('inst_id',None) queryset = RecordType.objects.filter(institution=inst_id) return object_list(request, queryset, paginate_by = 12) I

Re: How to get the model name of an object in template?

2010-08-04 Thread Scott Gould
How about writing a simple template tag that takes an object and returns object.__class__.__name__? On Aug 4, 10:20 am, "David.D" wrote: >  I did it by adding this to my models: >         def get_model_name(self): >                 return self.__class__.__name__ > > And

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Xavier Ordoquy
Hi, You're asking if you'd rather put all the business logic in pure python classes or django models ? I'm not sure there's a straight answer to this, esp with no information about what you're trying to do. Regards, Xavier. Le 4 août 2010 à 16:04, André A. Santos a écrit : > hmmm... > Dr

Re: Django, Rails but a cost to pay ?

2010-08-04 Thread didier rano
Why Google has updated Youtube framework for Java, .NET and PHP, but not for Python ? It was a real question. I need it for my Python project. And, I don't understand why Google choose to update Java, .NET and PHP apis and not Python. It is my "cost to pay", because Python is not yet a mainstream

How to get the model name of an object in template?

2010-08-04 Thread David.D
I did it by adding this to my models: def get_model_name(self): return self.__class__.__name__ And it works But I don't want to define the 'get_model_name' method in my model. Is there a built-in way? Thanks. -- You received this message because you are

Re: Admin Inline inside another admin inline

2010-08-04 Thread Alessandro Ronchi
2010/7/3 Sean Brant > > Im not even sure if this is best way to display things, I would like > one main product edit screen that lets you attach "product types" > which have "sizes" to a "product", it seems jumping between a bunch of > screens is not good ux. Wondering if I

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Masklinn
On 2010-08-04, at 16:04 , André A. Santos wrote: > hmmm... > Dr thanks for answering... my doubt is if is better put the business rules > code on Python or Django... got it? > As Daniel indicated, your question doesn't make sense. Django is Python, that's like asking whether you should write

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
hmmm... Dr thanks for answering... my doubt is if is better put the business rules code on Python or Django... got it? On Wed, Aug 4, 2010 at 10:50 AM, Daniel Roseman wrote: > On Aug 4, 2:38 pm, André A. Santos wrote: > > Hello friends, > > this

Re: View Decorator

2010-08-04 Thread Daniel Roseman
On Aug 4, 2:15 pm, Dan Gentry wrote: > I'm trying to move some code from a view to a decorator to use with > many views.  This is the view: > > views.py: > def list_type(request): > >     inst_id=request.session.get('inst_id',None) > >     ## move to decorator >     if not

Re: Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread Daniel Roseman
On Aug 4, 2:38 pm, André A. Santos wrote: > Hello friends, > this is André AS from São Paulo-Brazil, total beginner to Python > technologies, I am working on a project that uses those we are > converting all those to Java, so I would like to know where I must put the >

Must I put the rules logic on Python or Django code and why?

2010-08-04 Thread André A . Santos
Hello friends, this is André AS from São Paulo-Brazil, total beginner to Python technologies, I am working on a project that uses those we are converting all those to Java, so I would like to know where I must put the logic rules I am a little confusing if I must put on Python or Django code...

Re: Announces django-guardian: per object permissions for Django 1.2

2010-08-04 Thread derek
On Aug 4, 1:20 am, lukaszb wrote: > Hi all, > > I'd like to announce django-guardian - very basic yet usable per > object permissions > implementation for Django 1.2, using new authorization backend > facilities. > > It was created during 2 days sprint, code have been

Re: View Decorator

2010-08-04 Thread Franklin Einspruch
A decorator is a specific construction in Python (and one that doesn't appear in your code): http://www.python.org/dev/peps/pep-0318/#current-implementation-history http://www.artima.com/weblogs/viewpost.jsp?thread=240808 Good luck! Franklin On Wed, Aug 4, 2010 at 9:15 AM, Dan Gentry

View Decorator

2010-08-04 Thread Dan Gentry
I'm trying to move some code from a view to a decorator to use with many views. This is the view: views.py: def list_type(request): inst_id=request.session.get('inst_id',None) ## move to decorator if not inst_id: path = urlquote(request.get_full_path()) tup =

Re: PIL failed in virtualenv?

2010-08-04 Thread Kai Diefenbach
Hi, On 2010-08-04 08:43:34 +0200, kostia said: But I have a trouble with Imaging-1.1.7! Take a look at Pillow: http://pypi.python.org/pypi/Pillow/1.2 Kai -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Django No Messages Error

2010-08-04 Thread kostia
SOLVED! On Aug 4, 3:48 pm, kostia wrote: > After I do: > > kos...@baikal$ python manage.py runserver > Error: No module named messages > kos...@baikal$ > > Django 1.2.1 with python 2.6.5+ devel installed. -- You received this message because you are subscribed to the

Django No Messages Error

2010-08-04 Thread kostia
After I do: kos...@baikal$ python manage.py runserver Error: No module named messages kos...@baikal$ Django 1.2.1 with python 2.6.5+ devel installed. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django IDE

2010-08-04 Thread Ковалевич
gedit + plugins + snippets is easier to learn than vim(gvim) and looks more beautiful :) , but on windows there is bad support of python plugins (if you really need to develop on win) vim may be more flexible Wing IDE not free. I meant version with django support

Multiple Databases and ModelFormSets

2010-08-04 Thread Parker
I am somewhat new to Django and am trying to use the ModelFormSets alongside multiple-databases. I'm trying to create an empty ModelFormSet that will allow me to create objects for a specific database and pull in the appropriate drop-downs from that database. What I'm seeing is that the Form Set

Re: Strange error overriding changelist_view in ModelAdmin

2010-08-04 Thread Steve Holden
On 8/4/2010 5:43 AM, Erisa wrote: > Oops! I copied the old class with the "self" mistake left in. The > correct class is: > > class SettingsAdmin(admin.ModelAdmin): > def changelist_view(self, request, extra_context=None): > object_id = str(Settings.objects.all()[0].id) >

Re: djangoproject access fields of object dynamically

2010-08-04 Thread Steve Holden
On 8/4/2010 5:26 AM, ars_sim wrote: > > > Hello, Can anyone help me? > > I have list of fields called 'allowed_fields' and I have object called > 'individual'. > allowed_fields is sub set of individual. Now I want to run loop like > this > > for field in allowed_fields: > obj.field =

Re: first app

2010-08-04 Thread Sameer Rahmani
hi , congratulation. why don't you use a VCS like git or mercurial ? -- 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

Re: how to make readonly in change but editable in add?

2010-08-04 Thread Steve Holden
On 8/3/2010 11:03 PM, shmengie wrote: > I cobbled these two classes together which work very nicely for me, > wish they could make into django. > Drop these two classes into a util.py and import them instead of Form > or ModelForm. When you want your form readonly instantiate it with >

first app

2010-08-04 Thread yalda.nasirian
Hi dear friends finally , i finish my first app tutorials of djangoproject.com . i want to share this whith u , i wish it'll be helpfull . note to change dir template in setting,py . http://www.4shared.com/file/23TzJzLt/mysite.html -- You received this message because you are subscribed to the

Re: multi_db support for doctests? How to enable?

2010-08-04 Thread Russell Keith-Magee
On Wed, Aug 4, 2010 at 6:40 PM, Reinout van Rees wrote: > Hi, > > http://docs.djangoproject.com/en/dev/topics/testing/#multi-database-support > tells me to add "multi_db = True" to my unittest TestCase class to get multi > db support. > > I'm using a doctest, however, and I

Re: no such table: django_session when doing the tutorial

2010-08-04 Thread Yoji H
this is just a guess but i think the path is not set right. but i don know how to set it correctly. On Wed, Aug 4, 2010 at 8:39 PM, Yoji H wrote: > i did as i wrote above. > > 2010/8/4 Alexandre González > > Have you run the script manage.py with

Re: no such table: django_session when doing the tutorial

2010-08-04 Thread Yoji H
i did as i wrote above. 2010/8/4 Alexandre González > Have you run the script manage.py with syncdb option? > > python manage.py syncdb > > On Wed, Aug 4, 2010 at 12:44, merabi wrote: > >> Hi. >> im using python 2.6, django 1.1, eclipse3.4, and pydev

Re: no such table: django_session when doing the tutorial

2010-08-04 Thread Alexandre González
Have you run the script manage.py with syncdb option? python manage.py syncdb On Wed, Aug 4, 2010 at 12:44, merabi wrote: > Hi. > im using python 2.6, django 1.1, eclipse3.4, and pydev 1.6, macbook > pro mac os 10.6.4. > trying to do the tutorial: >

  1   2   >