Can anyone suggest a way to customize model field display?
For example if I have a model called Course with fields n_girls and
n_students,
if for a particular record n_girls = 4 and n_students = 10, I want to
display for n_girls: "40% (4)" instead of just "4".
Obviously I can do this in the
Pydev works pretty well, including visual debugging of the test server
+ test suite
On Jan 6, 1:48 pm, HB wrote:
> Hey,
> What is your favorite IDE for coding Django projects?
> Any ideas about PyDev and ActiveState Komodo IDE?
> Thanks.
Any suggestion on how to decorate a model with extra attributes?
On Jan 1, 9:39 am, sagi s <sag...@yahoo.com> wrote:
> I'd like to store extra attributes in the model fields so I can
> control the subsequent field-specific behavior from there.
>
> Let's say I have a model tha
I'd like to store extra attributes in the model fields so I can
control the subsequent field-specific behavior from there.
Let's say I have a model that stores metrics I then need to chart.
In the view, I prefer not to have some logic that says:
metrics = Metric.object.all()
I really like the concept of generating a form from a model using
ModelForm but would like to customize the apprearance slightly (e.g.
size of the TextInput etc.).
Any suggestion as to how to do this?
I looked at the forms module code but got lost in the maze of the meta
programming...
Thanks
I'd like to use the test client to verify that when there's an error
in a form field, the input field in the
response is populated with the original input.
So I'd like to do something like:
iteration = 'bad data'
response = self.client.post('/metrics/add/', {
'iteration' :
,
Sagi
On Dec 17, 3:40 pm, sagi s <sag...@yahoo.com> wrote:
> On Dec 16, 4:49 pm, "James Bennett" <ubernost...@gmail.com> wrote:
>
> > On Tue, Dec 16, 2008 at 7:19 AM, sagi s <sag...@yahoo.com> wrote:
> > > So I'm looking at the data available i
On Dec 16, 4:49 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> On Tue, Dec 16, 2008 at 7:19 AM, sagi s <sag...@yahoo.com> wrote:
> > So I'm looking at the data available in the template to try to get my
> > hands dirty and restore all this manually
Maybe I'm missing something here but I've been struggling with some
basic forms customization issues.
I'm using ver. 1.0
I have created a simple model (Metric) and a form to go with it,
deriving from django.forms.ModelForm with the model set it the Meta as
per the examples.
Out-of-the-box the
I tried to compare user ids in a template almost exactly like the
example in the docs:
{% ifequal user_id copy.checkout.user.id %}
however, it seems like user_id (a context variable I'm passing) is a
string and the other id that comes from the model is a long so the
comparison always fails.
I am generating a form for a model that contains a CharField with
choices. According to the documentation I expect to see this
translated into a SELECT form field but all I get is a simple TEXT
form field:
models.py:
class Publication(models.Model):
PUBLICATION_TYPES = (
('B',
I've been playing around with Django for a couple of weeks.
I'm finding myself spending most of my type tinkering with the
Database API to try to wrestle the information I need out of my
database.
At this point it looks to me like I have replaced one set of
incantations (SQL) for another
I am trying to create a form for a couple of models:
PubForm = forms.form_for_model(Publication)
CopyForm = forms.form_for_model(Copy)
class PubCopyForm(PubForm, CopyForm):
pass
I would expect to see a combination of the Copy and Publication fields
in the form but I only see
In Rails, flash is a way to display a message in the next page. It is
extremely useful to provide lightweight feedback to user operations.
For examples when the user, say, submits a new article and after
clicking on the "Submit" button, then is redirected to the front page,
you want to let him
k the
existing views would just work fine.
Regarding custom template tags, I guess I expect many users to want to
use django this way, so I think that having a "load_view" template
element would be useful. Don't you agree?
Cheers,
Sagi
On Aug 1, 10:29 pm, "James Bennett" <
se('frontpage_template.html',
> {'list_users':list_users,'latest_articles':latest_articles})
>
> On Aug 1, 2:34 pm, sagi s <[EMAIL PROTECTED]> wrote:
>
> > I am trying to find a way to include a view in a template. The view
> > generates an html snippet based on a
I am trying to find a way to include a view in a template. The view
generates an html snippet based on a DB query + another template. In
pseudocode what I am trying to achieve is:
frontpage_template.html:
{{% include header.html %}}
{{% load /views/list_users %}}
{{% load /views/latest_articles
I created a table where some of the fields have null=True since it's
okay for them to be empty.
Looking at the schema in mysql this option was correctly translated
into the DB's schema, however when I try to add an entry via the admin
interface I get errors on those fields saying that 'This field
18 matches
Mail list logo