I think the easiest way is to make your own widget or otherwise you
can make your own form field.
On 19 nov, 10:19, Benjamin Wolf wrote:
> Hello,
>
> I'm using Django's form and ModelMultipleChoiceField.
> ModelMultipleChoiceField produces a select list with multiple options.
> Is it possible t
Is there a shortcut to create and update a model object from a form? For
example I'd like to write something like:
MyModel.objects.create(mymodel_form.cleaned_data)
or
model_obj = get_object_or_404(MyModel, pk=id)
model_obj.update(mymodel_form.cleaned_data)
Not setting attributes individually
On Nov 22, 2009, at 9:58 PM, aurphir wrote:
> How can I have an application scope variable which should be loaded
> everytime the app starts app, be in memory and accessible by all until
> the app stops.
Django applications do not really "start" or "stop"; they're a
collection of page handlers
Thanks Javier.
It seems that I was perhaps thinking about it the wrong way. I
believe I understand what you mean - the REFERENCE just keeps the
table in order, it doesn't provide any performance boost. The speed
boost comes from the indexes that are created, which Django
automatically sets up.
Hi,
How can I have an application scope variable which should be loaded
everytime the app starts app, be in memory and accessible by all until
the app stops.
Thanks
Vishal
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
hi i have a problem when i try to render my form without information .
so my code is :
models.py
class Obra(models.Model):
cod_obra= models.CharField("código da
obra",max_length=15,primary_key=True)
nome_da_empreitada= models.CharField(max_length=100)
data_de_incio =
hi,
model
class room_type(models.Model):
room_type_id = models.AutoField(primary_key=True,null=False,blank=False)
room_type_name =
models.CharField(max_length=100,unique=True,null=False,blank=False)
room_type_desc = models.TextField(null=True)
standard_occupancy = models.IntegerF
> This clearly does not work ;)
>
> {{ pick.date "r" }}
Why the above will not work?
On Nov 21, 3:36 am, matches wrote:
> If I want to format the current datetime for an rss feed, I do:
>
> {% now "r" %}
>
> I want to format a date the same way coming from a DB in this format
> "2009-11-18 08:00
Trev wrote:
> Am I thinking about this wrong performance wise?
all SQL engines i know about either ignore the REFERENCES hint, or use it for
defining constraints. the SQL "...WHERE t1.fk=t2.pk" clause is enough to
optimally use any index that could help. when Django creates the tables, it
ma
If I want to format the current datetime for an rss feed, I do:
{% now "r" %}
I want to format a date the same way coming from a DB in this format
"2009-11-18 08:00:00"
Is there a way to format it with that same "r" format from a template
level?
This clearly does not work ;)
{{ pick.date "r" }
Perhaps there is a more efficient way, but in my quick test, one can't
filter() a queryset based on __class__ of the model, but seems one can
manually filter it afterwords:
qs = Player.objects.all()
for i,obj in enumerate(qs):
if obj.__class__ != Player:
del(qs[i])
On Nov 22, 4:32 p
On Nov 22, 4:47 pm, Micah Vivion wrote:
> Greetings,
>
> I have a question on how to update an existing row in my database when one of
> the fields is my primary key. I am using ModelForm and Django-Piston - my
> main goal here is to have RESTful Post send to my webservice. I am able to
> hav
Hi there,
I am new to Django and SQL, and I'm putting together my first Django
project. My project will contain multiple apps, and one app has a
model that I'd like to "One To One" extend with a table in a different
app. However, it's not behaving how I'd expect, and I can't seem to
find any inf
So, I'm trying to extend the Tag-model in tagging.models the following
way:
from django.db import models
from tagging.models import Tag
class TagContext(models.Model):
context = models.ForeignKey( Tag, unique=True,
related_name='context' )
parent = models.ForeignKey( Tag, related_
Greetings,
I have a question on how to update an existing row in my database when one of
the fields is my primary key. I am using ModelForm and Django-Piston - my main
goal here is to have RESTful Post send to my webservice. I am able to have
initial Posts be sent correctly (i.e. that Primary k
> Err... Do we have to read Spring's doc to find out what this means ?
"The Spring Web MVC framework offers a slightly higher level of
functionality: form controllers that implement a predefined work flow.
"
Source: http://www.ervacon.com/products/swf/intro/index.html
--
You received this messag
Hello,
I have these models:
class Player(models.Model):
.
class PlayerM(Player):
...
If I do PlayerM.objects.all() e get all PlayerM objects and for
Player.objects.all() I get all Player and PlayerM as expected.
How can get only the objects of type Player (only retrieve the objects
On Mon, Nov 23, 2009 at 1:59 AM, Hanne Moa wrote:
> I have models M, N, which both have a foreignkey to User. When in the
> shell/runserver, User has attributes for both M and N, but in a
> batchfile ($ DJANGO_SETTINGS_MODULE=settings python batch.py) only M
> is reachable from User while trying t
Hey guys,
So I am starting my first django project, we're going to rebuild a
site from scratch and migrate the existing users.
But since I am new to django, I wondering what's the best practice for
migrating the users.
I've been reading the django book about users and registration and
also a bit
I have models M, N, which both have a foreignkey to User. When in the
shell/runserver, User has attributes for both M and N, but in a
batchfile ($ DJANGO_SETTINGS_MODULE=settings python batch.py) only M
is reachable from User while trying to get N leads to
AttributeError: 'User' object has no attr
Hi all,
I recently ran a load test on my django web site which is running on
an Apache server. I tested it up to a load of 5000 users. I got a few
time out error's on a page that queries mySQL on a date field so I'm
going to index that column to see if that solves it.
However I also got another e
Great, that worked!
Abhik
On Nov 21, 6:52 pm, Christophe Pettus wrote:
> On Nov 21, 2009, at 6:48 PM, apramanik wrote:
>
> > Is there a way (either via decorators or some other mechanism) to get
> > an var/object (say request.user) to be in the context passed to every
> > template. The reason I
Happy Birthday =)
On Wed, Nov 11, 2009 at 12:47 AM, aga toytoy wrote:
> hmmm it seems we forgot to greet and thank Firefox for it's 5th year of
> existence!
>
> http://www.spreadfirefox.com/5years/en-US/
> http://zi.pe/eft
>
> --~--~-~--~~~---~--~~
> You received
Hi all,
I tried to reverse url by calling:
reverse('wmd-settings-js')
inside a widget as such:
class MarkDownInput(forms.Textarea):
class Media:
js = (reverse('wmd-settings-js'))
But then I would get this error from django:
Exception Type: ImproperlyConfigured
Exception Valu
Nevermind. Found the solution in a post from abrightwell. Thanks.
Mike
On Nov 22, 8:40 pm, adelaide_mike wrote:
> Hi Kenneth, and thanks for the reference. I must admin I did not
> think of looking int he Django docs for ReportLab related stuff.
> Should have.
>
> My new problem is that the e
Hi Kenneth, and thanks for the reference. I must admin I did not
think of looking int he Django docs for ReportLab related stuff.
Should have.
My new problem is that the example in the docs uses canvas, but in
order to display tabular data I think I need to use SimpleDocTemplate,
with which I am
26 matches
Mail list logo