On Oct 1, 11:21 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> Assuming you are actually using Django 1.0, you'll need to keep in mind that
> some things have changed (forms & admin definitions are two biggies) between
> what the book is describing and the version you are using. In cases where
>
2008/10/2 Jarek Zgoda <[EMAIL PROTECTED]>:
> Anyway, I seem to be unable to change ordering of FKs relating to User
> object. Any hint?
So, suppose you have the following model, a simple user profile:
from django.contrib.auth.models import User
from django.db import models
class UserProfile(mod
On Oct 2, 3:41 pm, "Patrick J. Anderson" <[EMAIL PROTECTED]>
wrote:
> I'm running mod_wsgi, and I'm wondering if anybody else who uses mod_wsgi
> has experienced problems with Django directing requests to 500.html
> template when the server returns 500 status code.
>
> Is there any configura
On Oct 1, 9:55 pm, Denis Morozov <[EMAIL PROTECTED]> wrote:
> Try
> {% if form.errors %}
> Your username and password didn't match.
> Please try again.
> {% endif %}
This is working, thank you :-)
--~--~-~--~~~---~--~-
Wiadomość napisana w dniu 2008-10-02, o godz. 01:03, przez Rock:
> Have you tried setting the order within your model? I think that is
> the only simple way to tackle this at this time.
>
>class Meta:
>ordering = ("fruit",)
This will change default ordering across the whole site. To
Wiadomość napisana w dniu 2008-10-02, o godz. 09:11, przez James
Bennett:
>> Anyway, I seem to be unable to change ordering of FKs relating to
>> User
>> object. Any hint?
>
> class UserProfileForm(forms.ModelForm):
>user =
> forms.ModelChoiceField(queryset=User.objects.order_by('userna
Hello there,
I'm in need of some kind of validation at model level (and don't have
time to wait till 1.1 lands). Now I'm doing it by raising exceptions
in save method (I know how ugly it sounds).
What can I do to propagate those exceptions to forms or handle them at
some user-friendly level (so a
On 2 oct, 07:36, John Allen <[EMAIL PROTECTED]> wrote:
> Bruno,
> Thanks, this helps a lot.> > > While we're at it : what's your use case for
> adding the domain name to
> > > > the url ?
>
> > > I'm doing this in a custom tag to produce a sidebar menu of recent
> > > posts.
>
> > Recent posts
On 2 oct, 07:33, Travis Parker <[EMAIL PROTECTED]> wrote:
> Instead of calling render_to_response on an empty template file you
> could simply return an empty django.http.HttpResponse and avoid the
> templating system overhead.
>
> I would generally send *something* in the response, even if just
This is best explained by example.
Let's say you have two models, Foo and Bar, both under version control.
>>> class Bar(models.Model):
... pass
...
>>> class Foo(models.Model):
... bar = models.ForeignKey(Bar)
If you save an instance of Foo, then the primary key of the referenced
Ba
I have just posted this in the dev group, but it should interest users
too:
http://groups.google.com/group/django-developers/browse_frm/thread/5611a45dc23f6e06
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django u
Hi,
if used in a view called from a http request, reverse() returns the
URL with SCRIPT_NAME (e.g. /my-wsgi-scriptalias/myview/)
But if I call it from the shell, there is no SCRIPT_NAME since there
is no http request.
But if FORCE_SCRIPT_NAME is set, I think reverse() should use it. But
it only
On Thu, 2008-10-02 at 11:24 +0200, Thomas Guettler wrote:
> Hi,
>
> if used in a view called from a http request, reverse() returns the
> URL with SCRIPT_NAME (e.g. /my-wsgi-scriptalias/myview/)
>
> But if I call it from the shell, there is no SCRIPT_NAME since there
> is no http request.
>
>
Hey everyone,
I have the following:
[snip]
def people_json(request):
userobjects = User.objects.filter(is_superuser=False).extra(order_by
= ['auth_user.username+0'])
p = Paginator(userobjects, 10)
pagenumber = request.POST.get('pagenumber', 1)
try:
Ok after a few hours of experimenting and reading posts on here I
finally got it working on OS X
when installing django-cms make sure to COPY the
/projectname/media/admin/cms files (admin.css cmslayout.css
DateTimeShortcuts.js etc..) to
/django_trunk/django/contrib/admin/media/
into a "cms" folde
There is a SQLAlchemy DB backend for Django that allows you to write
Django ORM models on top of a SQLAlchemy ORM layer. But that's just if
you need the Django ORM. For example if you want to use a database
engine that is not supported by Django but is supported by SQLAlchemy.
Or I guess i
2008/10/2 David Hall <[EMAIL PROTECTED]>:
> Marek Stępniowski wrote:
>> How does django-reversion deal with relationships between Django models?
>>
>> Version-controlling relationships between entities is an Achilles heel
>> of such applications. I have read django-reversion docs on google code
>>
Malcolm Tredinnick schrieb:
> To understand the problem you're trying to solve a bit better: why do
> you want it to add a (fake) script name in the non-HTTP case?
Example: Send an email via cron that includes a link which
was created with reverse(). The method which creates the
link (and adds t
On Thu, 2008-10-02 at 12:37 +0200, Thomas Guettler wrote:
> Malcolm Tredinnick schrieb:
> > To understand the problem you're trying to solve a bit better: why do
> > you want it to add a (fake) script name in the non-HTTP case?
>
> Example: Send an email via cron that includes a link which
> wa
Hi all,
I'm in need of the functionality of ticket #3672. I have de initial code
implemented. And there are some patches, but they seem to be diffs on files in
the main svn trunk.
The question with the easiest solution for me would be, when is the code from
this ticket going to be merged wit
On Thu, Oct 2, 2008 at 7:00 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'm in need of the functionality of ticket #3672. I have de initial code
> implemented. And there are some patches, but they seem to be diffs on files
> in the main svn trunk.
Yes - diffs against the sour
But your schema's will most likely change over time. And sometimes in
significant ways which do not have a likely default; e.g. splitting a
full_name field into a first_name and last_name field or visa-versa.
Now after applying this change to the database, how will
django-reversions work when you
Hello
in a ModelForm based Form, i have a ManyToManyField. I want only
specific objects of the Relation to be shown in the Forms
ModelMultipleChoiceField.
For my example, Motive and Textile belong to the same Project, and i
want only the Motives to Show in the ModelMultipleChoiceField that are
re
Looking at the comments in that ticket, I think you may need a
redesign - sounds like conditional blocks weren't ever "meant" to be
supported.
I've done something similar using a template include at the point that
you are putting your select block.
I try to use includes sparingly but sometimes it
On Thu, Oct 2, 2008 at 8:46 AM, oversize <[EMAIL PROTECTED]> wrote:
>
> Hello
>
> in a ModelForm based Form, i have a ManyToManyField. I want only
> specific objects of the Relation to be shown in the Forms
> ModelMultipleChoiceField.
> For my example, Motive and Textile belong to the same Project
Russell,
Thanx for the heads up. I've been using svn for a while, but it seems like I
indeed need to brush on svn and patching.
Mind you, in daily work my 'system/network administration' hat is bigger then
my 'software development' hat.
Anyway, thanx again!
Regards,
Gerard.
Russell Keith-M
Has anybody seen this error:
Exception Type: AttributeError
Exception Value:
'_CheckLogin' object has no attribute '_meta'
See also http://dpaste.com/81918/
Possibly related technique: I'm trying to use multi-table inheritance
and a form dictionary to get the form class based on a subc
I'm trying to use the admin interface to dump & restore my database,
without much luck. I can dump the data fine, but I've had no success
loading it back in.
Could someone list the commands to do this? The actual commands is
what
I'm looking for (not present in the docs) - something that I can
Never mind, ignore, stupid programmer error...
> section_form = section_form_class(request.POST,
> instance=report)
Shd be:
> instance=section)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
On Thu, Oct 2, 2008 at 9:35 PM, Gary Thomas <[EMAIL PROTECTED]> wrote:
>
> I'm trying to use the admin interface to dump & restore my database,
> without much luck. I can dump the data fine, but I've had no success
> loading it back in.
>
> Could someone list the commands to do this? The actual
Hi I'm new to django. Is there way to get a specific column from a specific
table in a database when using Models. Say for instance I wanted just a list
of user's firstnames or something.
Also, with a instance of a Model, say for instance, UserProfile, is there a
way to get an arbitrary attribut
Kurczak;
Short of this is, catching specific errors in the save method and
displaying them to the user are hard and you might be regurgitating
items back to the user that they really don't have any business seeing
(SQL errors, programming errors, etc.). The best way to check for the
proper values
Going with the multi-table inheritance example from the docs:
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Restaurant(Place):
serves_hot_dogs = models.BooleanField()
serves_pizza = models.BooleanField()
I was h
It's even easier than that: try user_profile.name
if you need a specific variable field, remember it is just python so:
>> from Model.models import Profile
>> user_profile = Profile.objects.get(pk=1)
>> attribute = 'name'
>> getattr(user_profile, attribute)
John
Hope that helps, Mn
On Oct 2, 1
Thanks James. That did the trick.
--~--~-~--~~~---~--~~
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
Thanks guys, I appreciate it.
On Oct 2, 3:29 am, bruno desthuilliers <[EMAIL PROTECTED]>
wrote:
> On 2 oct, 07:33, Travis Parker <[EMAIL PROTECTED]> wrote:
>
> > Instead of calling render_to_response on an empty template file you
> > could simply return an empty django.http.HttpResponse and avoid
Is there anyway to get QuerySet to return only the raw data from the
field not wrapped in a dictionary object?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
That is a problem, to be sure, and I'm not sure if a reasonable solution
exists.
As it stands, Django is currently lacking an automated rollback/recovery
for models. The fullhistory branch tried to address this lack, but
seems to have been abandoned for the time being.
django-reversions impl
Hello,
I have succeeded in reusing a model with translation subclass
{{{
class Content(models.Model):
created = models.DateTimeField(_("created on"), editable = False)
creator = models.ForeignKey(User, related_name="%
(class)s_creator", editable = False)
...etc
class Translation(mu
I can't show you the code yet since I haven't got permission to post
it cleared from my company, but I got this working. (It was not easy
and req
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
SproutCore is a javascript framework for rich client side applications
running in the browser (http://www.sproutcore.com)
I have just released a django app that makes communicating with the
sproutcore client by REST quite simple.
The project is hosted at google code:
http://code.google.com/p/dj
On 1 oct, 22:44, John Allen <[EMAIL PROTECTED]> wrote:
> On Oct 1, 10:25 pm, bruno desthuilliers
>
> <[EMAIL PROTECTED]> wrote:
> > I think this has to do with '/cms/' being defined in both your domain
> > name and your apache conf's location directive. Since you tell Django
> > the django.root
I cannot show you the entire code since the company lawyers have not
had time to allow me to release this snippet, but I did get this
working. However it was not easy and required some interaction with
the guys who created FormWizard.
My approach was to create a DummyForm which I put in the secon
On Thu, Oct 2, 2008 at 12:02 PM, WillF <[EMAIL PROTECTED]> wrote:
>
>
> Michael, Thanks for the response.
>
> I understand that part but what if i wanted to make it arbitrary. In the
> case of an arbitrary variable called "attribute". Something like
>
> user_profile.get(attribute) where attribute
On Oct 2, 2:00 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Wiadomość napisana w dniu 2008-10-02, o godz. 01:03, przez Rock:
>
> > Have you tried setting the order within your model? I think that is
> > the only simple way to tackle this at this time.
>
> > class Meta:
> > ordering = (
Can someone tell me if i set up the model and admin correctly?
On Sep 30, 2:05 pm, smcoll <[EMAIL PROTECTED]> wrote:
> i'm trying to get a TagField working in the admin for my model using
> django-tagging 0.2. i get an IntegrityError when i save my model from
> the admin- it looks like django is
Hello am new in django, am in a worry here.
I have the next question: i have a ModelForm that must display some
choices depending on an id of region. I have done it when i am saving
a new registration( it only shows me the choices of the region a am
logged on)
But when a want to edit the regions
Found help on IRC:
Since my TagField is named "tags", i have to set
``tag_descriptor_attr`` to some other name when registering it.
tagging.register(Post, tag_descriptor_attr='_tags')
On Oct 2, 12:01 pm, smcoll <[EMAIL PROTECTED]> wrote:
> Can someone tell me if i set up the model and admin cor
On Oct 2, 10:27 am, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> > You are right, it wasn't necessary to add the domain name explicitly.
> > I had only done this because of some earlier issues with flatpage URLs
> > (where it was necessary to add the domain name).
>
> ??? I never used flatpage
>
>
> Thank you for your input.
> I'd rather use forms and clean_ method, but I need to get
> object's pk (it object exists in db),
> is there any proper way to get it?
> I know I can override form's __init__ and pass the model, but I can't
> figure out which method creates the form and if I can pa
I have the following table in models.py
class SiteAccessProcess(models.Model):
"""Object model mapping to the site_access_process table.
Each element in the class represents a table column.
"""
instance_id = models.DecimalField(
blank=False, max_digits=32, decimal_places=0,
h
Django users will be glad to know that I've pretty much decided to use
Python/Django for a new site I'm creating. I was getting sick of PHP
and I'm not convinced that Ruby (Rails/Merb) is robust enough for my
tastes, so I've ended up here.
Still, I'm now wondering if anybody has thoughts on whet
Amazing!
Thank you so much.
Kurczak
On 2 Paź, 20:24, Michael <[EMAIL PROTECTED]> wrote:
> > Thank you for your input.
> > I'd rather use forms and clean_ method, but I need to get
> > object's pk (it object exists in db),
> > is there any proper way to get it?
> > I know I can override form's __i
On Oct 2, 11:17 am, Adam <[EMAIL PROTECTED]> wrote:
> Is there anyway to get QuerySet to return only the raw data from the
> field not wrapped in a dictionary object?
QuerySets support a values_list() call.
http://docs.djangoproject.com/en/dev//ref/models/querysets/#values-list-fields
Is that
Hi all,
I have built Hangman game using Django. You can see it at
http://feedfrog.net/app/hangman
If anybody interest in its code, please contact me.
Enjoy :)
Chatchai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
Very cute!
--g
--~--~-~--~~~---~--~~
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]
Adam I'm using 1.0 with Python 2.5.2 (with Ubuntu servers) for my
latest development work and couldn't be happier.
--gordon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
2008/10/2 chatchai <[EMAIL PROTECTED]>
>
> Hi all,
>
> I have built Hangman game using Django. You can see it at
> http://feedfrog.net/app/hangman
>
> If anybody interest in its code, please contact me.
>
> Enjoy :)
>
Great !, you can link the src there?
>
> Chatchai
> >
>
--
[b]question = (to
See http://dpaste.com/81988/
Ran some tests, FileFields work fine in admin.
In a ModelForm, when I select a file with the Browse button, then
click the submit button, the FileField value disappears and I get a
required field error.
Did a bunch of googling, ran into this:
http://appengineguy.com
Hi,
> I have the following:
> [snip]
> def people_json(request):
> userobjects = User.objects.filter(is_superuser=False).extra(order_by
> = ['auth_user.username+0'])
> p = Paginator(userobjects, 10)
> pagenumber = request.POST.get('pagenumber', 1)
> try:
>
On Oct 2, 3:36 pm, bobhaugen <[EMAIL PROTECTED]> wrote:
> Seehttp://dpaste.com/81988/
>
> Ran some tests, FileFields work fine in admin.
>
> In a ModelForm, when I select a file with the Browse button, then
> click the submit button, the FileField value disappears and I get a
> required field er
On Oct 2, 10:46 am, Ant <[EMAIL PROTECTED]> wrote:
> Going with the multi-table inheritance example from the docs:
>
> class Place(models.Model):
> name = models.CharField(max_length=50)
> address = models.CharField(max_length=80)
>
> class Restaurant(Place):
> serves_hot_dogs = mode
Michael, Thanks for the response.
I understand that part but what if i wanted to make it arbitrary. In the
case of an arbitrary variable called "attribute". Something like
user_profile.get(attribute) where attribute can be anything (ie 'firstname',
'lastname').
Is there a way to get a arbitra
Based on some internal responses and this one, I think I'll choose
Ubuntu over Debian. This will be a shell only machine since I'm
running it on Amazon. Anybody have thoughts on me not using Ubuntu?
Let's say Debian Lenny? I only ask here because I'm trying to stay
with the pack on a standard D
Is there a way to render just a child template (without it's
parent(s)) and pass the results back in response to an
Ajax.Updater request? I want to do this to dynamically update a
container in an already-rendered page.
Ken
--~--~-~--~~~---~--~~
You received t
> I have an application based around the admin. Is there a way to find
> out which users have logged on to the application?
You could look at the last_login field in the User objects.
-RD
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Rajesh,
Thanks a million. That advice got me almost all the way there.
Needed one more twist, because the file url was unicode, so created
this method:
def file_url(self):
return encoding.iri_to_uri(self.file.url)
Now it all works.
--~--~-~--~~~---~--~-
Thank you for your input.
I'd rather use forms and clean_ method, but I need to get
object's pk (it object exists in db),
is there any proper way to get it?
I know I can override form's __init__ and pass the model, but I can't
figure out which method creates the form and if I can pass model from
t
Matt,
On Oct 1, 11:39 am, Matt Wilson <[EMAIL PROTECTED]> wrote:
> I'd love to be able to use SQLAlchemy with Django. I've heard some
> people are working with this, but I want to know if people are really
> using it in production.
We're working on a project called django-sqlalchemy (http://
gi
I'm using a trick involving jQuery taconite plugin, and child
template.
I have two base templates for the child template (taconite one, for
ajax requests, and regular one).
And you can put a variable into {% extends %} tag, instead of string.
Something like {% extends base_template %}
and then def
No. Typically you would make a stand-alone template that does not
extend anything else. This template only renders the contents of the
container in question. It can be used by your AJAX view to create an
updated container which can be passed back to the browser. But the
same template can also be
I was wondering if there was an way to do this easily. I have two
scenarios I've been pondering:
a) Pre-populating a field with the current username,
b) pre-populating a field with the contents a user has previously
typed, a sort of "history" field. I've already hacked at the editable
fields to m
On 2 oct, 16:51, Michael Newman <[EMAIL PROTECTED]> wrote:
> Kurczak;
>
> Short of this is, catching specific errors in the save method and
> displaying them to the user are hard and you might be regurgitating
> items back to the user that they really don't have any business seeing
> (SQL errors,
Problem solved:
running Apache as a service did not have same permission as my UID.
Restarted service running under my user (configured Windows service)
and got access to those files.
A
On Oct 2, 3:06 pm, Andre <[EMAIL PROTECTED]> wrote:
> Regards to all,
>
> I have completed Phase 1 of my firs
On Thu, Oct 2, 2008 at 6:23 PM, bruno desthuilliers <
[EMAIL PROTECTED]> wrote:
>
> On 2 oct, 16:51, Michael Newman <[EMAIL PROTECTED]> wrote:
> > Kurczak;
> >
> > Short of this is, catching specific errors in the save method and
> > displaying them to the user are hard and you might be regurgitat
Regards to all,
I have completed Phase 1 of my first Django site and trying to deploy
it on Apache. And hit a problem:
if os.path.exists("\\file_server01\myproject\mydir")
This returns True on development Django server and False on Apache 2.2
with mod_python 3.3.1 running on W2000. I suspec
I want to run django via fastcgi, fronting it with nginx. Now, from
the help, I see there are 2 options:
method=IMPL prefork or threaded (default prefork)
What are the pros and cons of the threaded model? I'm tending toward
prefork, does anyone have any experience to share?
--~-
On Oct 3, 9:31 am, chiggsy <[EMAIL PROTECTED]> wrote:
> I want to run django via fastcgi, fronting it with nginx. Now, from
> the help, I see there are 2 options:
>
> method=IMPL prefork or threaded (default prefork)
>
> What are the pros and cons of the threaded model? I'm tending
I just realized why the images are not loading; the images are served
by appending the file path to the url, but when they try to append
mysite.com/login/imagefilepath it can't find them as there is no login
directory. My question now is how do i work around this, i haven't
thought of a workaroun
Hello,
I am trying to get content-type of uploading file in admin, and I always
get the error:
'TemporaryUploadedFile' object is unsubscriptable
I dont want to try Pythons mimetypes object because of files i'm trying
to upload has no extension and has aprox. 30MB file size.
# models.py
class
On Wed, 2008-10-01 at 13:58 -0700, KillaBee wrote:
> I am adding a login page to my app and it keep saying that it can't
> find the login.html
Do you mean that it cannot find a template called "login.html" or when
you go to a particular URL a 404 response is returned (meaning it cannot
match tha
fixed.
--~--~-~--~~~---~--~~
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 more
On Thu, 2008-10-02 at 11:26 -0700, Karthik Krishnan wrote:
> I have the following table in models.py
>
> class SiteAccessProcess(models.Model):
[... snip ...]
> I am running a unit test.
[...]
> I get the following error.
>
> 265, in __init__
> raise TypeError, "'%s' is an invalid keyword
On Thu, Oct 2, 2008 at 2:26 PM, Karthik Krishnan <[EMAIL PROTECTED]>wrote:
>
> I have the following table in models.py
>
> class SiteAccessProcess(models.Model):
> """Object model mapping to the site_access_process table.
>
> Each element in the class represents a table column.
> """
> instanc
Hello,
I'd like to make a wizard using the FormWizard class that has multiple
django Forms (and just a single html form) per page. It doesn't look
like this is supported out of the box. Has anyone done something like
this before? Any tips or other approaches I might try?
-Matt
--~--~-~--
I found the same problem as ticket #5737. It was closed due to unable
to reproduce it, but I am seeing the same problem.
I have:
class QueryForm(f.Form):
status = f.ChoiceField(choices=STATUS_TYPES,
widget=f.CheckboxSelectMultiple(), required=False)
and the form validation errored:
statu
I'm picking through some nasty problems with postgres connections on
my django install. Bascially, if I do "a lot" of rapid selects and
inserts on some models with "a lot" of mutual foreign key constraints,
the database connection hangs indefinitely - and quite nastily - it
acquires locks such tha
Dear Karen,
Thank you very much for your response. It was very helpful and solved
my problem!
As I said, I am just beginning with Django, so could not quite
understand where the problem lies. However, I will try to post a more
useful and descriptive phrasing of the problem, including traceback
I have a strange error on my live server. On the development server
everything works just fine.
About half the time I get an error:
ViewDoesNotExist at /companies/
Tried list in module vicrsa.companies.views. Error was: 'module' object has
no attribute 'models'
Request Method: GET
Request URL
I've got it...
With adding "import urllib2" (or urllib) to admin.py and modifiying
save_model as
def save_model(self, request, obj, form, change):
file_path = '%s%s%s' % ('file://', settings.MEDIA_ROOT, obj.cfile)
req = urllib2.urlopen(file_path)
obj.content_type = req.headers.get('c
90 matches
Mail list logo