Re: Django for a front end designer

2011-08-02 Thread webcomm
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

Re: how to create a hidden field

2011-08-02 Thread webcomm
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

Re: add a field to a form that isn't in a model

2011-08-02 Thread webcomm
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"

Re: in the shell, "module object has no attribute Model"

2011-08-02 Thread webcomm
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,

Re: how to create a hidden field

2011-08-02 Thread webcomm
> 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

Re: add a field to a form that isn't in a model

2011-08-02 Thread webcomm
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

Re: in the shell, "module object has no attribute Model"

2011-08-02 Thread webcomm
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

in the shell, "module object has no attribute Model"

2011-08-02 Thread webcomm
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

Re: Django for a front end designer

2011-08-02 Thread webcomm
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

Re: add a field to a form that isn't in a model

2011-08-02 Thread webcomm
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

add a field to a form that isn't in a model

2011-08-02 Thread webcomm
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...

Re: how to create a hidden field

2011-08-02 Thread webcomm
> 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()

Re: how to create a hidden field

2011-08-02 Thread webcomm
> 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

how to create a hidden field

2011-07-25 Thread webcomm
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 =

Re: in my model, how can I tell when I'm saving a new item

2011-07-25 Thread webcomm
> 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') >      

Re: in my model, how can I tell when I'm saving a new item

2011-07-25 Thread webcomm
On Jul 25, 3:57 pm, Javier Guerra Giraldez <jav...@guerrag.com> wrote: > On Mon, Jul 25, 2011 at 2:50 PM, webcomm <rya...@gmail.com> wrote: > > try: > >  self.id > > except NameError: > >  # run this code if it is a new item > > else: > >

Re: in my model, how can I tell when I'm saving a new item

2011-07-25 Thread webcomm
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

in my model, how can I tell when I'm saving a new item

2011-07-25 Thread webcomm
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

Re: general problems with installing downloaded django apps

2008-11-18 Thread webcomm
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

Re: Tips for reading The Django Book in light of Django 1.0

2008-11-17 Thread webcomm
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,

Re: general problems with installing downloaded django apps

2008-11-16 Thread webcomm
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 moved your answer down] > >

Re: general problems with installing downloaded django apps

2008-11-16 Thread webcomm
? 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 PROTECTED]>

Re: general problems with installing downloaded django apps

2008-11-16 Thread webcomm
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

general problems with installing downloaded django apps

2008-11-16 Thread webcomm
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

order of foreign key items in list_filter

2008-11-09 Thread webcomm
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'

Re: how to get the id in an admin template

2008-11-06 Thread webcomm
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

Re: how to get the id in an admin template

2008-11-06 Thread webcomm
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

how to get the id in an admin template

2008-11-04 Thread webcomm
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

Re: multiselect populated by another app

2008-10-30 Thread webcomm
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 articles admi

multiselect populated by another app

2008-10-27 Thread webcomm
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,

how to integrate FCKeditor

2008-10-13 Thread webcomm
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=fck#07686be7a0656429 ...but I need more information. I followed the link

allowing users to create and edit content types without editing model classes

2008-10-13 Thread webcomm
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

Re: alphabetize options in a ForeignKey dropdown?

2008-10-02 Thread webcomm
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