Problems extracting valid form data lately

2012-04-14 Thread Chris Seberino
I don't know what changed but I can't seem to extract valid form data. (It was working for months previously.) Below is the function that creates new users when they register. I store the data in cd. I can print the contents of cd and confirm cd is a dictionary but I can't access any values!!!

Re: Where do ya'll put your glue models?

2012-04-14 Thread Mike Dewhirst
I wouldn't think of my models as "glue". I would write down a list of requirements and call that an app. It obviously won't need to include Poll and Article because they exist already and can be imported untouched. Most of the Django books and docs suggest that you segregate functionality

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Arruda
oh, I see, but the problem is that I need this scripts to be ran often and if I make a request to a sandbox, and then this sandbox send other requests to my server getting and changing data(since some scripts change the data of my server) this would take too long, and make the server unable to

Re: mocking out a Model

2012-04-14 Thread Andy McKay
> @patch('apps.market.models.House') Is create house in apps.market.models, or is it somewhere else? If it's somewhere else, mock it relative to that file eg: @patch('apps.some_file.House') > I'm also wondering if it's possible to inspect MockedHouse to see if it has > for example some tags

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Andy McKay
I would not recommend allowing untrusted users to execute random python on your server in any way. The only sandbox ive seen that is well protected is app engine, if you are hosting your site on app engine, things might be a bit better. I would recommend sending webhooks or callbacks to users

Re: Admin area hyperlinks to sub categories

2012-04-14 Thread Swaroop Shankar V
Hi Sandro, Thanks for the link. It looks like you had provided the link to show additional options in the action drop down on the list page. This is not what am exactly looking for. I guess my question was not clear. I will try to explain it in much better way: 1) I have 2 models called Categories

ModelFormSet submit with JQuey

2012-04-14 Thread Massimo Barbierato
I need to submit two "forms" with "jquery" because i don't want to put two input buttons in the template. The problem is that one of them is a model_formset and it needs {{ formset.management_form }}, and i inserted it in the template, but i still receive the error "ValidationError:

Passing additional variables to flatpage template

2012-04-14 Thread Swaroop Shankar V
Hi All, Am using flatpage app in my application. I want to send few additional variables that can be accessible from the flatpage templates. So how can i accomplish the same? Thanks and Regards, Swaroop Shankar V -- You received this message because you are subscribed to the Google Groups

ModelFormSet submit with JQuey

2012-04-14 Thread Massimo Barbierato
I need to submit two forms with jquery and not with two input buttons. One of them is a model_formset so i have to add {{ form.management_form }}, and i did it, but i still receive the error: "ManagementForm data is missing or has been tampered with". How can i resolve it? Thanks Max --

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Arruda
Is this what you're talking about? https://developers.google.com/appengine/docs/python/overview Still don't understand how this would be used. Em sábado, 14 de abril de 2012 14h19min01s UTC-3, Andy McKay escreveu: > > That's not something I'd ever recommend an untrusted user do. There > are still

Re: [Question] Filter Queryset in a Template

2012-04-14 Thread dummyman dummyman
do the filtering part in views.py . templates is meant only for visual purpose On Sat, Apr 14, 2012 at 2:21 PM, Nikhil Somaru wrote: > Greetings, > > > I would like to do something like queryset filtering in a template. Is the > only solution via a template tag? > > > #

Re: Can't start new project

2012-04-14 Thread Jani Tiainen
Sounds very goofy. django-admin.py just creates files, doesn't open any editors so there is somthing really fishy going on in your machine... On Sat, Apr 14, 2012 at 8:27 PM, Brandy wrote: > What I mean is, I can create 2 or 3 new projects without problems. I play >

Password protected URLs Django - choose which to be protected also in admin

2012-04-14 Thread rentgeeen
Hello, I have quite interesting problem with password protected content in Django. I can successfully protect my content or URLs in Django by using "@login_required" decorator. Example: **Urls.py** urlpatterns = patterns('', url(r'^(?P[a-zA-Z0-9_.-]+)/$', 'example.sort'), ) **Views.py**

Re: Can't start new project

2012-04-14 Thread Brandy
What I mean is, I can create 2 or 3 new projects without problems. I play with them and create files, etc. Then, for whatever reason, when I run django-admin.py startproject again, an editor widow opens (emacs in my case, since that is what I was using), and django doesn't create any files.

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Andy McKay
That's not something I'd ever recommend an untrusted user do. There are still many ways that could go wrong. The safest execution environment I've seen for Python is App Engine, send a callback to that instead :) -- You received this message because you are subscribed to the Google Groups

basci question about queryset for retrieving top element

2012-04-14 Thread NENAD CIKIC
Hello! I want to get just the top element of one queryset. SO I have something as qs=MyModel.objects.filter(...).order_by(..) and then use qs[0] and check some value I wonder now if i did the right thing or it is better to use .extra on queryset. Is the queryset object allocated for all objects,

PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Arruda
Hi there, I'm doing a system where I want the users to be able to set/change some scripts that are dynamically run(RPG like scripts). So a user can change the way the Kill_a_player script is run. I thought of doing this by using exec, like this: class Script(models.Model): > script_py =

django flatpages and model translations

2012-04-14 Thread maumercado
Hello everyone, What is your aproach or what app do you use in order to make translations for django flatpages and project apps models? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Installation Issue - error: /usr/local/bin/django-admin.py: No such file or directory

2012-04-14 Thread Jeff Hervouet
nevermind, I found the answer: /usr/local/bin/django-admin.py already existed. I removed it and reran a fresh install. On Sat, Apr 14, 2012 at 3:50 PM, BuckRogers wrote: > Hi, > > I am attempting to install Django 1.4 on OS X 10.6.8 > > After running the following

Where do ya'll put your glue models?

2012-04-14 Thread Hanne Moa
Say that there's an excellent 3rd party app "articles" with a model Article and another most excellent 3rd party app "polls" with a model Poll. How do you glue them together? If an Article may have several Polls and a Poll may be used in several Articles, you can glue them together with a new

Installation Issue - error: /usr/local/bin/django-admin.py: No such file or directory

2012-04-14 Thread BuckRogers
Hi, I am attempting to install Django 1.4 on OS X 10.6.8 After running the following command : sudo python setup.py install I get this (see the last line): ... copying django/views/generic/list_detail.py -> build/lib/django/views/ generic copying django/views/generic/simple.py ->

Re: APPEND_SLASH = True with URL patterns without slash

2012-04-14 Thread Chris Streeter
Make sure that you have 'django.middleware.common.CommonMiddleware' in your list of MIDDLEWARE_CLASSES. Otherwise APPEND_SLASH has no effect. - Chris On Sat, Apr 14, 2012 at 04:15, graeme wrote: > I have the following setup using Django 1.3: > > 1) Middleware that

"python manage.py sql" does not print output when error exists in models.py

2012-04-14 Thread aghalloran
I am following the Django tutorial (https://docs.djangoproject.com/en/ 1.4/intro/tutorial01/#activating-models) and when I got to running "python manage.py sql polls" it did not print any output. It did not print any errors, nor the expected SQL statements. I assumed that because "exact output

mocking out a Model

2012-04-14 Thread Jonas Geiregat
Hello, I'm trying to test a function that imports and acts upon a django model, named House. from apps.market.models import House def create_house(location, date, price): house = House(id=None, date, price) house.save() # calculate some stuff and further expand the

Has anyone successfully used django-breadcrumbs?

2012-04-14 Thread Marcin Tustin
I have added django-breadcrumbs to my app, following the instructions at https://github.com/chronossc/django-breadcrumbs/. It works in so far as there is always exactly one breadcrumb displayed on each page in my app, but never do more accumulate. I'm about to try storing the list in the

APPEND_SLASH = True with URL patterns without slash

2012-04-14 Thread graeme
I have the following setup using Django 1.3: 1) Middleware that changes request.urlconf depending on the domain requested 2) APPEND_SLASH = True 3) One URL pattern that does not end in a slash. A request for a URL that matches the the pattern that does not end in a slash is redirected. It works

[Question] Filter Queryset in a Template

2012-04-14 Thread Nikhil Somaru
Greetings, I would like to do something like queryset filtering in a template. Is the only solution via a template tag? # models.py class StudentProfile(models.Model): # class defined here # ... class Department(models.Model): # ... students = models.ManyToManyField('StudentProfile',

Re: cannot import name `feed`

2012-04-14 Thread Alec Taylor
Actually it can be fixed by removing django.notifications like so: Edit `settings.py` by commenting out "notification.context_processors.notification", within TEMPLATE_CONTEXT_PROCESSORS and "notification", # must be first from INSTALLED_APPS. Finally edit urls.py by commenting out

Re: cannot import name `feed`

2012-04-14 Thread Nikhil Somaru
You have upgraded to Django 1.4. I had the same problem when going from Django 1.3.1 to 1.4. Suggestion: pip install django==1.3.1 On Mar 6, 7:22 am, Alec Taylor wrote: > I keep getting an ImportError saying "cannot import name `feed`". > (pinax-admin basic_project) >

Re: cannot import name `feed`

2012-04-14 Thread Nikhil Somaru
You have upgraded to Django 1.4. I had the same problem when going from Django 1.3.1 to 1.4. Suggestion: pip install django==1.3.1 On Mar 6, 7:22 am, Alec Taylor wrote: > I keep getting an ImportError saying "cannot import name `feed`". > (pinax-admin basic_project) >