Re: Advice on form to create new object that has foreign key field

2008-12-13 Thread Daniel Roseman
On Dec 13, 9:30 pm, DavidA wrote: > I have two models, Trade and Fill. A Trade can have many fills. Fill > has a FK to Trade: > > class Trade(models.Model): >     trade_date = models.DateField(auto_now_add=True, editable=False) >     side = models.CharField(max_length=12, choices=SIDE_CHOICES) >

Re: Advice on form to create new object that has foreign key field

2008-12-13 Thread Daniel Roseman
On Dec 13, 10:12 pm, DavidA wrote: > The problem is that trade is required so is_valid will fail. > So exclude it from the form: class AddFillForm(forms.ModelForm): class Meta: exclude = ('trade',) -- DR. --~--~-~--~~~---~--~~ You received this messa

Re: stupid question

2008-12-13 Thread Daniel Roseman
On Dec 13, 9:08 pm, volk23 wrote: > i've made a modification in a App i created. run syncdb, it dont show > changes made. what could be wrong? thanks in advance > What's wrong is that you didn't read the documentation: http://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb - see the big b

Re: Combine model form with a formset

2008-12-14 Thread Daniel Roseman
On Dec 14, 5:19 am, Marc DM wrote: > If you want to edit them together in the admin then do this for your > admin class > > # > class BookInline(admin.TabularInline) >     model = Book >     extra = 2 > > class AuthorOptions(admin.ModelAdmin) >     inlines = [B

Re: List a model fields

2008-12-15 Thread Daniel Roseman
On Dec 16, 6:53 am, JF Simon wrote: > Hello, i'm new with python (and french so my english may seem very > poor, sorry about that). > I would like to list a model's fields and return a dict, here is the > example : > > I have a model class with : > > meta_title : CharField(...) > meta_description

Re: Media classes in admin.py are only used on add/change page?

2008-12-16 Thread Daniel Roseman
On Dec 16, 6:48 pm, "3lancer.eu" wrote: > Hi, > > As I read > onhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-me..., > the files defined in Media classes' js and css attributes will only be > added to html on the add/change page. So as far as I understand, it's > only possib

Re: Strange error using modelformset_factory

2008-12-17 Thread Daniel Roseman
On Dec 17, 12:49 pm, marty3d wrote: > Hi! > > I've been stuck with this for some days now, and can't find any > answers whatsoever. Please bare with me since I'm a newbie with Python/ > Django. > > I have this form that's created and populated using > 'modelformset_factory'. What it's supposed to

Re: populating a multi select list by passing in user obj to form

2008-12-18 Thread Daniel Roseman
On Dec 18, 9:41 am, Chris wrote: > Hello all, > I am trying to popular a multi-select form field by passing in a user > object suchas request.user so that I can filter a table based on that > object. Below is what I came up with but it is still not working. > I get the following error: 'ChoiceFor

Re: Using the test client to verify form fields content

