Re: Django help required with non foreign key relations

2012-04-22 Thread Aditya Sriram M
Ohh this looks little promising.. However, 1. I need a few cols of table1 and few from table 2 to be displayed. How can we achieve that at the .filter() level? and 2. At the view level like using the list_display () for displaying them in the Admin interface On Sunday, 22 April

Re: guardian: I get ImproperlyConfigured error, but I have set ANONYMOUS_USER_ID in projectName/projectName/settings.py

2012-04-22 Thread su
I got this error when I syncdb. 在 2012年4月23日星期一UTC+8上午11时51分18秒,BFSchott写道: > > This should work: > > # django-guardian requires an anonymous user > ANONYMOUS_USER_ID = -1 > > Also, I think you need to "python manage.py syncdb" the first time you use > it. > > Brian Schott > bfsch...@gmail.com >

Re: guardian: I get ImproperlyConfigured error, but I have set ANONYMOUS_USER_ID in projectName/projectName/settings.py

2012-04-22 Thread Brian Schott
This should work: # django-guardian requires an anonymous user ANONYMOUS_USER_ID = -1 Also, I think you need to "python manage.py syncdb" the first time you use it. Brian Schott bfsch...@gmail.com On Apr 22, 2012, at 11:41 PM, su wrote: > I set ANONYMOUS_USER_ID in my project setting. >

guardian: I get ImproperlyConfigured error, but I have set ANONYMOUS_USER_ID in projectName/projectName/settings.py

2012-04-22 Thread su
I set ANONYMOUS_USER_ID in my project setting. It doesn't work. Error message: --- Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File

Re: request.is_ajax() not working

2012-04-22 Thread Amao Zhao
dear psychok7: You have no data from your ajax post, you should post some data with your ajax post, like this $.post("api/newdoc/", {'user':'your username'}, function(data) { alert(data); }); } 在 2012年4月23日星期一,psychok7 写道: > hi there i am trying a simple example using AJAX,

request.is_ajax() not working

2012-04-22 Thread psychok7
hi there i am trying a simple example using AJAX, DJANGO, JQUERY, JSON and my if request.is_ajax() is not working for some reason.. here is my code: URLS: (r'api/newdoc/$', 'rose_miracle.views.newdoc'), VIEW: def newdoc(request): # only process POST request print "entrei" if

Re: Adding context data to a TemplateView?

2012-04-22 Thread Buddy Lindsey, Jr.
This should help you out with adding extra context to TemplateView http://godjango.com/15-class-based-views-part-1-templateview-and-redirectview/ Roy Smith wrote: I'm using a generic TemplateView (django-1.4), but I want to be able to add something to the context. Is that possible? The docs

Re: 'too many SQL variables' error with ModelMultipleChoiceField

2012-04-22 Thread Russell Keith-Magee
Hi Lukas, I haven't looked into the problem in detail, but it doesn't surprise me that it exists. It's also probable that it's something that is new to 1.4 (or, at least, that it manifests in slightly different ways in 1.4). One of the features added in 1.4 is bulk insertion of data. This

'too many SQL variables' error with ModelMultipleChoiceField

2012-04-22 Thread Lukas Zilka
Hello, I have a form with ModelMultipleChoiceField on it, and I am getting 'DatabaseError: too many SQL variables' (using SQLite) when the user picks more than 1000 entries in the selection widget and posts the form. The problem seems to be the method clean of ModelMultipleChoiceField, which

Re: Adding context data to a TemplateView?

2012-04-22 Thread Ejah
Oh, and an extra set of curly braces: url(r'^about$', TemplateView.as_view(template_name='legal_ipsum/about.html', {"extra_content":{"pagename":"about"}})), On Apr 22, 11:28 pm, Ejah wrote: > Quotes around extra_context > HTH > > On Apr 22, 11:20 pm, Roy Smith

Re: Adding context data to a TemplateView?

2012-04-22 Thread Ejah
Quotes around extra_context HTH On Apr 22, 11:20 pm, Roy Smith wrote: > I'm using a generic TemplateView (django-1.4), but I want to be able to add > something to the context.  Is that possible? > > The docs >

Adding context data to a TemplateView?

2012-04-22 Thread Roy Smith
I'm using a generic TemplateView (django-1.4), but I want to be able to add something to the context. Is that possible? The docs at https://docs.djangoproject.com/en/1.4/topics/generic-views/#adding-extra-context talk about "an extra optional parameter, extra_context", but I don't get what

Re: Django nginx uWSGI

2012-04-22 Thread Gerald Klein
Thanks I will give that a shot. Solid advice on the build version, my machine is 3.2 and django is up to 2.7. I was wondering how to force a script to run at 2.7 because I was worried about the version clash. thanks a lot. --jerry On Sun, Apr 22, 2012 at 2:01 PM, Roberto De Ioris

Re: Django nginx uWSGI

2012-04-22 Thread Roberto De Ioris
> Hi, I am attempting to get nginx and uwsgi running on my local box, I > followed any number of tutorials and this one had the most complete > information. > http://gekicstart.ca/tech-posts/nginxuwsgidjango-stack/ > > It is written for Debian\Ubuntu so I had to transpose a bit. I got through >

Re: Modeling Question on Many-to-Many(with through) and Proxy models

2012-04-22 Thread Arruda
So using your tip, I've done this: class Foo1Bar(FooBar): > > objects = TypeAwareManager('foo__type',1) > > class Meta: > proxy= True > > def change_fb(cls): > old_foo = cls.foo > > @property > def new_foo(self): > return

access denied error

2012-04-22 Thread Helen Chao
try running command prompt as an admin (right click, select Run As Administrator) fixed it for me. -- 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

