On Sat, Feb 13, 2010 at 2:00 AM, Kevin Audleman wrote:
> Django 1.2
>
> I'm attempting to write my first custom Field Type. Eventually it will
> do something more complicated, but for now I am simply sub-classing
> the CharField. The first thing I'm doing is trying to change the
> default form fie
Django 1.2
I'm attempting to write my first custom Field Type. Eventually it will
do something more complicated, but for now I am simply sub-classing
the CharField. The first thing I'm doing is trying to change the
default form field to be a MultipleChoiceField.
I followed the directions here:
ht
Thanks for the reply,
In my opinion, upload_to like the name suggests should point to the
directory to upload the file, i didn't unterstand why the mix of
directory with the filename in the callable..
I think they are two separate things..
upload_to should handle the directory, and the storage sh
On Sat, Feb 13, 2010 at 12:09 AM, Gleber wrote:
> I don't know if this is a bug.. Here is the minimal test case:
>
> class CustomStorage(FileSystemStorage):
> def get_valid_name(self, name):
> import random
> return '%s.abc' % (random.randint(100, 999),)
>
> def test_uploadto(self,f
I don't know if this is a bug.. Here is the minimal test case:
class CustomStorage(FileSystemStorage):
def get_valid_name(self, name):
import random
return '%s.abc' % (random.randint(100, 999),)
def test_uploadto(self,filename):
return 'aaa/%s' % filename
testA = models.FileF
On Fri, Feb 12, 2010 at 11:48 PM, Thanh Nguyen wrote:
> Hi,
>
> I'm maintaining a website which was developed based on Django 0.97 (extra
> packages: basic, tagging).
> I've searched to get that specific version of Django but no results yet.
> I've also tried several revisions of Django svn (from
Hi,
I'm maintaining a website which was developed based on Django 0.97 (extra
packages: basic, tagging).
I've searched to get that specific version of Django but no results yet.
I've also tried several revisions of Django svn (from 2007-08-01 to
2008-07-22) but still got some errors from backward
On Fri, Feb 12, 2010 at 4:34 PM, Umapathy S wrote:
> Hello,
>
> I am looking for the admin site url name to be included as a link in a home
> page template.
>
> I looked at contrib/admin/sites.py
>
> AdminSite sets self.name which is then passed to
>
># Admin-site-wide views.
> ur
On Fri, Feb 12, 2010 at 10:41 PM, Rob Hudson wrote:
> Can you test it by disabling the debug toolbar middleware? I've
> duplicated your exact settings as much as I can and it's working for
> me. If disabling the middleware makes the admin appear, then it would
> seem something in the toolbar is
On Fri, Feb 12, 2010 at 3:38 PM, Paul Rubel wrote:
> [snip]
I can't get a test.client.Client.post()s raw_post_data to match what I
> get using my browser and the test throws an exception about reading
> more than the available bytes.
>
> Printing out the raw_post_data when my app is running unde
I have recently upgraded to the beta 1.2 release and I am having a
problem with the ordering in the admin. One of the tables is large,
so I don't want an order by clause in the generated sql. There is one
join in the generated query (due to a foreign key ref), but it also
contains an order by on
On Feb 12, 5:03 pm, pbzRPA wrote:
> The middleware looks good. Is your browser maybe not blocking cookies?
> I have really though hard about it, but without code it's really
> difficult to get a picture of where the problem may lie. You also said
> you do custom authentication, then why is it th
It looks like you might want to create a custom Manager class. As you alluded
to, you definitely don't want to have to assume that every function that
touches your models is doing all the required checking.
http://docs.djangoproject.com/en/1.1/topics/db/managers/
I didn't really know what a Man
So yur saying I'd need to go around checking sessions every so often
to see if they valid if they aint then I can update stuff. Is there an
api to access all sesiion data as admin or do I need to read the cache
or database backend
Andy McKay wrote:
> On 2010-02-06, at 4:08 PM, adamjamesdrew wrote:
The middleware looks good. Is your browser maybe not blocking cookies?
I have really though hard about it, but without code it's really
difficult to get a picture of where the problem may lie. You also said
you do custom authentication, then why is it that you printing out the
request in the django
On Feb 12, 4:33 pm, pbzRPA wrote:
> Can you please add a dump of your MIDDLEWARE_CLASSES as it is in your
> settings file.
Sure, here it is:
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.
Can you please add a dump of your MIDDLEWARE_CLASSES as it is in your
settings file.
--
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 t
On Feb 12, 3:57 pm, pbzRPA wrote:
> It's going to be difficult to help you out if you using a custom
> authentication.
>
> Take a look at this comment from the django site and tell me if you
> following these rules in your custom authentication.
>
yes, django.contrib.auth.authenticate() is cal
Hi group,
On my ubuntu server I'm using pinax 0.71 and for deployment I used
this tutorial
http://pinaxproject.com/docs/dev/deployment.html#sending-mail-and-notices
The emailsettings are:
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = $$
EMAIL_HOST_PASSWORD = $$
EMAIL_PORT = 587
EMAIL_USE_TLS
It's going to be difficult to help you out if you using a custom
authentication.
Take a look at this comment from the django site and tell me if you
following these rules in your custom authentication.
"""
Calling authenticate() first
When you're manually logging a user in, you must call authent
Hi,
I don't actually have a problem but rather a need for a suggestion. I
am building a web application and in order to demo the site on one
database I have a need to secure the data for each user. I have a
field in each model that is a foreign key to a unique field on the
User model. The tricky p
Any. Advice thank you
--
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.com.
For more options,
Another post because I think I explain my issue a little better
here...
in my case:
1) a successful log in results in a call to a HttpResponseRedirect
that goes straight to the web page I'm specifying.
2) I checked right before this HttpResponseRedirect is called, and the
User object that was r
Hello,
I am looking for the admin site url name to be included as a link in a home
page template.
I looked at contrib/admin/sites.py
AdminSite sets self.name which is then passed to
# Admin-site-wide views.
urlpatterns = patterns('',
url(r'^$',
wrap(se
Hi!
I would like to set up some database servers in Django 1.2, and then
use them in this way: when a new request comes, i choose a server
manually, and then use this ONLY ONE server in that request. I don't
want to pass around parameters, which server i chosen, so somehow, i
would like to make th
Hi,
This is my first django project and I'm trying write some tests. So
far the experience has been good and I've been able to get by using
the documentation and blog posts. Thanks for all of the work that went
into django. I'm using django 1.1.1 with python 2.6.4 on x86_64
linux.
I have a few
some more info...
I added "django.core.context_processors.request" to
TEMPLATE_CONTEXT_PROCESSORS
Based on my code below, it seems like the session is storing the
correct user ID for the user that just logged in (I confirmed this by
changing the user ID in the database manually), but for some re
> per my other appropriations
oppropriations
friggin' spell checker!
--
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-user
On Feb 12, 1:54 am, bruno desthuilliers
wrote:
> On Feb 12, 9:40 am, paul wrote:
>
> > hi -- after I do a login that successfully goes through a custom
> > authenticate() and django login(), I get redirected to a web page that
> > is build off of a template that prints out the value of
> > {{ u
I tend to think that all diagnostics should reveal as much as they can
about their situation. So I bumped get() like this:
def get(self, *args, **kwargs):
...
clone = self.filter(*args, **kwargs)
...
if not num:
raise self.model.DoesNotExist("%s matching query does
I would take a different tack. Store my videos is a service such as
Vimeo and then link to their generated thumbnails.
I'm doing that using django-picasa (http://pypi.python.org/pypi/django-
picasa/1.2). The code might give you an idea now how do it. I'd also
serve up my videos from them and save m
On Fri, Feb 12, 2010 at 10:13 AM, bruno desthuilliers
wrote:
> Anyway... an index on "archived" may do more harm than good. To be
> really useful, an index needs to be as discriminating as possible
what i usually do is not an ('archived') index, but a
('archived','lastmsg_timestamp'), or somethin
Well I can answer the last bit of your question at least.
There are 2 basic field types Form Field & Model Field. Form fields
are used in form classes where as Model Fields are used in Models.
Model fields handle the normalization of python objects to data
suitable for storage in your database an
On Feb 12, 9:52 am, Tomas Kouba wrote:
> Dear django users,
>
> I have a design problem with my model.
> I have a class that has one attribute "archived". Records with archived==False
> are accessed much more often than archived==True.
> The number of records with archived==True is much higher.
Can you test it by disabling the debug toolbar middleware? I've
duplicated your exact settings as much as I can and it's working for
me. If disabling the middleware makes the admin appear, then it would
seem something in the toolbar is causing the problem.
And you are right... those settings you
On 12 February 2010 11:26, chiranjeevi muttoju
wrote:
> Hi,
> When i'm using the session in django i'm getting this error relation
> "django_session" does not exist. what is that error.. if any one of u know
> please help me..
> My code is:
>
from django.contrib.sessions.backends.db import Se
Have you created a Postgres database?
On Feb 12, 4:38 am, Newbie wrote:
> Dear all,
>
> Downloaded and followed the steps which is given in the
> documentation of Django
> Created the project called mysite
> Created the model called polls
> Ratified the set
Hi,
When i'm using the session in django i'm getting this error relation
"django_session" does not exist. what is that error.. if any one of u know
please help me..
My code is:
>>> from django.contrib.sessions.backends.db import SessionStore
>>> s = SessionStore(session_key='2b1189a188b44ad18c35e1
Dear django users,
I have a design problem with my model.
I have a class that has one attribute "archived". Records with archived==False
are accessed much more often than archived==True.
The number of records with archived==True is much higher.
Other attributes (db columns) are the same for bo
Did You start python shell from project directory ??
python manage.py shell
On Fri, Feb 12, 2010 at 1:42 PM, Newbie wrote:
> thanks for your reply..
> When I updated the postgresql version , the tables are created
> successfully.
>
> Now I faced another problem.
> When I start to store
The other thing you may want to consider is whether you need to cache
the entire page or not. When users change some data, if it doesn't
change everything you could use template fragment caching, and just
delete the relevant bits when data is changed. Otherwise you could use
lower level caching in
thanks for your reply..
When I updated the postgresql version , the tables are created
successfully.
Now I faced another problem.
When I start to store a data in the model through the methods of the
class , the following error is get.
>> from mysite.polls.models import Poll,Choice
>>> Pol
First, the code of my tests.py
def test_get_current(self):
m = Member.objects.create(...)
q = Question.objects.create(name="q1", text="q1",
start_datetime=self.day_before, close_datetime=self.day_after,
type=self.type)
r = Response.objects.create(question=q, text='response')
expect
I'd also recommend working through "The Django Book"
http://www.djangobook.com/en/2.0/
This section entitled "Using Sessions in Views", from this URL:
http://www.djangobook.com/en/2.0/chapter14/
seems relevant to what you are trying to do.
On Feb 10, 7:00 am, Keyan wrote:
> I am new to django!!
Pardon my obtuseness, but I don't understand exactly what you
mean here.
When you say "no, but..." - do you mean it _is_ do-able as per the
method you outline here?
In the:
return super(ReqionAdmin, self).queryset(request).filter(...)
what goes in the "..." part?
Thanks.
On Feb 11, 12:25 pm,
OK, here are the stuff ive discovered so far.
I did the silly mistake of putting in the htaccess file..
If you are setting up a django app setting with htaccess you dont need
the tag. Just the directives inside.
Also the Python directives are not recognised because the mod_python
is not install
On Feb 12, 11:24 am, bruno desthuilliers
wrote:
(snip)
oops, forgot to actually use the custom manager:
> class MyModelRevision(models.Model):
(snip)
objects = MyModelRevisionManager()
> class Meta:
> unique_together = (('MyModel', 'published'),)
--
You received this message
On Feb 11, 10:27 pm, Margie Roginski wrote:
> I have a question about debugging django server side code in the case
> where the request is an ajax request.
>From the server-side POV, a request is a request is a request. Truth
is : there's no such thing as an "ajax request".
> For example I have
On Feb 11, 11:23 pm, iliveinapark
wrote:
> Gday all,
>
> I'm trying to find a way to have changes made to a model object
> require approval before becoming the live data on my site. I had
> thought about cloning the object, and having the clone stored as a
> draft, but making it live would require
On Feb 12, 6:40 am, paul wrote:
> hello -- just let me know if my description below sounds like a bug.
> If so, I can try to put together a decent bug report...
>
> I am working on fleshing out the integration of a custom
> authentication backend. Basically I have a OpenLDAP directory that is
> u
On Feb 12, 9:40 am, paul wrote:
> hi -- after I do a login that successfully goes through a custom
> authenticate() and django login(), I get redirected to a web page that
> is build off of a template that prints out the value of
> {{ user.is_authenticated }}. This always returns False, and aft
I have managed to install django to a certain extend. What i did was
downloaded (wget) django to the server. Decompressed it and then the
run:
python setup.py install --home
That way the django packages were installed in my folder. It worked
for a while (import django) but now it has stopped. I th
Feel free to download any of the images. Just right click and Save
As... VALENTINE'S DAY. IMAGES, BACKGROUND, BORDERS ... You can select
among 200+ images. ..
http://www.adbrite.com/mb/commerce/purchase_form.php?opid=1003278&afsid=1
http:
hi -- after I do a login that successfully goes through a custom
authenticate() and django login(), I get redirected to a web page that
is build off of a template that prints out the value of
{{ user.is_authenticated }}. This always returns False, and after
more interrogation I discovered that us
54 matches
Mail list logo