2008-12-18 Thread Daniel Roseman
On Dec 18, 6:16 am, sagi s wrote: > 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('/metr

Re: UserProfile matching query does not exist.

2008-12-18 Thread Daniel Roseman
On Dec 18, 9:30 am, "Arnoud Tijssen" wrote: > I`m a python newbie so bear with me > > I use the django framework and get the following error: > > DoesNotExist at / > UserProfile matching query does not exist. > > Since python is fairly new to me I don`t know where to start. > Any help would

Re: inlineformset_factory with a custom widget for a field

2008-12-18 Thread Daniel Roseman
On Dec 18, 7:18 pm, Cortland Klein wrote: > I'm using inlineformset_factory in one of my views, which is working   > great, except now I'd like to change the widget for one of the fields   > (in case anyone's curious, an AdminFileWidget). For clarification this   > is my own view and has nothing

Re: Putting tests in a tests folder

2008-12-19 Thread Daniel Roseman
On Dec 19, 2:32 pm, "Martin Lundberg" wrote: > Hello everyone! > > What do I need to do to be able to put my tests in a folder (called "tests") > inside my application folders and make django run them? > > I want something like: > > /project/app1/tests/module_tests.py > /project/app1/tests/module

Re: custom widgets

2008-12-19 Thread Daniel Roseman
On Dec 19, 8:11 pm, nbv4 wrote: > I have a model with a field called date_format. That field is an > integer value from 1 to 9 corresponding to "D m-j-y", "m-d-Y", etc. I > have the model defined with a 'choices' set so the database can store > the number, and a dropdown is created with the choic

Re: Problem saving a User object to a profile

2008-12-19 Thread Daniel Roseman
On Dec 19, 8:28 pm, nbv4 wrote: > On Dec 19, 3:15 pm, DragonSlayre wrote: > > > profile_form.user = user; > > profile_form.save() > > The problem is that you can't assign fields in forms directly like > this. The only way to input data into a form is when you initially > create the form object a

Re: MySpace clone using Django? Is it possible?

2008-12-19 Thread Daniel Roseman
On Dec 19, 7:45 pm, "James Bennett" wrote: > On Fri, Dec 19, 2008 at 12:41 PM, lekvar...@gmail.com > > wrote: > > Hi, I wanna know wich of the well known frameworks is the best choice > > for myspace-clone community website. > > Since you're basically going to be throwing money away no matter wh

Re: cross table querying

2008-12-20 Thread Daniel Roseman
On Dec 20, 3:58 am, Shuge Lee wrote: > how to do following querying in Django 1.0 ? > > mysql> select product.name, os.name from product inner join os where > product.id = os.id ; > +-+-+ > | name| name| > +-+-+ > | MS Word | All | > |

Re: newbie question: validation of primary_key field

2008-12-21 Thread Daniel Roseman
On Dec 21, 7:40 pm, Kaaia wrote: > Hi, > >   I am very new in django (and python) so my question may be quite > dummy, so be patient please. I am playing with example based on > django's tutorial. > > I have following class: > > class Pilot(models.Model): >     ... >     cn = models.CharField('So

Re: Post tutorial help needed - generic.create_update.create_object

2008-12-21 Thread Daniel Roseman
On Dec 21, 7:02 am, schwim wrote: > OK, I'm a total newbie. I ran through the tutorial on the django site, > and decided to extend the poll system a bit just to learn more.  I > figured quite a bit out, but on this one I'm stuck. > > I want to provide a page at polls/new to add a new poll.  I'm t

Re: Understanding the execution logic of a view

2008-12-21 Thread Daniel Roseman
On Dec 22, 5:20 am, eldonp2 wrote: > Please help me understand the execution logic of a view. I have copied > the example from the official Django documentation: > > def contact(request): >     if request.method == 'POST': # If the form has been submitted... >         form = ContactForm(request.P

Re: Post tutorial help needed - generic.create_update.create_object

2008-12-21 Thread Daniel Roseman
On Dec 22, 4:49 am, "Greg Schwimer" wrote: > On Sun, Dec 21, 2008 at 1:47 PM, Daniel Roseman < > > roseman.dan...@googlemail.com> wrote: > > > You won't see errors because you haven't included them in your > > template. Either render the whole

Re: non-fields being inherited by ModelForm

2008-12-22 Thread Daniel Roseman
On Dec 22, 4:43 pm, nbv4 wrote: > I have a model which is defines kind of like this: > > MyModel(models.Model) >     field1 = models.BooleanField() >     field2 = models.BooleanField() >     field_num = "1" > > And then I have a form thats pretty much this: > > MyModelForm(models.ModelForm) >    

Re: Django date filter

2008-12-22 Thread Daniel Roseman
On Dec 22, 12:30 pm, Aldo wrote: > Hi folks, > > Simple enough problem but cant find the functionality - if it exists. > > this_week = datetime.date.today() - timedelta(7) > Cars.objects.filter(created_date>this_week) > > I basically want to find all cars that were created in the last 7 > days. I

Re: problem with adding foreign key to table

2008-12-22 Thread Daniel Roseman
On Dec 22, 9:14 pm, Ana wrote: > Hello, > > I migrated my MySQL tables to Postgres.  Generally, the migration was > fine with one exception.  I have a table researchproj that included > two foreign keys (institution_id and contact_id).  I received the > following error: > > Caught an exception wh

Re: xml -> django model

2008-12-23 Thread Daniel Roseman
On Dec 23, 8:11 pm, "dick...@gmail.com" wrote: > i'm working on a simple concept i'm sure others have solved, but i > can't get it. > > basically, given some input, i parse it, find which objects to > create, and do it. > > so with a model: > > class Foo(models.Model): >       name = models.Char

Re: A Django Comic Site Issues

2008-12-28 Thread Daniel Roseman
On Dec 28, 5:35 am, tsop wrote: > Hey, > I'm quite new to django but I ran into a small problem maybe someone > can shed some light onto: > > models.py > > class Comic(models.Model): >         title = models.CharField(max_length=80, help_text='Title of > comic.') >         series = models.Foreign

Re: enumerate in templates

2008-12-28 Thread Daniel Roseman
On Dec 27, 6:20 am, Vicky wrote: > Is there a way to access the previous value of a for loop in > templates. Can anyone tell the template representation for the python > code like: > >                          for i,j in enumerate(item): >                         ... I think the various forloop

Re: need urls help

2008-12-29 Thread Daniel Roseman
On Dec 29, 10:58 am, Bobby Roberts wrote: > On Dec 29, 10:48 am, Briel wrote: > > > A solution, not sure if it's the best, would be to make a function in > > basicly any file, that generates a quote. Then you can import the > > function to every view you want and call it to get the random quote.

Re: working with a returned object inside another class

2008-12-29 Thread Daniel Roseman
On Dec 29, 9:02 pm, garagefan wrote: > below is the code... the first def doesn't return anything... (def > get_gal_teaser(self)) > i'm using a custom tag to return the Gallery class to the base > template file, which works...  so calling the method get_gal_teaser > works as well... and returns a

Re: working with a returned object inside another class

2008-12-29 Thread Daniel Roseman
On Dec 29, 11:04 pm, garagefan wrote: > awesome... it was all in that [:1]! > > now, next issue... > > "OperationalError at /admin/galleries/gallery/ > (1054, "Unknown column 'galleries_gallery.status' in 'field list'")" > > i just added the status field as i wasn't worried about any of that > pr

Re: Looking for Django tutorial that illustrates master/detail data models

2008-12-30 Thread Daniel Roseman
On Dec 30, 8:22 pm, ldm999 wrote: > Eg: > Lists (books, movies, restaurants) and multiple items per list. > > Web forms would allow user to: > - Add/change/delete lists > - Add/change/delete list items > > TIA Have you actually read the tutorial on the Django site? The Poll application covers ex

Re: Ordering ForeignKey lists in admin change view

2008-12-30 Thread Daniel Roseman
On Dec 30, 7:15 am, janedenone wrote: > Hi, > > this must be really simple, but all the references to ordering fields > did not explain how to do this: How can I change the order of entries > in foreign key lists in the admin change view? > > Kind regards, > Jan Django will just use the default

Re: Using ModelChoiceField with query set - no error but no list either

2008-12-31 Thread Daniel Roseman
On Dec 31, 11:13 am, phoebebright wrote: > I have a model that has a car and a car has a foreign key to carmodel > via the field model  (too many models!) > > This is the line for the form which appears to run: > > carmodel=forms.ModelChoiceField(queryset=Car.objects.all().values > ('model','mode

Re: Model fields and arrays?

2008-12-31 Thread Daniel Roseman
On Dec 30, 11:40 pm, schwim wrote: > I'm trying to build a model that will store the counts of each of 10 > possible choices, e.g.: > >     v1 = models.IntegerField(default=0) >     v2 = models.IntegerField(default=0) >     v3 = models.IntegerField(default=0) >     ... >     v10 = models.IntegerF

Re: form validation does not work

2008-12-31 Thread Daniel Roseman
On Dec 31, 12:18 am, Chuck22 wrote: > class ContactForm(forms.Form): >           email = forms.EmailField(required=True, >                              widget=forms.TextInput(attrs= > {'size':'30'}), >                             error_messages={'required':'Please fill > out your Email'}) >      

Re: ROOT_URLCONF

2008-12-31 Thread Daniel Roseman
On Dec 31, 12:31 pm, "dick...@gmail.com" wrote: > was looking for some info on how ROOT_URLCONF setting is supposed to > be used? i am trying something very simple. i have a single django > project. there are two apps. > > i want to run one app, call it foo,  with a specific settings file, > and

Re: in db/models/query.py - TypeError: 'exceptions.IndexError' object is not callable

2009-01-01 Thread Daniel Roseman
On Dec 31 2008, 11:58 pm, gkelly wrote: > I am having the following error sent to my email from a live site. I > haven't been able to reproduce the error myself, but was hoping > someone could point me in the right direction as to how to solve this. > > First of all, is it something in my code, o

Re: edit_inline_stacked template

2009-01-04 Thread Daniel Roseman
On Jan 4, 10:18 am, Niall Mccormack wrote: > Hi there, > > I'm trying to override the edit_inline_stacked template so I can   > dynamically add in extra inline data via javascript - similar > tohttp://www.arnebrodowski.de/blog/507-Add-and-remove-Django-Admin-Inli... > > I can override the change

Re: Redirect parent from within iframe without losing session

2009-01-04 Thread Daniel Roseman
On Jan 4, 2:35 pm, Berco Beute wrote: > I'm still searching for a solution for this problem. > Which other forums should I try? > > Thanks, > 2B > This is the right forum, but apparently no-one knows the answer to your question. Personally, I can't see how that redirect could be causing a sessio

Re: Do sth on time ?

2009-01-04 Thread Daniel Roseman
On Jan 4, 9:33 pm, Mark Jones wrote: > You need a process running outside the bounds of the webserver that > reads the database every so often, and then sleeps with a wakeup every > so often, and a list of when things "expire".  It updates the > database, the webpage reflects the update. > > You

Re: Sort by foreignkey values

2009-01-04 Thread Daniel Roseman
On Jan 4, 8:30 pm, Patrick wrote: > Ok, I will rephrase that with a concrete example: > I have those to models: > > class Modelo(models.Model): >     nome = models.CharField(max_length=10) >     manageable = models.BooleanField() > > class Equipamento(models.Model): >     modelo = models.ForeignK

Re: Could someone help me understand the finer points of import

2009-01-04 Thread Daniel Roseman
On Jan 4, 9:29 pm, Mark Jones wrote: > For the discussion below, ALL the code is in .../intomec/tenq > > I wrote some code in tests.py like so: > >    from tenq.models import * >         self.expectedValue = Answers((1,2,3,4)) > > within the to_python() method of AnswersField in models.py: >    

Re: Sort by foreignkey values

2009-01-04 Thread Daniel Roseman
On Jan 4, 11:24 pm, Malcolm Tredinnick wrote: > On Sun, 2009-01-04 at 20:14 -0800, Daniel Roseman wrote: > > [...] > > > I don't know why you say filtering Equipamento based on the value in > > Model 'seems to be not possible'. On the contrary, it is pe

Re: Newb needs help with tracking variables in Templates

2009-01-05 Thread Daniel Roseman
On Jan 5, 5:39 pm, "django_fo...@codechimp.net" wrote: > I have a pretty simple template that needs to print some data in a > bunch of table rows.  I have done something like this: > > > {% if my_art_list %} >         {% count = 0 %} >         {% for art in my_art_list %} >                 {% if

Re: Changing tutorial radio button to drop down

2009-01-06 Thread Daniel Roseman
On Jan 6, 12:20 pm, Max wrote: > Hello, > > Using the tutorial for detail.view, I changed the radio button to a > drop down.  I kept the view the same as the tutorial.   > Seehttp://dpaste.com/106018/ > > When I select the choice on the drop down, I receive the error saying > I didn't make a choi

Re: OperationalError at /swenglish/ , no such table: swenglish_entry

2009-01-06 Thread Daniel Roseman
On Jan 6, 2:59 pm, rabbi wrote: > Hi everyone, > I've gone through the Django tutorial and it worked fine when using > the default development server that is provided with Django (python > manage.py runserver) > > I want to deploy my little test site though, so I've been trying to > get it runnin

Re: Drop down list not seeing newly added record

2009-01-07 Thread Daniel Roseman
On Jan 7, 7:47 am, jeffhg58 wrote: > I have a 2 forms. One to add a new author and then another form for > Articles which has a drop down list to reference the authors. The > behavior I am seeing is that when I add a new author and then go to > the New Article form which references the author it

Re: Using a model method in ModelAdmin fieldsets

2009-01-07 Thread Daniel Roseman
On Jan 7, 10:35 am, EagerToUnderstand wrote: > I am referencing a self defined model method in list_display option of > ModelAdmin. I would like to do the same in the fiedsets option of > ModelAdmin, but I get an error saying my method is missing from the > form when the page is rendered. It se

Re: new django user - no images appear on my site :(

2009-01-12 Thread Daniel Roseman
On Jan 12, 6:35 pm, jazztpt wrote: > I'm building my first django app and having a few problems in my dev > environment.  I have a couple of images that I want to use in my > base.html template.  I have tried various configurations, but none of > my images show up.  I've tried putting the images

Re: ModelMultipleChoiceField in admin interface

2009-01-12 Thread Daniel Roseman
On Jan 12, 5:38 pm, Matias Surdi wrote: > Hi, > > I've two models related by a ForeignKey field. > > I'd like to have the possibility of adding child objects (side "One" of > the relation) from the admin interface of the parent ("Many" side of the > relation). > > Example: > > class Child(models.

Re: new django user - no images appear on my site :(

2009-01-12 Thread Daniel Roseman
On Jan 12, 8:59 pm, jazztpt wrote: > Nope, that's not the problem.  I had read that page, and another that > suggested a slightly different syntax for the urlpatterns > (fromhttp://rob.cogit8.org/blog).  Sorry that I forgot to mention that I > had already put Rob's version in my code -- I wasn't

Re: ModelMultipleChoiceField in admin interface

2009-01-13 Thread Daniel Roseman
On Jan 13, 8:26 am, Matias Surdi wrote: > hmm... Not really... from your point of view, think about this:  I want > to edit the children from the parent admin view, and *not* assign > parents to children from children's admin view > > Do you see? the relation is the same, but from the other s

Re: Slow view causing timeout errors

2009-01-13 Thread Daniel Roseman
On Jan 13, 2:53 am, Adam Tucker wrote: > I am working on a site where a page is loaded which replaces part of itself > with another view using a simple ajax replacement (the load funciton in > jQuery.) The view that is called iterates a loop anywhere from 3 to 10 times > before getting to a rende

Re: Dealing with 'date' ranges in template?

2009-01-14 Thread Daniel Roseman
On Jan 13, 9:40 pm, Manfred wrote: > Hello, > > I wrote a special kind of blog- or news application. One of the > specialities of this application is, that authors are able to make > entries visible/invisible by a date range or by a simple switch to > hide the entry. This works well. But (the aut

Re: PATH problem?

2008-07-15 Thread Daniel Roseman
On Jul 15, 8:38 pm, Frantisek Malina <[EMAIL PROTECTED]> wrote: > Project is in the folder httpdocs, in this folder there is a symlink > to satchmo. > settings.py, manage.py, urls.py... files are placed in the httpdocs > folder. > > Can I set a project name to something else? > Have you got a bla

Re: propagation of modification in children to parents

2008-07-21 Thread Daniel Roseman
On Jul 21, 7:52 pm, "Andre Meyer" <[EMAIL PROTECTED]> wrote: > hi again > > so, auto_now is deprecated and can be replaced by overriding the > save()method. but what about > auto_now_add? > > how to distinguish between creation and update in save()??? > You can tell whether or not it's a new obje

Re: Tabular data, limited columns in a template.

2008-07-23 Thread Daniel Roseman
On Jul 21, 8:28 pm, truebosko <[EMAIL PROTECTED]> wrote: > {% if is_new_row forloop.counter %} > ... > {% endif %} > You can't use a tag inside another tag - in this case, the 'if' tag. What you can do, though, is use a filter. So you need something like this: @register.filter def is_new_row(c

Re: how to display date nicely

2008-08-18 Thread Daniel Roseman
On Aug 18, 12:08 pm, Will Rocisky <[EMAIL PROTECTED]> wrote: > I have a datetime object '2008-15-06 11:12:13' > I want to display it like 'June 6, 2008 at 11:12' http://www.djangoproject.com/documentation/templates/#date -- DR --~--~-~--~~~---~--~~ You received th

Re: prepopulate_from

2008-08-18 Thread Daniel Roseman
On Aug 19, 6:18 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > On Mon, Aug 11, 2008 at 1:26 AM, Donn <[EMAIL PROTECTED]> wrote: > > > On Monday, 11 August 2008 08:56:13 Oleg Oltar wrote: > >> I want to use text stored in field title to generate slugs. > > In the svn (> 0.96) you have to use Model

Re: manager select_related()

2008-08-19 Thread Daniel Roseman
There's quite a lot wrong with this code, quite apart from the list_display issue. Comments interspersed below. On Aug 19, 2:33 pm, saeb <[EMAIL PROTECTED]> wrote: > No, that is not the real code. The real code as you mentioned is split > into models.py and admin.py. And I am referring to the fun

Re: Generic views list_detail

2008-08-19 Thread Daniel Roseman
On Aug 19, 7:08 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > My urls.py looks like this: > > project_info = { >     "queryset" : project.objects.all(), > > } > > (r'^project/(?P[-\w]+)/', > login_required(list_detail.object_detail), dict(project_info, > slug_field='slug')), > > Projects ha

Re: gettext is not defined - js error in admin calendar.js

2008-08-19 Thread Daniel Roseman
On Aug 19, 5:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, > > I'm trying to use the datetime picker widget from the admin widgets. > > My form is displaying, but the datetime picker is not. When I check > the error console, I see the message: > > Error: gettext is not defined > S

Re: Generic views list_detail

2008-08-19 Thread Daniel Roseman
On Aug 19, 9:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Daniel, > > Thank you for your reply. > > Following your advice I tried the following: > > task is the model that relates to project. > > > {% for task in project.task.all %} > {{ task.title }} > {% endfor %} > > > It doesn't s

Re: ifequal doesn't evaluate expressions

2008-08-19 Thread Daniel Roseman
On Aug 19, 7:48 pm, Zinovii Dmytriv <[EMAIL PROTECTED]> wrote: > I'm very happy that django is very flexible - this is great. But Rule > of thumb is to avoid extensions of framework code unless it's really- > really necessary. ifless is not that case. It just should be built-in. But we're not tal

Re: ManyToManyField contains

2008-08-19 Thread Daniel Roseman
On Aug 19, 10:24 pm, Robert <[EMAIL PROTECTED]> wrote: > Great! that works perfectly. However, it seems to have opened up > pandora's box of problems that I'm not able to solve. I've pinpointed > the problem now, and I'll summarize it below as follows, although > perhaps it deserves a new thread.

Re: Generic views list_detail

2008-08-19 Thread Daniel Roseman
On Aug 19, 11:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Daniel, > > I am working my way > throughhttp://www.djangoproject.com/documentation/db-api/#related-objects > at the moment trying to get a better grasp on how django handles SQL > relationships. > > The way I got the above cod

Re: how to pass value to other action

2008-08-19 Thread Daniel Roseman
On Aug 20, 7:14 am, Will Rocisky <[EMAIL PROTECTED]> wrote: > I am actually making a sort of wizard in which all values have to be > saved at the end. > I want to pass a variable from one action to another after pressing > 'Next' with HttpResponseRedirect There's various ways. The easiest would b

Re: Pre-populating an integer field with a count of model objects

2008-08-21 Thread Daniel Roseman
On Aug 21, 4:42 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I have a column, 'position', which is a PositiveIntegerField, to allow > my end-user to order records with. I would like to pre-populate the > field when creating a new record, with the count of the model objects > +

Re: Composite Forms? Are widgets the right thing to use?

2008-08-23 Thread Daniel Roseman
On Aug 23, 2:33 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > There is no reason that you couldn't include multiple forms in an HTML > post operation. You just have to make sure that there won't end up being > duplicate fields across forms. > In fact, there isn't even any reason to worry about t

Re: Making Custom Model Methods to Work

2008-08-24 Thread Daniel Roseman
On Aug 24, 7:38 am, rmschne <[EMAIL PROTECTED]> wrote: > I'm new to Django, and have played with Python for a few years on and > off (not a real programmer).  I'm keen to use Django to explore some > data because of its custom data models which I plan to rely on > extensively (putting the complex

Re: Processing multiple forms in same page

2008-08-24 Thread Daniel Roseman
On Aug 24, 1:51 am, Rodolfo <[EMAIL PROTECTED]> wrote: > Just for curiosity, why would one have two forms in a single page? > I don't think it is possible to submit the two in a shot. > > Maybe only of them is intended to be filled per access? > > []s > > Rodolfo You can't have two HTML forms per

Re: value taken through textarea is being displayed in one line

2008-08-26 Thread Daniel Roseman
On Aug 26, 10:12 am, Will Rocisky <[EMAIL PROTECTED]> wrote: > I am taking an input from user in text area, like comments. > but when I print them, they all display in one line. > how can I format them to display exactly how use entered them? (new > lines, tabs etc) When you say 'print' I presume

Re: Forms problem?

2008-08-28 Thread Daniel Roseman
On Aug 28, 3:01 pm, Greg Taylor <[EMAIL PROTECTED]> wrote: > I'm getting the following error on some of my models with > DateTimeFields. Any ideas? > > Traceback (most recent call last): > ... snip. ... > >  File "/home/clemsoncrew/site-packages/django/forms/widgets.py", line > 662, in decompress

Re: new be Many to many relation question

2008-08-29 Thread Daniel Roseman
On Aug 29, 7:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I can get user_utilization but member.user gives me django object. How > can I get that information? > > In [199]: for member in prj_members: >    .:     member.user >    .:     member.user_utilization >    .: > Out[1

Re: Using http header information in settings.py

2008-08-29 Thread Daniel Roseman
On Aug 28, 11:24 pm, Greg Fuller <[EMAIL PROTECTED]> wrote: > I would like a way to to adjust settings  based on information in the > http header.  I've seen a similar question asked before, but I don't > need all the django request object, just the http header information. > More specifically, us

Re: Issues for run "runserver" command.

2008-08-29 Thread Daniel Roseman
On Aug 29, 4:19 am, Issac <[EMAIL PROTECTED]> wrote: > I have installed python2.5 on RH3L-AS4 successfully. > And already installed Django1.0-beta2 successfully. > > After i create a project test, when i use python manage.py runserver > to start the dev server, the log shows error during the start

Re: Running individual tests

2008-08-29 Thread Daniel Roseman
On Aug 29, 10:30 am, Martin Gilday <[EMAIL PROTECTED]> wrote: > Is it possible to run a single test using manage.py test, rather than > the whole suite?  I have defined a tests.py in one of my apps and > would just like to run those tests, as the auto generated tests take > far to long to be runni

Re: new be Many to many relation question

2008-08-30 Thread Daniel Roseman
On Aug 30, 10:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Sorry but I didnt get it :( > (Perhaps you should actually call the field user  rather than user) . > Could you please explain more ? Sorry, that should have been "you should call the field users" - i.e. plural, because it refe

Re: how to use "if element in List" from a template?

2008-09-01 Thread Daniel Roseman
On Sep 1, 1:05 pm, joune <[EMAIL PROTECTED]> wrote: > Hi all, > I'm totally new to Django and i'm starting to play with templates... > I have a list to display and a separate list of elements considered > special; > so i'd like to display the first list with a different style if the > element is c

Re: how to use queryset to get some attribute but not all of the modle

2008-09-01 Thread Daniel Roseman
On Sep 1, 10:21 am, babatu <[EMAIL PROTECTED]> wrote: > how to use queryset to get some attribute but not all of the modle. > > for example: > > queryset = Entry.objects.all() > > i just want to sql like this" select id from Entry " > > but not "select * from Entry", See the documentation: http:/

Re: EnvironmentError: Could not import settings

2008-09-01 Thread Daniel Roseman
On Sep 1, 1:52 pm, "Weber Sites" <[EMAIL PROTECTED]> wrote: > Hi > > I'm trying to get the the tutorial02 (mysite) to work with apache. > No matter what I do I keep getting this error : > > EnvironmentError: Could not import settings 'mysite.settings' (Is it on > sys.path? Does it have syntax erro

Re: limiting choices in admin.ModelAdmin based on request.user

2008-09-01 Thread Daniel Roseman
On Sep 1, 2:53 pm, Nick Day <[EMAIL PROTECTED]> wrote: > Would somebody be able to provide a simple example of using get_form() > within the ModelAdmin to retrieve the currently logged-in user? > > Thanks in advance, > Nick > Not difficult: class MyAdmin(admin.ModelAdmin): def get_form(self,

Re: EnvironmentError: Could not import settings

2008-09-01 Thread Daniel Roseman
On Sep 1, 3:10 pm, "Weber Sites" <[EMAIL PROTECTED]> wrote: > Thanks, looks like we are making progress :) > > Now I get > > Page not found (404) > Request Method: GET > Request URL:http://django.weberdev.com:82/mysite/ > > Using the URLconf defined in mysite.urls, Django tried these URL patterns,

Re: EnvironmentError: Could not import settings

2008-09-01 Thread Daniel Roseman
On Sep 1, 5:39 pm, "Weber Sites" <[EMAIL PROTECTED]> wrote: > How do I know which ver? What does it say when you start up the development server? Or in the shell, you can do >>> import django >>> django.get_version() u'1.0-alpha-SVN-8210' To be honest, I'm not sure you actually want the /mysite/

Re: ModelForm, images and exclude

2008-09-02 Thread Daniel Roseman
On Sep 2, 4:04 pm, flynnguy <[EMAIL PROTECTED]> wrote: > Found out what was causing the error but not why... > > It seems that when I tell my model to not exclude the "pet" field, > that everything works fine. (ie, I select a pet from the dropdown) > When I add it to the exclude list and try to se

Re: Initial values in form fields

2008-09-02 Thread Daniel Roseman
On Sep 2, 6:10 pm, cArkraus <[EMAIL PROTECTED]> wrote: > Hey everyone, > > am pretty new to Django and Python in general. > I seem not be able to let the 'initial' value of a form-field be > calculated by its parent form. > > I'd like to do sth like this: > > class AbstractForm(forms.Form): >

Re: Accessing other attributes from Foreign-key

2008-09-04 Thread Daniel Roseman
On Sep 4, 12:36 pm, [EMAIL PROTECTED] wrote: > Guys, > > I have the following model : > > from pypo.contracts.models import job_id > from pypo.suppliers.models import Company > > ##Create your models here > > class ponum(models.Model): >          contract = models.ForeignKey(job_id) >          sup

Re: filter_vertical is not defined

2008-09-08 Thread Daniel Roseman
On Sep 8, 9:47 am, nsash <[EMAIL PROTECTED]> wrote: > Hello, > > I use latest Django official version - 1.0. I want to use in my admin > view > filter_vertical('categories',)  or > filter_horizontal('categories',)        for a ManyToMany Field. > > But I  only get the error message "name 'filter_v

Re: Help with Date Based Generic Views and Permalink

2008-09-08 Thread Daniel Roseman
On Sep 8, 4:37 pm, [EMAIL PROTECTED] wrote: > Hey all, > > I have this code: > > http://dpaste.com/76671/ > > When I go to the URL it doesn't display the page, but it also doesn't > display and errors with the URL. What is wrong with the permalink > instance? > > Also, is there a workaround for us

Re: new ModelAdmin set up

2008-09-08 Thread Daniel Roseman
On Sep 8, 8:14 pm, KillaBee <[EMAIL PROTECTED]> wrote: > I am editing my Admin.py to use the new ModelAdmin.  All my change has > no effect.  I wanted it to come up with all my app automaticlly. > > I have this in my urls.py: > from django.contrib import admin > . > . > . > (r'^admin/(.*)', admin.

Re: disable delete checkbox in Inline formset

2008-09-08 Thread Daniel Roseman
On Sep 8, 7:55 pm, Kurczak <[EMAIL PROTECTED]> wrote: > On 8 Wrz, 20:37, David Zhou <[EMAIL PROTECTED]> wrote:> On Sep 8, 2008, at > 2:30 PM, Kurczak wrote: > > > > Is there any way to disable/remove the delete checkbox for inline > > > formsets ( in admin) ? > > > I found nothing about it in doc

Re: cannot import name entrys

2008-09-08 Thread Daniel Roseman
On Sep 8, 9:16 pm, KillaBee <[EMAIL PROTECTED]> wrote: > I keep getting this error on this view named timesheets, the code > looks like this. > > ViewDoesNotExist: Could not import intraweb.apps.timesheets.views. > Error was: cannot import name entrys The traceback quite clearly states that th

Re: CRUD with forms from models usin ModelForm?

2008-09-09 Thread Daniel Roseman
On Sep 9, 4:47 am, "Efrain Valles" <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a basic question, I am currently adding new items using a form > that is generated using ModelForms, I have html for the form I need > using {{ form.as_table }} in the html. Now I am trying to do CRUD for > data

Re: Stupid noob question - admin link

2008-09-09 Thread Daniel Roseman
On Sep 9, 7:16 pm, Peter Bailey <[EMAIL PROTECTED]> wrote: > Hi all, starting to think there is so much stuff in django and python > that I will never learn it all. I am building a site that used the > admin piece for most of the CRUD and a few other pages for the rest of > my requirements. I link

Re: weird osx problem (templates path)

2008-09-09 Thread Daniel Roseman
On Sep 9, 8:56 pm, Anakin <[EMAIL PROTECTED]> wrote: > im using 10.5.2 osx Leopard. and im working with django 1.0 final > release. > > i have some screenshots about this error, settings - traceback and if > you need terminal log. you can see in this > url.http://www.deneloper.com/django-error/in

Re: updating entry from form in django 1.0!?

2008-09-10 Thread Daniel Roseman
On Sep 10, 8:56 am, David <[EMAIL PROTECTED]> wrote: > whereas once you had > > p = get_object_or_404(Person, pk=pID) > MyForm = forms.form_for_instance(p) > f = MyForm(request.POST.copy()) > > how on earth do you do it now? > I've tried simply f = MyForm(request.POST.copy()) where MyForm is > pre

Re: updating entry from form in django 1.0!?

2008-09-10 Thread Daniel Roseman
On Sep 10, 9:56 am, David <[EMAIL PROTECTED]> wrote: > Thanks, are they also any example of the case of form_for_model (as I > am assuming the above is only with respect to form_for_instance) > > Thx. > D. But that's just what you had already: > > > I've tried simply f = MyForm(request.POST.copy

Re: Problm using FileField with inline formsets (inlineformset_factory)

2008-09-10 Thread Daniel Roseman
On Sep 10, 9:50 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi > > I'm having a problem with inline formsets containing file field, i've > had a good google but couldn't find an answer, so apolgies if this is > a stupid or repetative question. > > I have a model Applicatant, which has a o

Re: Displaying a list of lists?

2008-09-12 Thread Daniel Roseman
On Sep 12, 1:04 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [OT question: Why does top-posting seem to be the default response mode on > this list?] > As a follow-up to this question, how would one cast the output as a table > where the major field is only displayed on change. I.e., how to pro

Re: Import error: Model based on another model

2008-09-13 Thread Daniel Roseman
On Sep 13, 9:25 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Hi All, > > I need to create a field with a choice set that looks like this: > >     BTW_CHOICES = ( >         ('0.0', '0%'), >         ('6.0', '6%'), >         ('19.0', '19%'), >     ) > > This works as expected when using dropdown

Re: Import error: Model based on another model

2008-09-13 Thread Daniel Roseman
On Sep 13, 10:56 am, Gerard Petersen <[EMAIL PROTECTED]> wrote: > Daniel, > > > If you want a field that's populated with values from another model, > > you should use a ForeignKey. > > Is it then still possible to use filters and such, and keep it in the model > logic? > > Because the Meta model

<    1   2   3   4   5   6   7   8   9   10   >