On Thu, Mar 17, 2011 at 6:51 AM, vamsy krishna wrote:
> That is true Michal. My understanding is that the server does send
> back a 413 response as soon as it finds the huge mismatch in the
> upload limit and the actual upload size. Also I think the server
> immediately terminates the connection f
hi,
I have a test like this:
self.assertRaises(ValidationError,Costtocompany.objects.create,profile=self.profile1,
company_laptop = True,
ctc_pa=1,
ctc_pm =1,
On Thursday, March 17, 2011 9:47:50 AM UTC, lawgon wrote:
>
> hi,
>
> I have a test like this:
>
>
> self.assertRaises(ValidationError,Costtocompany.objects.create,profile=self.profile1,
> company_laptop = True,
> ctc_pa=1,
>
On Thu, Mar 17, 2011 at 9:55 AM, cuteangel wrote:
> def search_mov(movie_name):
> try:
> from django.db import connection, transaction
> cursor = connection.cursor()
> cursor.execute("select query from Winteract_Wogmainteract
> where query like %s",['%'+mov
On Thursday, March 17, 2011 9:55:49 AM UTC, cuteangel wrote:
>
> def search_mov(movie_name):
> try:
> from django.db import connection, transaction
> cursor = connection.cursor()
> cursor.execute("select query from Winteract_Wogmainteract
> where que
def search_mov(movie_name):
try:
from django.db import connection, transaction
cursor = connection.cursor()
cursor.execute("select query from Winteract_Wogmainteract
where query like %s",['%'+movie_name+'%'])
row = cursor.fetchall()
On Thu, 2011-03-17 at 03:26 -0700, Daniel Roseman wrote:
> >
> This has nothing to do with the use of assertRaises. Creating a model
> programmatically does *not* call clean(), as clearly specified in the
> documentation
> (http://docs.djangoproject.com/en/1.2/ref/validators/#how-validators-are-
Yes Tom, thanks. That makes sense. And yes it works like a charm on
Opera.
On Mar 17, 2:47 pm, Tom Evans wrote:
> On Thu, Mar 17, 2011 at 6:51 AM, vamsy krishna wrote:
> > That is true Michal. My understanding is that the server does send
> > back a 413 response as soon as it finds the huge mism
What I've found as a solution, though I don't know how much it is
recommended as a programming practice is to have your variable defined in a
"custom" request context and then use that request context instead of the
default one.
You create you request context and based on the default context then
On Thursday, March 17, 2011 11:35:55 AM UTC, chubz wrote:
>
> What I've found as a solution, though I don't know how much it is
> recommended as a programming practice is to have your variable defined in a
> "custom" request context and then use that request context instead of the
> default one.
I need to make an application in which all views require login. Is there any
good way to do that and not to use @login_required() decorator with all
methods?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
El 17/03/11 09:30, galgal escribió:
I need to make an application in which all views require login. Is
there any good way to do that and not to use @login_required()
decorator with all methods?
Yes there is: http://djangosnippets.org/snippets/1220/
--
Gonzalo Delgado
--
You received this me
Nate it looks really interesting but I see the same problem that I
already have.
Most of help about setting up Django is base on assumption that it
will be site in the internet. My problem is in the intranet this site
won't see the world :) . I know it should be less work to do and less
problems b
Thanks for your responses.
The problem here is that there are some "dirty" solutions to this problem,
but i'm sure there is a good way to proceed with it.
This issue should be really simple to resolve if django make use of classes
instead of functions for views, and then, template would be benefi
Thanks for that. I wrote my own middleware for this, but the snippet
is better-implemented than mine.
Shawn
--
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
Hi,
We have a web app running on Django 1.3.0. I get emails about
IOError as below:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py", line 104, in get_response
response = callback(request, *callback_args, **callback_kwargs)
On Thu, Mar 17, 2011 at 1:51 PM, Komkov Alexander wrote:
> Hi,
> We have a web app running on Django 1.3.0. I get emails about
> IOError as below:
>
> Traceback (most recent call last):
>
> File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
> base.py", line 104, in get_respo
No one?
On Mar 16, 10:05 pm, AJ wrote:
> I have a model like this:
>
> class Post (models.Model):
> name = models.CharField(max_length=1000, help_text="required, name
> of the post")
> description = models.TextField(blank=True)
> custom_hashed_url = models.CharField(unique=True, max_l
On Thursday, March 17, 2011 2:33:50 PM UTC, AJ wrote:
>
> No one?
>
> On Mar 16, 10:05 pm, AJ wrote:
> > I have a model like this:
> >
> > class Post (models.Model):
> > name = models.CharField(max_length=1000, help_text="required, name
> > of the post")
> > description = models.Tex
My apologies, I guess that was a rude thing to write but believe me,
my intention was not to be rude at all. I know that no one here owes
me an answer and I respect that folks still help. Please accept my
apologies if I came off as a rude person in my last message.
Thanks a lot for your help.
--A
Here's an alternative way to do it.
Something like (in view):
post.save(user = request.user)
And in your save override:
user = kwargs.pop('user')
self.user = user
super(Post, self).save(*args, **kwargs)
The reason you pop off the 'user' value instead of just reading it is
that
Is it possible to specify a default selected option for the
forms.Select widget of a forms.CharField form field? If so how is it
coded? Here is my current widget's code from my form definition:
widget=forms.Select(attrs={ 'name': 'rptlist', 'id': 'rptlist',
'size': '1', 'select-one': 'select-one',
On Thu, Mar 17, 2011 at 2:58 PM, hank23 wrote:
> Is it possible to specify a default selected option for the
> forms.Select widget of a forms.CharField form field? If so how is it
> coded? Here is my current widget's code from my form definition:
>
> widget=forms.Select(attrs={ 'name': 'rptlist',
On Thu, Mar 17, 2011 at 7:53 AM, maciekjbl wrote:
> My problem is in the intranet this site
> won't see the world :)
why is this a problem? you can use the same setup.
the main difference (at least for my own intranet-only apps) is that
usually you don't get as many users, nor exposive growth.
Is it possible to generate different fieldsets for admin forms? I
would like to retrieve different fieldsets for different users.
Thanks
--
Vinicius Massuchetto
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Hi All!
I want to create Django web project. I have to connect from my Django
project to Facebook via login and registration when user login or
register on my web site.
Please guide what need for me because I am a beginner on Django and
Python.
Although I read via online about Django connect faceb
It's easy to create an authentication backend:
http://docs.djangoproject.com/en/1.2/topics/auth/#writing-an-authentication-backend
If you know (or can figure out) what code you have to write in order
to authenticate against Facebook, just drop that code into your custom
authentication backend and
Ben,
You should a have a look at https://github.com/bueda/django-boilerplate
"django-boilerplate is an attempt to set up a standard convention for
Django app layouts, to assist in writing utilities to deploy such applications.
A bit of convention can go a long way."
It's very similar to what yo
when i login to my /admin area, I can see my models on the main model
listing. When I click on a model to add/edit/delete data, I'm getting
a 404. No errors are being thrown. Has anyone else run into
something like this?
--
You received this message because you are subscribed to the Google Gro
2011/3/17 Vinicius Massuchetto :
> Is it possible to generate different fieldsets for admin forms? I
> would like to retrieve different fieldsets for different users.
I managed doing this according to this procedure:
http://stackoverflow.com/questions/687829/django-overriding-get-form-to-customize
I have a model with more than one (3 in fact) ManyToManyFields which
point to the same other model.
As long as I specify distinct related_names for each, all is well.
But the documentation [1] suggests that if I don't need the backwards
relation, then specifying '+' as the related_name should wor
Thanks I took a look and since I tried to initialize my select widget
several different ways while trying the options shown in the initial
portion of the forms fields document I was unable to do it
successfully, without an actual axample which uses a select widget. I
found a way around it anyway th
Nge,
You should check out the excellent django-socialauth project, which can
provide all the hookup you need to authenticate via Facebook (or twitter,
linkedin, and others).
Here is a good article to get started:
http://uswaretech.com/blog/2009/08/django-socialauth-login-via-twitter-facebook-open
Hi, I'm making one app with 3 classes: emploee, company and department.
1- When I edit an emploee I need to know his company, and after to have a
field with all the departments from the selected company. But when I use
ModelChoiceField I see all departments from all companies.
2- Another problem
Hi list : )
I'm having a strange problem. I'm developing a webservice that
communicate with a database.
In my views.py file I'm trying to import models.py to manage some
queries but I got an error in views.py when I import models.py.
ricardo@vulcanus:~/webservices/reviewsapp$ python views.py
Trac
Try changing from:
from reviewsapp.models import Category
to:
webservices.reviewsapp.models import Category
It's all about the PYTHONPATH.
When you use manage.py it configures your environment which allows you
to import in your Django app and the shell.
Shawn
--
You received this me
Try:
from webservices.reviewsapp.models import Category
Bill
On Thu, Mar 17, 2011 at 1:44 PM, Ricardo F. Teixeira
wrote:
> Hi list : )
>
> I'm having a strange problem. I'm developing a webservice that
> communicate with a database.
> In my views.py file I'm trying to import models.py to mana
Here I ahd a piece of code to execute my custom python function
just i executed via python shell ,so i used print statement to know some
values but it does't respond anything
May i know the reason please?
this is the code which i executed successfully
">>> for i in cr:
... tic, mktprice,exp_
I believe you can filter them using ModelAdmin.formfield_for_choice_field.
Check out the docs here:
http://docs.djangoproject.com/en/1.2/ref/contrib/admin/
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
This is a Python Question (not Django)
How are you populating cr? Did you check if there are any rows at all
before looping over the rows?
Regards,
Anurag
On Fri, Mar 18, 2011 at 12:07 AM, NavaTux wrote:
> Here I ahd a piece of code to execute my custom python function
>
> just i executed via p
Hi,
Rather new to Django and using 1.2.5 and Windows, I am hung up trying
to upload a file. I get a post request with request.FILES empty.
My VIEW is:
def intro(request):
c = {}
c.update(csrf(request))
if request.method == 'POST': #see if form submitted
form = FileUploadFor
Hi Bobby,
Maybe some mistake on your url.py, for example if you have an app named
"app" and a model named "model", you'll try to get this url to add a new
"model"
/admin/app/model/add/
Usually, you'll write your urls.py like this:
(r'^app/', include('app.urls')),
(r'^admin/', includ
You are missing the enctype form attribute needed for files input fields. Your
form definition should be:
Check http://www.w3.org/TR/html401/interact/forms.html#adef-enctype for details.
Matías
Excerpts from arapaho's message of Thu Mar 17 15:53:45 -0300 2011:
> Hi,
>
> Rather new to Dja
yeah the urls file looks fine... it only happens randomly but seems tied
to DEBUG=False for some reason... not sure why that would make a difference.
On 03/17/2011 03:09 PM, werefr0g wrote:
Hi Bobby,
Maybe some mistake on your url.py, for example if you have an app
named "app" and a model n
I fixed the earlier issue, which was happening during
serialization, by using add_to_class() class method,
but now I'm running into an issue with deserialize():
[...]
for deobj in deserialize(fmt, val, ensure_ascii=False,
use_natural_keys=True):
File "/usr/local/lib/python2.6/dist-packages/
Hello,
I believe you need related_name, for disambiguation at least. Maybe by
setting a db_table you can bypass the related_name but I'm not convinced.
Actually, I'm "parasiting" your post to ask when "[we]'d prefer Django
didn't create a backwards relation"?
Regards,
--
You received this
I have a list of python objects with attributes, which is supplied to the
django templating engine. I access the first element in the list, to get a
particular attribute 'title', from it. Here is the code:
{{ list|first.title }}
The error given is:
TemplateSyntaxError: Could not parse the remai
Where are you registering your models for the admin site and what does
that code look like?
Casey
On 03/17/2011 03:14 PM, chris hendrix wrote:
yeah the urls file looks fine... it only happens randomly but seems tied
to DEBUG=False for some reason... not sure why that would make a difference.
Hi,
you can try {{ list.0.title }}
Regards,
--
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 group, send email to
django-users+unsubscr...@googlegroup
Ok ... so my main problem is that it's my first Django, Apache, Nginx
instalation ever.
I just don't know where to look when it's about debugging, and not
where in terms of places but order of search.
What I know is mod_wsgi works because I have data in place.
I know that proxy works because of a
Hi,
Please scratch the previous question--I found template errors were the
cause.
Thanks,
Bob
--
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 group, s
On Thu, Mar 17, 2011 at 3:04 PM, maciekjbl wrote:
> Ok ... so my main problem is that it's my first Django, Apache, Nginx
> instalation ever.
I'd say keep it simple. specially on an intranet-only setup where
you're unlikely to need the absolute maximum performance.
the two-server advice is usef
If I have Django running with a wsgi adapter, and I execute a
manage.py command, will it spawn a new instance of Django just to
execute the command, or will it use an existing running instance?
I need to make a decision on writing a command that will be hit pretty
frequently by a node.js applicati
Actually, after snooping around, I was doing something odd to think it
was sharing memory and isn't.
Now, I guess the question stands: is a manage.py script lightweight
enough to be hit frequently without using excess memory on the server?
It looks to be pretty lightweight.
On Mar 17, 4:40 pm, Ma
Hi
I´m new to django and maybe this is a simple thing but I need some
advise what's wrong.
I try to create a project and I have moved the dajango-admin.py to the
Python bin folder but I allways get this result when I´m typing the
following and even if I try django-admin.py --version
C:\DjangoPr
admin models are registered in models.py for each app. Some people say
to use an admin.py file but I've never had to do that before. currently
using:
Django 1.2.3 (mod_wsgi 3.2/Python 2.6) and hosting at webfaction
There's nothing special about the model view. Here's one of them:
---
You set up a 'media.aplikacje' alias in your nginx config, but your
media is still attempting to be pulled from 'aplikacje/media/', so at
this point, your MEDIA_URL is wrong. MEDIA_URL needs to be 'http://
media.aplikacje/'
Or, you can change the server{} config for nginx to have the alias /
media
Thanks, will try that once I get to my computer : )
--
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 group, send email to
django-users+unsubscr...@googl
Hello Glenn,
What operating system are you on? You seem to have tried to use manage.py
correctly, but I suspect this has to do with your Django installation before
you even tried to create a project.
On Thu, Mar 17, 2011 at 11:00 PM, gh wrote:
> Hi
>
> I´m new to django and maybe this is a simp
Please also provide the Django version? Thanks.
On Fri, Mar 18, 2011 at 12:16 AM, Sithembewena Lloyd Dube wrote:
> Hello Glenn,
>
> What operating system are you on? You seem to have tried to use manage.py
> correctly, but I suspect this has to do with your Django installation before
> you even
On Thursday, March 17, 2011 03:16:44 pm Sithembewena Lloyd Dube wrote:
> Hello Glenn,
>
> What operating system are you on? You seem to have tried to use manage.py
> correctly, but I suspect this has to do with your Django installation
> before you even tried to create a project.
>
> On Thu, Mar
Hi Shaw and Bill,
Yeap, I already have done that with no luck.
ricardo@vulcanus:~/webservices/reviewsapp$ python views.py
Traceback (most recent call last):
File "views.py", line 13, in
from webservices.reviewsapp.models import *
ImportError: No module named webservices.reviewsapp.models
Ramirez, you are right. It is django-admin.py, not manage.py. And yes, he's
on Windows (C:\...)
Oh hell! (cue Walter's voice from Jeff Dunham's comedy show)...
Beats me how this doesn't work. Then again, Windows is full of (nasty?)
surprises...
Glenn, try manually adding django-admin.py to your
On Thu, Mar 17, 2011 at 4:00 PM, gh wrote:
> Hi
>
> I´m new to django and maybe this is a simple thing but I need some
> advise what's wrong.
>
> I try to create a project and I have moved the dajango-admin.py to the
> Python bin folder but I allways get this result when I´m typing the
> followin
Hi Django users,
I am having some dilemma over converting simple admin page
*Template*(without having to use the built in django-admin
functionality) by using
forms, and not templates, I have the following sample Admin page that allows
users to add, edit and delete record per row* to Forms*: (Edit
Hi Django users,
I am having some dilemma over converting simple admin page Template
(without having to use the built in django-admin functionality) by
using forms, and not templates, I have the following sample Admin page
that allows users to add, edit and delete record per row to Forms:
(Edit an
You shouldn't be running manage.py from within any other directory but the
top level project directory. That will screw up your PYTHON_PATH and
potentially cause conflicts.
Without seeing anything, if you go up a directory into just ~/webservices
and ran `python manage.py shell`, you should be
Looks like the server is having an issue. Connections on https are timing
out.
And upon looking at the last modified date on the wiki page for it... it
hasn't been updated in 3 years, so I'd safely say it no longer exists and
definitely wouldn't work with any modern version of Django.
--
You
Anyone know why I am getting the following error trying to download
dia2django?
me@computername:~$ wget --no-check-certificate
https://svn.devnull.li/main/pythonware/dia2django/trunk/src/dia2django.py
--2011-03-17 17:22:57--
https://svn.devnull.li/main/pythonware/dia2django/trunk/src/dia2django.
69 matches
Mail list logo