On Aug 2, 4:57 pm, "biofob...@gmail.com" wrote:
> Thank you all for the advices/sugestions.
> For what i read most of you advice on PHP + framework and i can
> understand that. I looked at django and rails as a option for me to
> have. My PHP knowledge is very limited, and sometimes i need some
>
On Aug 2, 4:56 pm, Brian Neal wrote:
> Oh...you are trying to do this in the *admin*? Are you sure you just
> don't need to "exclude" the form field?
Yep, that's what I needed. I already had an admin class for the
model, so it was just a matter of adding the line to exclude the
field.
For some
I'm not sure that reference is going to answer my question but, in any
case, there appears to be lots of good stuff in there. My old deskjet
will hate me for printing that page out, but I better try.
--
You received this message because you are subscribed to the Google Groups
"Django users" gro
On Aug 2, 3:38 pm, Daniel Roseman wrote:
> by declaring that metadata explicitly:
>
> 1. In [2]: class MyTest(models.Model):
> 2. ...: title=models.CharField(max_length=200)
> 3. ...: class Meta:
> ...: app_label = 'my_test'
>
Actually, that seems to have fixe
> You still haven't shown that it doesn't hide the field, eg by posting
> the output of frm.as_p(), where as I have shown conclusively that it
> does, so I think something else is going on here. Are you sure the
> field 'itemid' exists on your model?
Thanks Tom. The field itemid does exist in the
On Aug 2, 12:40 pm, Shawn Milochik wrote:
> You don't need to add the fields to your model. If the extra fields
> don't appear on your page it's probably because you didn't add them to
> the template.
I have no template for the form. I'm using the automatic admin.
--
You received this message
I'm also getting "list index out of range" quite often. Here is a
shell session showing the error in context: http://pastebin.com/FBE30SDK
--
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@google
I am trying to get more comfortable with interactive programming in
the shell... which I have always found a bit awkward and have mostly
avoided in favor of working in files (even for small experiments.)
I'm trying to do something pretty simple:
from django.db import models
class News(models.Mode
Hi there,
For building dynamic websites, I'd say you should learn a language
like PHP or Python. Yep. For working with Django you definitely need
to know Python.
Something like WordPress has a very different and narrower set of
intentions behind its design than does Django. WordPress is really
On Aug 2, 11:16 am, Shawn Milochik wrote:
> Just add the fields to your ModelForm and then do whatever you want in
> your save() override.
Thanks for your reply, Shawn. Adding the fields in my ModelForm
doesn't seem to do the trick, by itself. The field doesn't appear in
the form unless I also
Hi all,
How to add a field to a form that is not a model field?
I want my form for model class X to have a field whose value I will
save to another model class (by overriding the the save method in
model class X).
I think my answer is here...
http://www.hindsightlabs.com/blog/2010/02/11/adding-
> Have you simplified your example?
The example I provided in the original post is the actual code in my
models.py. It's not simplified.
> >>> class TestForm(ModelForm):
>
> ... range = CharField(widget=HiddenInput)
> ... class Meta:
> ... model=Foo
> ...>>> f=TestForm()
> >>> f.as_p()
>
> That would hide the field called 'itemid' from the model 'News'. Are
> you saying it doesn't?
That's right. It's not working. The field isn't hidden.
-Ryan
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email t
I haven't been able to find anything documenting how to create a
hidden field. I see this is done with the HiddenField widget but
don't know how to use that. I tried the following but the field still
shows...
class NewsForm(ModelForm):
itemid =
forms.IntegerField(widget=forms.HiddenInput,req
> Thanks. Any idea why the following isn't working in my News class?
> The processing doesn't get to that exit call, even if it's a new item.
>
> def save(self, *args, **kwargs):
> if not hasattr(self,'id'):
> import sys
> sys.exit('must be a new item')
>
On Jul 25, 3:57 pm, Javier Guerra Giraldez wrote:
> On Mon, Jul 25, 2011 at 2:50 PM, webcomm wrote:
> > try:
> > self.id
> > except NameError:
> > # run this code if it is a new item
> > else:
> > # run this code if this is a previously saved item
>
I'm still learning python, so have to ask about how this would be
done. Something like the following?
try:
self.id
except NameError:
# run this code if it is a new item
else:
# run this code if this is a previously saved item
More generally, what do you think of this statement: "If there
I want to override the save method in one of my models. How do I know
if I'm calling save on a newly created item or on one that is already
in the database? How to make that distinction in my save method?
Thanks,
Ryan
--
You received this message because you are subscribed to the Google Groups
On Nov 16, 6:45 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> webcommwrote:
>
> [yet again at the top of the message, so I have yet again moved the
> response down to where it reads logically ...]
>
Steve,
re: top-posting, I am using the web interface for Google groups, which
seems to encourage t
Pretty sure forms has changed. That is, the way admin forms are
created/customized. In the book there is a brief explanation of
upcoming changes involving what was at that time termed "newforms." I
am fairly new to Django so can't be much more specific than that.
-Ryan
On Nov 17, 8:11 pm, Ken
are not really necessary
for installing apps? I see that the tagging app gives me the option
to install using setup.py, but it's not required.
-Ryan
On Nov 16, 2:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> webcomm wrote:
>
> [Please don't top-post ... I've mov
nd for all apps? For example, to install the
tagging app, I could create an app called "tagging" with startapp.
Then I could replace the contents of that directory with the tagging
app I download from code.google.com. Would that work?
-Ryan
On Nov 16, 1:01 pm, Steve Holden <[EMAIL
Maybe I'm starting to get the idea... can apps be installed anywhere,
as long as they are on the python path? Are there any restrictions at
all with respect to where apps are installed?
-Ryan
--~--~-~--~~~---~--~~
You received this message because you are subscribe
I am fairly new to python and Django. I have no problem setting up my
own apps by following the tutorial. However, I *always* have problems
setting up someone else's apps. I think I've tried installing 5 apps
that I've downloaded from code.google.com and elsewhere, and have been
unsuccessful ev
I have a list_filter in admin.py that is based on a ForeignKey. Can I
set the items in the list_filter to appear in alphabetical order?
Currently they are ordered by ID number.
I have already ordered the items alphabetically in the model that
provides the ForeignKey, by using the 'ordering' opti
ahh. Thanks.
On Nov 6, 4:20 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote:
> `example.com` is default Site added by the project setup into sites contrib
> application [1]
>
> [1]:http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-s...
>
> On
I don't understand the documentation. I am able to get the "view on
site" link to show, but the URL is wrong. The correct URL for the
instance is...
http://www.mysite.com/billing/321
...so I tried this...
def get_absolute_url(self):
return "/billing/%i" % self.id
...but when I cl
How do I get the instance id from within an admin template? I want to
add a link to view the instance, and I need the id to create that
link. Like so...
View this item
Thanks,
Ryan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
elp,
Ryan
On Oct 27, 11:03 am, webcomm <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have created a simple categories app, and now I want to be able to
> categorize my articles, which are handled by a different app. I'd
> like to create a multiselect categories field in my
Hi,
I have created a simple categories app, and now I want to be able to
categorize my articles, which are handled by a different app. I'd
like to create a multiselect categories field in my articles admin
that is populated by the category entries from my categories app.
In my categories app, I
I would like to integrate a WYSIWYG editor with my site, preferably
FCKeditor.
I found a relevant thread at...
http://groups.google.com/group/django-users/browse_thread/thread/163c06f2a22bbe1e/07686be7a0656429?lnk=gst&q=fck#07686be7a0656429
...but I need more information.
I followed the link to.
I've been playing with django in recent weeks and have been impressed,
but there is one publishing/programming problem I'm not sure how I
would handle with django. I'm thinking of a site where dozens of
different users need to frequently create and edit content types.
I have in mind a site where
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
33 matches
Mail list logo