I'm not an expert, actually I've just started looking into the django source
recently. My first idea would be to inherit from the ImageField Field, call
it MyImageField. In MyImageField override the validate method and if the
width isn't what you want, raise a
django.core.validators.ValidationError
Hi Alex,
I am using 0.96 - __str__ did the trick :) Thanks so much for your
help!
On Jan 8, 11:01 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> What version of django do you use? May be you need __str__ method for
> models
>
> On 9 янв, 01:52, Darthmahon <[EMAIL PROTECTED]> wrote:
>
> > Hi Alex
Yes, I am using older self compiled version. Hmm,
Well, lets look at what the new release has now.
Are you people sure when I setup Django on mod_python+Apache+Linux, there
won't be memory issues like what I read about the older mod_python.
Any suggestions to take about during setup or such.
>
Hi,
Interestingly, I wanted to write very similar request, but you passed
ahead of me. :) I'm writing form/questionnaire site for our summer
school and I want to be able render filled forms as text, easy readable
and easy printable. So, my needs are pretty close to yours.
My thought was to defin
On 1/6/08, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> On Sat, 2008-01-05 at 22:43 +0300, Alexander Chemeris wrote:
> > Is there any way to exclude field from being generated by
> > ModelForm, but still be present on admin interface? If I pass
> > 'editable=False' to some element, it is not po
On Tue, 2008-01-08 at 22:45 -0600, Gary Wilson Jr. wrote:
> Malcolm Tredinnick wrote:
> > Hey Gary,
> >
> > On Tue, 2008-01-08 at 00:35 -0600, Gary Wilson Jr. wrote:
> > [...]
> >> So, looking at a couple places in Django trunk where response.content is
> >> used,
> >> these look like bugs:
> >
Thanks Justin,
I seemed to have glanced over that section of the documentation, I'd
realized that the query wasn't actually using the query from
contrib/gis and that explains why!
Thanks again!
Ben
On Jan 8, 2008 8:34 PM, Justin Bronn <[EMAIL PROTECTED]> wrote:
>
> Ben,
>
> > Can anyone help as
Malcolm Tredinnick wrote:
> Hey Gary,
>
> On Tue, 2008-01-08 at 00:35 -0600, Gary Wilson Jr. wrote:
> [...]
>> So, looking at a couple places in Django trunk where response.content is
>> used,
>> these look like bugs:
>>
>>
>> django.contrib.csrf.middleware.CsrfMiddleware.process_response:
>>
>>
On Tue, 2008-01-08 at 22:41 -0500, Ned Batchelder wrote:
> I would think we can make a reasonable semantic that using timesince
> or timeuntil on a time object means that time, today. Joe, is that
> what you expected it to mean? Making this change to the filter would
> turn what is now an erro
On Jan 8, 2008 6:27 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> The only way I know to accomplish this is to modify the admin template,
> and display a link based on the name of the model, as determined by the
> template logic.
> Is this the best way to do this? or is there a cleaner way?
Thin
On Jan 8, 11:29 pm, "Guilherme M. Gondim (semente)"
<[EMAIL PROTECTED]> wrote:
> In generic views, my queryset is cached and I need restart my
> application for get new itens. It is a bug? With default objects
> manager, I don't have this problem.
Hi, I found the problem. Is on my Manager filter:
I would think we can make a reasonable semantic that using timesince or
timeuntil on a time object means that time, today. Joe, is that what
you expected it to mean? Making this change to the filter would turn
what is now an error condition into something useful.
--Ned.
http://nedbatchelder.
On Tue, 2008-01-08 at 11:39 -0800, Joe Murphy wrote:
> I was trying to run some comparisons in a template on a time, took a
> look at the utils/timesince.py code, ran some more tests, read the
> doco again, saw that the doco didn't mention timesince / timeuntil
> handling time objects, and though
Tim Chase wrote:
Well, if you define a get_absolute_url() method on your model,
according to
http://www.djangoproject.com/documentation/model-api/#get-absolute-url
it will add a link to the admin page for you. However, this
makes a bit of a grating abuse of the system, as it is _supposed_
to b
Hey Gary,
On Tue, 2008-01-08 at 00:35 -0600, Gary Wilson Jr. wrote:
[...]
> So, looking at a couple places in Django trunk where response.content is used,
> these look like bugs:
>
>
> django.contrib.csrf.middleware.CsrfMiddleware.process_response:
>
> def process_response(self, request, respo
On Jan 8, 2008 9:21 PM, Lucas Di Pentima <[EMAIL PROTECTED]> wrote:
>
> 2008/1/9, Karen Tracey <[EMAIL PROTECTED]>:
>
> > Looks like it was a bug, fixed in October:
> >
> > http://code.djangoproject.com/changeset/6578
> >
> > So, you shouldn't see the problem if you switch to using an SVN checkout
2008/1/9, Karen Tracey <[EMAIL PROTECTED]>:
> Looks like it was a bug, fixed in October:
>
> http://code.djangoproject.com/changeset/6578
>
> So, you shouldn't see the problem if you switch to using an SVN checkout
> instead of 0.96.
Thanks Karen! I'm trying to use the most stable version, which
> I have a view that will generate a pdf based on one of my objects.
> I'd like to have a link to this view from the admin interface.
> The only way I know to accomplish this is to modify the admin template,
> and display a link based on the name of the model, as determined by the
> template log
On Jan 8, 2008 6:33 PM, Lucas Di Pentima <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'm a Django newbie trying to learn this wonderful framework, so if
> my question is too obvious, please bear with me :-)
>
> I'm learning how to use the newforms from Django 0.96, as it comes
> installed on a Deb
If I have a Manager like below:
class CurrentSitePublishedManager(CurrentSiteManager):
def get_query_set(self):
return super(CurrentSitePublishedManager,
self).get_query_set().filter(is_draft=False,
pub_date__lte=datetime.now())
And this "info" dictionary:
info_dict = {
How can you validate that an ImageField's width is <= a maximum in
pixels?
--~--~-~--~~~---~--~~
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 un
I have a view that will generate a pdf based on one of my objects.
I'd like to have a link to this view from the admin interface.
The only way I know to accomplish this is to modify the admin template,
and display a link based on the name of the model, as determined by the
template logic.
Is th
oh man I didn't even consider that, kinda makes me wonder if anyone
has ever run the code !
thanks, I'll rename and try again.
On Jan 8, 3:24 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> Python module names cannot include hyphens, so
> 'django-pyodbc.db.mssql' is not a valid Python module na
Hi all,
I'm a Django newbie trying to learn this wonderful framework, so if
my question is too obvious, please bear with me :-)
I'm learning how to use the newforms from Django 0.96, as it comes
installed on a Debian GNU/Linux Lenny (testing), I'm playing around
with the SpliDateTimeField:
---
On Jan 8, 11:36 pm, "Ravi Kumar" <[EMAIL PROTECTED]> wrote:
> I am sorry. I mean to say "Django on Apache" has some memory overusage and
> leak problem due to mod_python or whatever :)
To repeat was Kenneth said but in respect of your clarification,
'where did you hear this? It is not true. '. :-
What version of django do you use? May be you need __str__ method for
models
On 9 янв, 01:52, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> Thanks - no error now, but it prints this:
>
> Platform object
>
> How can I get it to print the title for this platform?
>
> On Jan 8, 10:01 pm, Alex
Hi Alex,
Thanks - no error now, but it prints this:
Platform object
How can I get it to print the title for this platform?
On Jan 8, 10:01 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> My mistake, colon needed after "join"
>
> {{game.platforms.all|join:", "}}
>
> On 9 янв, 00:49, Darthmahon <
There is no way to do it in urls.py. But you may write wrapper view
that will filter queryset and then pass it to generic view.
On 9 янв, 01:19, "Shishir Ramam" <[EMAIL PROTECTED]> wrote:
> I'd like to pass a parameter from a url to a query set of a generic view.
>
> Something like the following.
I'd like to pass a parameter from a url to a query set of a generic view.
Something like the following. I'm not sure if this is possible, but would
appreciate any tips
on how this can be accomplished.
thanks,
-shishir
my_info_dict = {
'queryset': my_model.objects.filter(field_name=field_value
My mistake, colon needed after "join"
{{game.platforms.all|join:", "}}
On 9 янв, 00:49, Darthmahon <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> I want to do what you've shown me; print a list of games with the name
> of the platform(s). I've been trying to find an answer to this in all
> of the doc
Hi Alex,
I want to do what you've shown me; print a list of games with the name
of the platform(s). I've been trying to find an answer to this in all
of the docs but the examples given never use real-world examples and
everything seems to be done on the Python shell, which is now how I am
using i
What are you want to do? Do you read docs?
The view's code is very strange. So many times appears word "list".
May be you what get all games with platforms, so
def games(request):
games = Game.objects.all()
return render_to_response('games/games.html',
{ 'games':games }, context
Hey,
Can't get my head around this. Basically I have a model that includes
a manytomany field like this:
##
File: /games/models.py
##
class Platform(models.Model):
title = models.CharField(maxlength=30)
def __unicode__(self):
So you get are getting 1000 records back in javascript, then doing the
filtering in Javascript down to 100? But instead you want to have your ajax
code talk to a view that will return you just the 100 records that you want?
Makes sense to me.
Would you mind sharing your javascript code with me? I'
On Jan 8, 3:27 pm, Sebastian Macias <[EMAIL PROTECTED]>
wrote:
> Basically what I'm looking forward is be able to have a schema-less
> model.
Perhaps this write up will help:
http://code.djangoproject.com/wiki/DynamicModels
-Rajesh D
--~--~-~--~~~---~--~~
You rec
Basically what I'm looking forward is be able to have a schema-less
model.
Sebastian Macias wrote:
> Hello,
>
> I need to be able to build custom questionnaires with yes/not options,
> multiple options and free text options. The answers must be
> searchable:
>
> I need to query users that took qu
Python module names cannot include hyphens, so
'django-pyodbc.db.mssql' is not a valid Python module name regardless
of whether you have the code on your system. Try renaming the module
to not include a hyphen.
Also, make sure you're using a recent SVN checkout of Django; the
ability to use exter
Hi!
I just setup a new Slicehost slice, built with Ubuntu 7.10 Server
edition.
I'm using Django with Lighttpd, flup for fastcgi, mysql with python-
mysqldb
Here is the software I needed. I left off a few bits, but hopefully
you'll find this useful.
Feel free to post this on your site.
Some of t
Thanks for all the info!
I changed to a Ubuntu setup 7.10, got the right headers, and
everything is working great.
I'll post a howto shortly.
Ivan
On Jan 7, 4:45 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-01-07 at 15:03 -0800, [EMAIL PROTECTED] wrote:
> > Grabbing the 1.2
Help, I followed the install instructions but still get the following
error:
django.core.exceptions.ImproperlyConfigured: 'django-pyodbc.db.mssql'
isn't an a
vailable database backend. Available options are: 'ado_mssql',
'dummy', 'mysql',
'mysql_old', 'oracle', 'postgresql', 'postgresql_psycopg2
Hello,
I need to be able to build custom questionnaires with yes/not options,
multiple options and free text options. The answers must be
searchable:
I need to query users that took quiz 1 and selected option a and b in
question x, took quiz 2 and selected option c or d for in question y.
Perfo
I was trying to run some comparisons in a template on a time, took a
look at the utils/timesince.py code, ran some more tests, read the
doco again, saw that the doco didn't mention timesince / timeuntil
handling time objects, and thought: Hey, I bet that was on purpose,
but maybe this was somethin
Global Property Mortgage
Global Property are bond brokers, they specialize in obtaining
financing on behalf of their clients from different banks in the form
of a bond (mortgage) over their property. They also specialise in
getting non-banking business finance for start up and current
businesses.
Graham Dumpleton wrote:
> On Jan 8, 8:50 am, ryan k <[EMAIL PROTECTED]> wrote:
>> I used svn propset svn:external so my project (in transition to
>> another developer when I return to college) can easily use the most
>> recent version fo Django (and comment_utils, etc). How can I ensure
>> that t
On Jan 8, 2008 12:14 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> Another dirty solution would be to simply create a user account, and
> give it permissions to only view things. I haven't played with
> permissions at all, but I imagine it would be possible.
> The correct way is still to write yo
Hello,
I developed an AWESOME django website and everything works great
except for one MAJOR problem!!
I have the following models:
class Collection(models.Model):
name = models.CharField("Name", maxlength=200)
description = models.TextField(maxlength=1000, blank=True)
class Choice(mode
James Bennett wrote:
On Jan 8, 2008 10:17 AM, Nader <[EMAIL PROTECTED]> wrote:
I have looked while for a answer to my problem but unfortunately I
haven't found a one, maybe I had to spend more time. However I have a
project with some applications. By using of Admin we can Create, Read,
Updat
>> one application I would like only to read the model and could not
>> use Create, Update and Delete capabilities. Would somebody tell me
>> how I can solve this problem by using of Admin interface?
>
> As you'll find by searching the archives of this list, this is not
> something the Django a
Look at the databrowse application
http://www.djangoproject.com/documentation/databrowse/
On 8 янв, 19:17, Nader <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have looked while for a answer to my problem but unfortunately I
> haven't found a one, maybe I had to spend more time. However I have a
> pr
On Jan 8, 2008 11:16 AM, l5x <[EMAIL PROTECTED]> wrote:
> This should help you:
> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
No.
That's a nasty, ugly, horrible hack that's about fifty times more
complicated than what's actually needed to do this. He got it right
the first tim
On Jan 8, 3:03 am, Car <[EMAIL PROTECTED]> wrote:
> Hello
>
> I have following code;
>
> class PlaceForm(ModelForm):
> class Meta:
> model = Place
> exclude = ('useradd',) #excluded, because form shouldn't give
> a way to set user manually
>
> Model Place has one foreign key to
On Jan 8, 2008 10:17 AM, Nader <[EMAIL PROTECTED]> wrote:
> I have looked while for a answer to my problem but unfortunately I
> haven't found a one, maybe I had to spend more time. However I have a
> project with some applications. By using of Admin we can Create, Read,
> Update and Delete (CRUD
Ben,
> Can anyone help as to why I can't load my points? Is it a MySql problem?
>
No, it is not a MySQL problem. This didn't work because you forgot to
set the model manager to use the `GeoManager`, i.e., you didn't add
`objects = models.GeoManager()` to both your UserProfile and Lcoation
model
On Jan 7, 2008 8:03 PM, Car <[EMAIL PROTECTED]> wrote:
> Is it possible to add field formerly excluded in ModelForm in view
> like in this example below:
Yes, but you're not "adding a field". You're simply getting back a
model object and then you're 100% done with the ModelForm. What you do
with
Hello,
I have looked while for a answer to my problem but unfortunately I
haven't found a one, maybe I had to spend more time. However I have a
project with some applications. By using of Admin we can Create, Read,
Update and Delete (CRUD) models information in the project. But in
one applicati
On Jan 8, 2008 12:47 AM, Michael Hipp <[EMAIL PROTECTED]> wrote:
> How do I say "no thanks" to this helpfulness so my html can to thru?
By reading the Django template documentation, which covers this in some detail.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct
Am Dienstag, 8. Januar 2008 14:10 schrieb Alex Koshelev:
> Simpliest way is to patch model class at applications loading time:
>
> #somewhere in your own models.py file of some app
> from django.contrib.auth.models import User
>
> def user_unicode(self):
> return '%s: %s %s' % (self.username,
On Jan 8, 2008 8:24 AM, Grindizer <[EMAIL PROTECTED]> wrote:
> Hello.
> I have a project with at least 2 applications
> A, which define ModelA1, ModelA2, ModelA3 (and other).
> B, which define ModelB1, ModelB2.
>
> And I have these dependencies:
> In A:
> - ModelsA1 need as a foreign key ModelB1
Oops. So it is.
Thanks for the clarification.
On Jan 7, 1:10 pm, Simon Willison <[EMAIL PROTECTED]> wrote:
> On Jan 7, 5:07 pm, Wes Winham <[EMAIL PROTECTED]> wrote:
>
> >http://www.pointy-stick.com/blog/2008/01/06/django-tip-complex-forms/
>
> > A shiny solution to the problem with code and the
hehe, thanks!
you know i did not have 'password_change' view, this is import from
standard model of django_registeration.
i found how resolved it now, just change the template name to
pw_change_form.html, maybe password_change_form.html is the same as
admin site.
though my problem is ok now, i s
Its very strange that so "hard linked" applications can produce clean
and logic architecture:)
1. Try to split your A's models.py into 2 files. A1, A2 in first file.
A3 in second file. In first models file import second with
wildcard(*). In B models.py import only second A file. It's only
suggest
Standard django.contrib.admin.views.auth.user_change_password cannot
be customized with user defined template.
What is inside *your* 'password_change' view?
On 8 янв, 16:31, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> i found the view is the same as we click Change password in the admin
>
I did that.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For
Hello,
I've finally started using the django-gis branch, which looks perfect
for me needs, however I am currently having a database persistence
problem.
I have a simple model which maps a point to a UserProfile model. This
is in a separate table as spacial indexes can't be Null and I want to
kee
i found the view is the same as we click Change password in the admin
site, so maybe auth_password_change links to the default template
file, but why login.htm can be customered with the same url
stucture.
On 1月8日, 下午9时22分, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> Show code of 'password_
Hello.
I have a project with at least 2 applications
A, which define ModelA1, ModelA2, ModelA3 (and other).
B, which define ModelB1, ModelB2.
And I have these dependencies:
In A:
- ModelsA1 need as a foreign key ModelB1
- ModelsA2 need ModelB2 (ManyToManyField)
In B:
- ModelB2 need ModelA3 (F
Show code of 'password_change' view
On 8 янв, 16:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> sorry, this is just the type error.
>
> it is still in strange after i changed to the correct url.
>
> On 1月8日, 下午9时13分, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > Your url conf says:
> > r'^
Read docs
http://www.djangoproject.com/documentation/
all topics are covered there.
On 8 янв, 08:35, "Ravi Kumar" <[EMAIL PROTECTED]> wrote:
> Hi,
> This is my First post to the group. I started devotion to Python recently,
> and now I have to implement Django (which came out to be something I wa
sorry, this is just the type error.
it is still in strange after i changed to the correct url.
On 1月8日, 下午9时13分, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> Your url conf says:
> r'^password_change/$',
>
> but you tries to check:
> /password/change/
>
> Very strange, really?
>
> On 8 янв, 15:53,
Your url conf says:
r'^password_change/$',
but you tries to check:
/password/change/
Very strange, really?
On 8 янв, 15:53, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> i have this in one urls.py:
> url(r'^login/$', auth_views.login,{'template_name': 'registration/
> login.html'},name='aut
Simpliest way is to patch model class at applications loading time:
#somewhere in your own models.py file of some app
from django.contrib.auth.models import User
def user_unicode(self):
return '%s: %s %s' % (self.username, self.first_name,
self.last_name)
User.__unicode__ = user_unicode
On
i have this in one urls.py:
url(r'^login/$', auth_views.login,{'template_name': 'registration/
login.html'},name='auth_login'),
(r'^password_change/$', 'password_change',
{'template_name':'registration/password_change_form.html'},
'auth_password_change'),
this 2 url is the same structure. when
I'd probably put it in my models file.
Michael
Thomas Guettler schrieb:
> Hi,
>
> our customer wants to display the username as 'username: firstname
> lastname'
>
> The easiest way would be to overwrite User.__unicode__. But where
> should you put code like this? Up to now I put it in our mid
I am sorry. I mean to say "Django on Apache" has some memory overusage and
leak problem due to mod_python or whatever :)
But i did read those docs. Suggestion were to restart (using cron, stop then
start rather than restart) to release those. So if this is true, is there
any way to command it.
Any
Hi,
our customer wants to display the username as 'username: firstname lastname'
The easiest way would be to overwrite User.__unicode__. But where
should you put code like this? Up to now I put it in our middleware.
Any comments, or better solutions?
# middleware.py
import new
from django.cont
here r the new & latest pc softwares for u
hurry up log on to http://wincommunications.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
On 1/7/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> i user django-register in my project,it is fatastic, but how to:'
> 1. restrict username length must more than 5 words
> 2. make sure email is unique.
I haven't heard of django-register, but maybe you mean django-registration?
If so, ther
yes, thanks Peter.
i maybe need to read the user module's code, change the code and keep
updating it when django updated.
or i can write a ajax code to check user data.
On 1月8日, 上午12时33分, Peter Rowell <[EMAIL PROTECTED]> wrote:
> > i user django-register in my project,it is fatastic, but how t
pinco wrote:
> Hi,
>
> I'm trying to figure out how to solve the following issue without
> succeed.
>
> I have a model like this:
>
> class Product(models.Model):
>...
>measure_cm = models.FloatField(...)
>measure_in = models.FloatField(...)
> ...
>
> The fields contain the same info
Thanks Maarten, so can I still then iterate through the songs in my
template file?
On Jan 8, 10:00 am, Maarten <[EMAIL PROTECTED]> wrote:
> Hello
>
> """
> def songs(request):
> songs_listing = []
> for songs_list in Song.objects.all():
> songs_dict = {}
>
Hello
"""
def songs(request):
songs_listing = []
for songs_list in Song.objects.all():
songs_dict = {}
songs_dict['list_object'] = songs_list
songs_listing.append(songs_dict)
return render_to_response('songs/songs.html',
{ 's
Ahh ok I saw that and thought it might be useful. Can I have more than
one ManyToMany field in my custom user profile model? I.E. if a user
has a list of songs and groups, for example?
Just reading about ManyToMany - it seems to create an intermediary
join table - is this exactly what I am trying
Another option is to create a user profile class (http://
www.djangoproject.com/documentation/authentication/#storing-additional-information-about-users),
and have that user profile class have a ManytoManyField(http://
www.djangoproject.com/documentation/model-api/#many-to-many-relationships)
with
Hi,
zodman wrote:
> when a sumbit something on the admin interface of django haves this warning:
>
> http://dpaste.com/30234/
>
> http://dpaste.com/30235/
>
> ever as the same a column 'message' on auth_message table.
>
> im drop the database an gen again with syncdb
try to recreate your mys
I'm converting a Visual Basic program to run as a Django app, and I
need some advice on how to go about doing it, whether or not it's
possible of feasible, etc.
Basically, I need to turn the VB form linked below into a web form.
I've got several reasons for this including improved version control
when a sumbit something on the admin interface of django haves this warning:
http://dpaste.com/30234/
http://dpaste.com/30235/
ever as the same a column 'message' on auth_message table.
im drop the database an gen again with syncdb
ii python-mysqldb 1.2.1-p2-4 A Python inter
Hi Ivan,
Thanks for the reply. Ok that makes sense, but I'm assuming I would
then have to query the database again to get the name of that game for
each result that is returned? This sounds like a lot of queries just
to get a list - this is something I would usually handle by doing a
JOIN query,
87 matches
Mail list logo