hi
I have a model with 3 fields
class Employee(models.Model):
name=models.CharField(max_length=50)
home_address=models.TextField(blank=True)
change_filter=models.IntegerField()
I am creating a modelform using this class as model.
class EmployeeForm(ModelForm):
class Meta:
On Wed, Oct 27, 2010 at 1:04 AM, Swordfish wrote:
> Hi everybody! I'm looking for a job deals with Django.
> Interesting in any kind of work: filling websites with images, texts,
> translations, testing.
> I'am Django newbie.Have previous experience with Plone.
>
>
On Wed, Oct 27, 2010 at 4:13 AM, christian.posta
wrote:
> I'm trying to display a form that has both the UserProfile fields and
> a select handful of the User fields.
> What's the best way to go about doing this? In the CreateUserForm that
> I'm creating, I have an
I am relatively new to django. I've been reading the docs endlessly
and hacking to try to get something to work, but I'm hoping to not re-
create functionality that either exists or is part of the framework.
I have a class named UserProfile that I'd like to use to extend the
User object. I set it
Hello to all,
I would like to add some nagios feature to my django app. I found this
project http://djagios.org/index.html but I see that is not supported
since 9 December 2009 :\. What do you think about it? Is it safe in
your opinion or can you suggest me other solutions?
Thanks
--
You
Try going into the shell with 'manage.py shell,' import the User
model, and attempt to delete that user. See what happens and give us
the traceback if it fails and you still don't know why.
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
Hi everybody! I'm looking for a job deals with Django.
Interesting in any kind of work: filling websites with images, texts,
translations, testing.
I'am Django newbie.Have previous experience with Plone.
--
You received this message because you are subscribed to the Google Groups
"Django users"
Do you have further detail on how this looks? I was intending to use
forms.changed_data, but I would much rather get an automatic list of
changed fields by comparing the new submission to the initial state.
How do I compare the initial to the post within a pre_save function?
On Oct 26, 12:18
thanks elijah..that worked
how come id="id_user_entry" not enough?
regards
jim
On Oct 26, 11:54 pm, elijah rutschman wrote:
> > > min="0"
> > max="1000"
> > step="2"
> > value="6" id="id_user_entry"/>
>
> Try adding a name="user_entry" attribute to
On Oct 26, 10:24 am, Phlip wrote:
> > This sounds like what django-reversion[1] does :)
>
> > [1]:http://github.com/etianen/django-reversion#readme
>
> We have to cover the situation where some clients might still have
> rev(n-1), while some are up-to-date with rev(n). So
maybe I not explain correctly. For any modelForm the forms for a field
"ManytoMany" are "select multiple". If I want to change this I must
to redefine the widget for that field in the declaration of the
"modelForm". This works correctly, I can transform the field from
"select multiple" to any
> min="0"
> max="1000"
> step="2"
> value="6" id="id_user_entry"/>
Try adding a name="user_entry" attribute to the input.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
hi
thanks for the link.
I tried this,In firefox3.6.11 ,it is rendered as a text field
In chrome it shows a slider.
...
select numerical value using slider:
{{myform.user_entry.errors}}
...
However,I am getting validation error upon processing the form
I put the field as an IntegerField in
We have a consistent mystery on one of our .edu sites I'm hoping
someone can help solve.
If we restart apache on this shared host, the site reverts to a very
old, non-Django version of itself. That is, an antique PHP-based
version of the site is served up, and the design changes to one
> Things.objects.filter(id__in=Things.objects.values('name').annotate(max_id=
> Max('id')).values_list('max_id',
> flat=True))
I didn't do values_list because I guessed that the inner query would
run and produce an array, then the outer query would run.
My way, with values() on both sides of
Hello all,
I've got an admin site that includes some inlines. These in turn
contain a ChoiceField. I'd like to filter the choices based on an
attribute of the parent model. Does anyone know if this is possible
and, if so, what hook I need to use?
I feel like I should be able to use
On Tue, Oct 26, 2010 at 12:40 PM, Phlip wrote:
>
> So this statement correctly fetches only the latest items:
>
> SELECT a.* FROM things a WHERE a.pid in (select max(b.pid) from
> content_entity b group by b.name)
>
> Now I thought (from my allegedly copious experience with
> This sounds like what django-reversion[1] does :)
>
> [1]:http://github.com/etianen/django-reversion#readme
We have to cover the situation where some clients might still have
rev(n-1), while some are up-to-date with rev(n). So we _probably_ need
the history in the same table as the current
Pasted misleading traceback, as I created the scene table in the
default database to verify this.
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/site-packages/django/db/models/manager.py",
line 132, in get
return self.get_query_set().get(*args, **kwargs)
On 26 October 2010 19:05, Steve Holden wrote:
> On 10/26/2010 12:40 PM, Phlip wrote:
>> Note that "isabelle_item" appears twice. We are following the auditing
>> rule "always write new records to change data - never edit previous
>> records". Someone edited isabelle_item's
> I hope the auditors are only forcing you to do this with records that
> aren't referenced as part of relationships, otherwise your database is
> going to get hammered updating all the foreign keys.
The design spec (which is ours, not any "CPA auditor's"), say to
duplicate the living crap out of
I have two PostgreSQL (postgresql_psycopg2) databases defined in my
settings; default and scenes.
If I perform a filter using the 'scenes' DB I get the expected
results:
Scene.objects.filter(name__contains='ME').using('scenes')
[, ]
If I perform a get(), Django seems to get completely confused
On 10/26/2010 12:40 PM, Phlip wrote:
> Note that "isabelle_item" appears twice. We are following the auditing
> rule "always write new records to change data - never edit previous
> records". Someone edited isabelle_item's payload data (not shown), so
> we add a new record without touching the
So I did the right thing... nice!
Giancarlo Razzolini
http://lock.razzolini.adm.br
Linux User 172199
Red Hat Certified Engineer no:804006389722501
Verify:https://www.redhat.com/certification/rhce/current/
Moleque Sem Conteudo Numero #002
OpenBSD 4.5
Ubuntu 9.04 Jaunty Jackalope
4386 2A6F FFD4
Thanks, is clearly explained in the documentation. I feel embarrassed
for do a post for something like this.
On 26 oct, 13:25, Daniel Roseman wrote:
> On Oct 26, 5:02 pm, refreegrata wrote:
>
> > Hello list, I have a newie question, are in django
Tom Evans wrote:
> Phlip, I'm going to try and make a non-stupid comment now :)
http://xkcd.com/386/
> If you already know precisely the query you want to use, and you can't
> coerce django's ORM to produce it, can you simply use Manager.raw()[1]
> to generate the result set you are after?
> One idea would be to put 'fieldname' as the first parameter to the
> function, then use functools.partial [1] to create partial functions
> for each file field with the value set appropriately:
>
> thumbnail_image = FileField(upload_to=partial(get_upload_path,
> 'thumbnail_image'))
On Oct 26, 5:02 pm, refreegrata wrote:
> Hello list, I have a newie question, are in django some function like
> nl2br in the template to print data saved previously from a
> "textarea"? because in my template all the lines are printed in the
> same line.
>
> P.D.: nl2br is
I have a question regarding the best way to conceptualize a model. I
have a tasks model, which I want to hook to a few different other
models: The model Project, the model Company and a few other undefined
models. The problem is that I want a particular instance of the task
to be pluggable to one
On 26 oct, 15:48, Ed wrote:
> I do like this a lot. If I use post_save, is there a way to grab the
> field that is altered?
Nope, you have to use "pre_save" for this, load another (yet
unmodified) copy of your model instance, and diff both.
> I know the admin page
I don't understand what you said.
Thanks
On 26 out, 12:19, Daniel Roseman wrote:
> On Oct 26, 3:08 pm, Waleria wrote:
>
> > I know that the execution of the function stops there, but i don't
> > know how do i resolve. I need to display the
Hello list, I have a newie question, are in django some function like
nl2br in the template to print data saved previously from a
"textarea"? because in my template all the lines are printed in the
same line.
P.D.: nl2br is PHP function to do this:
"a
b
c"
is tranformed in
"abc"
Thanks for
On Oct 26, 4:29 pm, Scott Gould wrote:
> Hi folks,
>
> I've got all my file uploads (that go to S3 as it happens, but I don't
> think that's overly important) taking their path from one upload_to
> delegate:
>
> def get_upload_path(instance, filename=None):
> """
>
This is part of my views
[[[code]]] from mysite.views
def site_root(request):
return HttpResponse("This is the site root")
def hello(request):
return HttpResponse("Hello World")
[[endcode]]
My URLConf
[[code]]
from django.conf.urls.defaults import *
urlpatterns =
Hi folks,
I've got all my file uploads (that go to S3 as it happens, but I don't
think that's overly important) taking their path from one upload_to
delegate:
def get_upload_path(instance, filename=None):
"""
Defaults to appname/modelname/uuid.
"""
return
Phlip, I'm going to try and make a non-stupid comment now :)
If you already know precisely the query you want to use, and you can't
coerce django's ORM to produce it, can you simply use Manager.raw()[1]
to generate the result set you are after?
Eg,
Student.objects.raw(r'SELECT * FROM `student`
> Second, I'm not sure I understood the last part about getting the
> field within each model.
Sorry, I misread, thinking you were talking about having different
parameters of each model being responsible for what counted as
"latest". Bruno's solution looks good to me.
--
You received this
On Oct 26, 3:08 pm, Waleria wrote:
> I know that the execution of the function stops there, but i don't
> know how do i resolve. I need to display the graphic generated and
> just below the form.
>
> Can you help me, please?
>
> Thanks
Well as far as I can tell, the
> st=Student.objects.filter(marks__in=Student.objects.all().aggregate(Max('ma
> rks')))
Aha - a marks__in may point to an aggregate subquery.
In conclusion, screw my SQL server's optimizer. It deserves to suffer!
(I can't seem to find a self-join to do what I need either...)
--
You received
Try the HTML5 . On some current browsers, it'll
just appear as a text field, although you can supplement it with
javascript. Moving forwards, as more browsers support HTML5 forms,
it'll appear as a slider widget. See [1].
[1]http://diveintohtml5.org/forms.html#type-range
On Oct 26, 7:17 am,
I know that the execution of the function stops there, but i don't
know how do i resolve. I need to display the graphic generated and
just below the form.
Can you help me, please?
Thanks
On 26 out, 11:42, Daniel Roseman wrote:
> On Oct 26, 2:17 pm, Waleria
On Oct 26, 2:42 am, Tom Evans wrote:
> I'm curious, why can't I talk you into
> Student.objects.all().order_by('-score')[0] ?
>
> It is clearly a superior query :/
> >> ( BTW please don't try to talk me out of it; I've been doing SQL since
> >> 1989 and am fully aware
I do like this a lot. If I use post_save, is there a way to grab the
field that is altered? I know the admin page seems to be able to
determine the changed field. . .
On Oct 26, 9:41 am, bruno desthuilliers
wrote:
> On 26 oct, 13:25, Ed
If there is no simpler way to do this, then I'm fine with this
method. 2 questions though.
Is there a concern about the size of the query required for the
big_honking_list? I would probably be pulling a much larger dataset
than I need and can only truncate it after it's sorted by date.
Second,
On Oct 26, 2:17 pm, Waleria wrote:
> Hi all,
>
> I have this code:http://pastebin.com/Ra1G7twn
>
> I need to display the graphic generated and just below the form, now
> the code only display the form. The image of graphic isn't displayed.
>
> What could it be?
>
> How do
On 26 oct, 13:25, Ed wrote:
> I want to create a "What's New" section that lists all of the database
> changes in the last day. I've added an "updated" field to my models:
>
> class Film(models.Model):
> .
> .
> .
> updated =
Looking for someone to check into this, before i submit
problem is with __isnull=False handling
backend is psycopg2
tables:
class Person(models.Model):
name = models.CharField(max_length=60)
surname = models.CharField(max_length=60)
class SampleTest(models.Model):
person =
That's it! Thanks for pointing me in the right direction. Also my
apologies for posting on the other forum. I did not know i wasn't
supposed to do that.
And thanks DR for your response. I've sorted it out now.
On Oct 26, 5:42 pm, Jirka Vejrazka wrote:
> > I've two
Hi all,
I have this code: http://pastebin.com/Ra1G7twn
I need to display the graphic generated and just below the form, now
the code only display the form. The image of graphic isn't displayed.
What could it be?
How do i resolve?
Thanks
--
You received this message because you are
On Oct 26, 1:25 pm, Giancarlo Razzolini wrote:
> I had this same problem when hosting it with apache. I solved the
> problem by creating a symbolic link inside my media folder pointing to
> the admin site that is instaled with django. Something like this:
>
> admin ->
On Fri, Oct 22, 2010 at 08:02:56AM -0700, Ken wrote:
Hi
> I understand there are many different ways and products to use to
> setup a great workflow for developing in django, but would like to
> hear how you or your startup team (or corporate dev group) does it.
> Specifics would be amazing, as
On 10/26/2010 8:50 AM, jimgardener wrote:
> thanks for the replies..
> I am wondering if javascript is the only alternative if I want to use
> such a custom widget.
> If anyone knows about any such python widget please tell me..
> regards
> jim
>
Jim:
The reason you can forget using Python is
> thanks for the replies..
> I am wondering if javascript is the only alternative if I want to use
> such a custom widget.
> If anyone knows about any such python widget please tell me..
You might want to dig a bit into website design to understand how
JavaScript-based systems work. That would
thanks for the replies..
I am wondering if javascript is the only alternative if I want to use
such a custom widget.
If anyone knows about any such python widget please tell me..
regards
jim
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
On Oct 26, 1:29 pm, vamsy krishna wrote:
> I've two modules called plan and income and both have a class called
> Income in their respective models. Now if I do user.income_set, it is
> accessing the income set under plan. How do I alter it to access
> income.income? Any
> I've two modules called plan and income and both have a class called
> Income in their respective models. Now if I do user.income_set, it is
> accessing the income set under plan. How do I alter it to access
> income.income? Any ideas?
Hi,
have you had a chance to check out related_name in
I've two modules called plan and income and both have a class called
Income in their respective models. Now if I do user.income_set, it is
accessing the income set under plan. How do I alter it to access
income.income? Any ideas?
Thanks in advance
--
You received this message because you are
I had this same problem when hosting it with apache. I solved the
problem by creating a symbolic link inside my media folder pointing to
the admin site that is instaled with django. Something like this:
admin -> /usr/share/pyshared/django/contrib/admin/media/
Of course, this would only work
hi,
do this with JavaScript.
2010/10/26 jimgardener
> is it possible to use the sliderlike Scale widget from tkinter in
> django?I am coding a web app where I need to get a numerical value
> entered by the user.I thought ,instead of asking the user to enter a
> value
you think this problem is the Django_countries?
I expected it to be in PostgreSQL.
I'll check the versions now!
Thanks
2010/10/26 Venkatraman S
>
> On Tue, Oct 26, 2010 at 5:28 PM, Nelson Saraiva wrote:
>
>> *
>> File
>>
On 10/26/2010 7:17 AM, jimgardener wrote:
> is it possible to use the sliderlike Scale widget from tkinter in
> django?I am coding a web app where I need to get a numerical value
> entered by the user.I thought ,instead of asking the user to enter a
> value in a textfield ,I would provide a slider
On Tue, Oct 26, 2010 at 5:28 PM, Nelson Saraiva wrote:
> *
> File
> "C:\Python25\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py",
> line 121,
> in _cursorraise ImproperlyConfigured("You need to specify NAME in your
> Django settings file.")
>
>
On 25/10/10 19:04, Jumpfroggy wrote:
> - +1 on using "settings.py" and "local_settings.py". The problem with
> keeping local settings files in the VCS is when you have multiple
> servers with different settings. You could store each file as
> local_settings_test_server.py and so on.
We use
Hi,
I'm new here in the List and Django (i'm a intermediate python programmer),
i'm from Brazil.
one know
I'm trying to install a group buying system here in my machine called
Massive-Coupon, anyone know?
After you install many dependencies(Photologue, PyFacebook,
SocialRegistration,...), arose
On 22/10/10 17:34, Kevin Monceaux wrote:
> I think the OP was referring to mysqldump's --compatible option which
> one could use, for example, as mysqldump --compatible=postgresql ...
Doesn't Work, btw. (really doesn't help much, at least in my experience
- you just end up with dump that's
Maybe -- in fact, almost certainly not -- the best way, but this is
how I do that kind of thing:
a_queryset = ModelA.objects.all()
another_queryset = ModelB.objects.filter.(by_something=True)
yet_another_queryset =
ModelC.objects.exclude(by_something_else=False)
I want to create a "What's New" section that lists all of the database
changes in the last day. I've added an "updated" field to my models:
class Film(models.Model):
.
.
.
updated = models.DateTimeField(auto_now=True)
class Actor(models.Model):
.
.
.
updated =
is it possible to use the sliderlike Scale widget from tkinter in
django?I am coding a web app where I need to get a numerical value
entered by the user.I thought ,instead of asking the user to enter a
value in a textfield ,I would provide a slider which he can move
between the minimum and maximum
I can't encourage it *enough*. This was writen hastily, thanks for the
close read.
Brian
On Tue, Oct 26, 2010 at 1:01 AM, Kenneth Gonsalves wrote:
> On Mon, 2010-10-25 at 16:06 -0400, Brian Bouterse wrote:
> > I really can't encourage the use of Hudson
sorry friends, ignore this
On Tue, Oct 26, 2010 at 4:31 PM, Tom Evans wrote:
> Bad netiquette.
>
> Please don't send unsolicited attachments to mailing lists. If it is
> really that riveting, provide a link.
>
> On Tue, Oct 26, 2010 at 11:55 AM, girish shabadimath
>
Bad netiquette.
Please don't send unsolicited attachments to mailing lists. If it is
really that riveting, provide a link.
On Tue, Oct 26, 2010 at 11:55 AM, girish shabadimath
wrote:
>
> Hi friends,
> i found this ppt interesting, specially the diagram which made me to
On 26 October 2010 06:48, marcoarreguin wrote:
> I'm starting with Django and I have a bluehost, yesterday I have been
> installing all the stuff, I found a tutorial about how to install
> django in bluehost, so I'm using fcgi.
>
> My problem is that when I uncomment the
Sorted. The get absolute url had not been set and the ordering of urls
was incorrect.
--
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
On Mon, Oct 25, 2010 at 6:30 PM, Jumpfroggy wrote:
>
> I have a class like this:
>
> class Node:
> name = models.CharField()
> parents = models.ManyToManyField('self', symmetrical=False,
> related_name='child_nodes', null=True, blank=True)
>
> This allows a basic
I'm starting with Django and I have a bluehost, yesterday I have been
installing all the stuff, I found a tutorial about how to install
django in bluehost, so I'm using fcgi.
My problem is that when I uncomment the necesary things to run my
admin, it runs, but it hasn't a layout like the images
Course there could be, I'm being dense :/
On Tue, Oct 26, 2010 at 10:55 AM, Piotr Kilczuk wrote:
>
>
> 2010/10/26 Tom Evans
>>
>> I'm curious, why can't I talk you into
>> Student.objects.all().order_by('-score')[0] ?
>>
>> It is clearly a superior
On Mon, Oct 25, 2010 at 7:04 PM, Jumpfroggy wrote:
> This is such a great thread! I'd love to see a wiki page detailing
> some good setup ideas. It's such a leap forward from the nuts & bolts
> of "How do I install django" and "How do I run a complex query" to
> this...
2010/10/26 Tom Evans
> I'm curious, why can't I talk you into
> Student.objects.all().order_by('-score')[0] ?
>
> It is clearly a superior query :/
>
This would select only one row; there can possibly be multiple students with
a top note.
Am I right? :)
Regards,
I'm curious, why can't I talk you into
Student.objects.all().order_by('-score')[0] ?
It is clearly a superior query :/
Cheers
Tom
On Tue, Oct 26, 2010 at 6:37 AM, ankit rai wrote:
> say your model name is Student, and it has a field names as marks
>
> query set will be
>
79 matches
Mail list logo