Re: Modeling Question on Many-to-Many(with through) and Proxy models

2012-04-22 Thread Arruda
Thanks, I saw that .model thing too, but was also unsure about it... I might just test it. Em sábado, 21 de abril de 2012 19h04min30s UTC-3, akaariai escreveu: > > On Apr 21, 8:35 pm, Arruda wrote: > > Should I create this many-to-many table as a normal model(no

Re: New to Jdango - What IDE to use?

2012-04-22 Thread Aaron C. de Bruyn
This has been asked eleventy bajillion times, but I don't see a wiki page on it? :) I'd be happy to dig through the archives and compile a list if there's no objection. Would there be a problem including for-pay IDEs? (For example I use PyCharm from time to time) Any wiki managers or people

Ignoring empty forms in a formset

2012-04-22 Thread Martin Tiršel
Hello, I have a formset and some JavaScript to add more forms into this formset. In a view, I iterate through the formset saving (not a ModelForm just Form with save method) each form: for form in formset: form.save() But I want to ignore empty forms that were added by JavasScript and not

Re: Django help required with non foreign key relations

2012-04-22 Thread akaariai
On Apr 22, 1:31 pm, Aditya Sriram M wrote: > File myapp/models.py has this sample code.. > > from django.db import models > > # model for 'user' table in database oracle_dbuser1:user > class User(models.Model): >     . . . >     customerid = models.BigIntegerField() > > #

Re: Testing an app without a models.py file

2012-04-22 Thread Michal Petrucha
On Sat, Apr 21, 2012 at 10:25:20PM -0700, dor wrote: > As of the latest version (1.4), this is impossible. What's the > rationale behind it? Why isn't it fixed by now? If I make a fix, > will it be accepted by the official team? It is caused by the way Django loads and registers apps. Currently

Django nginx uWSGI

2012-04-22 Thread Gerald Klein
Hi, I am attempting to get nginx and uwsgi running on my local box, I followed any number of tutorials and this one had the most complete information. http://gekicstart.ca/tech-posts/nginxuwsgidjango-stack/ It is written for Debian\Ubuntu so I had to transpose a bit. I got through most of it and

Open Django East

2012-04-22 Thread Steve Holden
I realize it is way past time I publicized this conference to the Django users group - sorry for the omission. Open Django is a series of three conferences, so we hope to have at least one that's reasonable for you to travel through. http://opendjango.com/ There's less than a month to go now,

Re: Testing an app without a models.py file

2012-04-22 Thread Rafał Stożek
I don't think it has ever been possible. That's why people put empty models.py in their apps. W dniu niedziela, 22 kwietnia 2012 06:25:20 UTC+1 użytkownik dor napisał: > > As of the latest version (1.4), this is impossible. What's the rationale > behind it? Why isn't it fixed by now? If I make

Django help required with non foreign key relations

2012-04-22 Thread Aditya Sriram M
File myapp/models.py has this sample code.. from django.db import models # model for 'user' table in database oracle_dbuser1:user class User(models.Model): . . . customerid = models.BigIntegerField() # model for 'customer' table in database oracle_dbuser2:customer # Note that there

ModelMultipleChoiceField in edit form

2012-04-22 Thread dummyman dummyman
Hi, I have a django admin form where in i have overriden two fields widgets to display in ModelMultipleChoiceField ie attributea = forms.ModelMultipleChoiceField() attributeb=forms.ModelMultipleChoiceField() now i when i click save and add another data will be saved to database and will be

Re: 'builtin_function_or_method' object has no attribute 'split' after upgrading to Django 1.4

2012-04-22 Thread akaariai
On Apr 22, 4:45 am, Taras_96 wrote: > Hi, > > I've just upgraded to Django 1.4, and I was getting a > 'builtin_function_or_method' object has no attribute 'split' error > being thrown. I traced this down to an erroneous use of distinct, I > had: > > X.objects.distinct(id) > >

Re: URL regex not matching

2012-04-22 Thread yati sagade
I think that one also matches upto one whitespace character(space, tab or newline) within the username(The \s). On Sun, Apr 22, 2012 at 2:12 PM, Swaroop Shankar V wrote: > Thanks a lot for your reply. I just found an regex from some blog which is > as follows > >

Re: URL regex not matching

2012-04-22 Thread Swaroop Shankar V
Thanks a lot for your reply. I just found an regex from some blog which is as follows (r'^user/([\w\'\.\-]+\s?[\w\'\.\-]+)/$','accounts.views.userProfile'), and this seems to be working fine. Have not tested all the use cases for this regex, but anyway username with . (dot) is working fine now.

Re: URL regex not matching

2012-04-22 Thread yati sagade
I'm not sure, but I think this should work - try it out and let us know. r'^user/([\w\-+.@]+)/$' I'm not too good with regexes, either. No one is. Also, characters like "+" are encoded in URLs - so you might want to think of that. On Sun, Apr 22, 2012 at 1:42 PM, Swaroop Shankar V

URL regex not matching

2012-04-22 Thread Swaroop Shankar V
Hello All, I need some urgent help with this one. Am trying to show a user profile when the user navigates to a url of this format http://example.com/user/ I have provided the following expression in my urls.py file (r'^user/(\w+)/$','accounts.views.userProfile'), this working fine for normal

Updating django-mingus and new theme

2012-04-22 Thread aziz
Hello world I started using django-mingus for my blog (azizmb.in) and in the process ive been trying to fix things that I've found broken. Ive also created a new theme on Twitter's bootstrap. Ive written a blog post about this here: http://azizmb.in/2012/04/22/updating-django-mingus/. My fork