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
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
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
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
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
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
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?
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
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.
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
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,
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
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,
> 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
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
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
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
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
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,
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
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 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
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
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 },
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?
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
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
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
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
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
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',
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.
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
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
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
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
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
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,
>> 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
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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:
> >
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/
>
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
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
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
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
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,
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
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
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',
{
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
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)
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
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
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
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,
83 matches
Mail list logo