Conditional view processing: *one* function for timestamp and ETag?

2010-07-21 Thread Torsten Bronger
Hallöchen! For timestamp and ETag in conditional view processing, I have to pass two function to the @conditional decorator. However, I've used this twice so far, and both times I needed common DB access in both methods. Thus, I embedded the common data in a custom attribute of the "request"

Re: How can view tweak response object to go to a specific *anchor* on the template?

2010-07-21 Thread Chris Seberino
On Jul 17, 11:16 am, Justin Myers wrote: > or just put that one line (with a semicolon at the end, since it's > missing one) in a

Re: URL to specify when accessing subdomains using Django

2010-07-21 Thread nandu
Dear jaymzcd, I understand what the sites framework is used for and I have read through the Sites Frameworks documentation at least ten times. After a lot of experimentation I have found that my main problem is how i should specify my URL as I am working on my local machine. I have set up my sub

Re: values() returning more than values

2010-07-21 Thread Nick
It looks like its returning every organization instance in the table, There are about 190 organizations and 900 totals entries, each of which are assigned an organization. The count on the query is correct, but when I output the actual values it returns every entry in the table, so I'm seeing

Re: values() returning more than values

2010-07-21 Thread Kenneth Gonsalves
On Thursday, July 22, 2010 09:10:31 am Nick wrote: > Readers = Readers.objects.values_list('organization').distinct() > > The count returns 189 results but when I send it to output to a csv it > returns all of the values, with duplicates which is something like 900 > entries. by duplicates do

values() returning more than values

2010-07-21 Thread Nick
I may be misunderstanding the values method but it is returning duplicate results when I use the distinct method. I have a query that pulls the values of a column: Readers = Readers.objects.values_list('organization').distinct() The count returns 189 results but when I send it to output to a csv

Re: Template tag does not like parameters with filters ({% with foo as bar %} question)

2010-07-21 Thread Micky Hulse
Hi, > Is my above assumption correct? If so, is there an easy fix? Someone else asked the same question a few hours after I posted my question: They were much more to the point. :) I need to train myself to look at the django source before asking for help here.

filebrowser not uploading

2010-07-21 Thread Bobby Roberts
Django 1.2.1 (mod_wsgi 3.2/Python 2.5) django-tinymce 1.5 filebrowser (trunk) i am getting no errors but filebrowser will not upload images. I can create directories through filebrowser fine. Can you think of any reason images would not be loading? -- You received this message because you

Re: Help and Training

2010-07-21 Thread zero00
Well Fred the enviorment where I live theres almost no programmers and the ones that I do know that are experienced are Java developers. Theres really no Programming community at all. Much less a language that is new and also not studied on the universities here. So I have that disadvantage. On

manage.py hangs near (or at) the end

2010-07-21 Thread psgou...@gmail.com
I've seen a few references to something like this happening, but nothing quite right. somewhere along the line, I have become unable to run manage.py and have it exit cleanly. it will appear to do everything that it is supposed to do. (with exceptions,) and then hang. for example, in mysql,

javascript in template

2010-07-21 Thread T.L
ok, so I have a very simple test template I have made. What I want it to do is use javascript to run another view inside of this template. I have a view called javaScriptTest and this view returns HttpResponse('javaTest.html). In javaTest.html, I call a small piece of script: In "anotherView"

ModelForm: setting widget to HiddenInput does not make field hidden

2010-07-21 Thread Jacob Fenwick
I'm building a form for the user model that creates a User, but I only want it to make the creator enter an email address. To do this I want to make the username field be hidden. I'm trying to do this by making the widget be a HiddenInput. Here is my form: class

Re: Composite Primary Keys Status?

2010-07-21 Thread Russell Keith-Magee
On Wed, Jul 21, 2010 at 9:18 PM, Rory Hart wrote: > Hey Folks, > Just wondering if anyone had been squirreling away on the composite primary > key support that David Cramer and others were working on. It doesn't appear > any commits have been made on the git for almost a year

Re: using the update() method

2010-07-21 Thread Santiago Perez
I think that what you want can be accomplished by: from django.db.models import F readers = Readers.objects.filter(status=active) readers.update(sorter=(F('library') + F('book')) On Wed, Jul 21, 2010 at 19:40, Nick wrote: > > I am trying to loop through a queryset and

Re: Inspect a Model in Django

2010-07-21 Thread Santiago Perez
from looking at the fields_for_model(...) method in django.forms.model, it doas opts = model._meta for f in opts.fields + opts.many_to_many: # for each field it ends up calling f.formfield() which in CharField is implemented as: def formfield(self, **kwargs):

using the update() method

2010-07-21 Thread Nick
I am trying to loop through a queryset and assign values to a field based on other values in that entry. So something like this readers = Readers.objects.filter(status=active) for reader in readers: library = reader.library book = reader.book readers.update(sorter="%s%s" % (lirbary,

Re: formatting values list

2010-07-21 Thread Nick
Perfect, thanks On Jul 21, 4:50 pm, n3ph wrote: >  Definitely the better way.. > > On 07/21/10 23:42, Franklin Einspruch wrote: > > > Nick, > > > I think you're looking for this: > > >http://docs.djangoproject.com/en/dev/howto/outputting-csv/ > > > Franklin > > > On Wed, Jul

how to concatenate 2 columns in query

2010-07-21 Thread Sells, Fred
My queries return XML similar 2 this . . . I would like to return name="Jones, Mary" instead. The template that I use to convert the list of dictionaries to xml is used for many different "datagrid" types of queries so I don't really want to change it. I suppose I could use list

Re: ModelForm subclass of UserCreationForm fails to exclude fields

2010-07-21 Thread Jacob Fenwick
Actually, I just came across this ticket: http://code.djangoproject.com/ticket/13971 Seems to describe my problem exactly. Sounds like a new bug. Jacob On Wed, Jul 21, 2010 at 6:00 PM, Jacob Fenwick wrote: > class FooCreationForm(UserCreationForm): > email =

ModelForm subclass of UserCreationForm fails to exclude fields

2010-07-21 Thread Jacob Fenwick
class FooCreationForm(UserCreationForm): email = forms.EmailField(label=_("E-mail address")) class Meta(UserCreationForm.Meta): fields = ('email', 'username') exclude = ('password1', 'password2') I would think that this form would show me only the email and password in

Inspect a Model in Django

2010-07-21 Thread Rex
Hi All, I am using Django 1.1, say I have a model like: class MyModel(Model): someField = CharField(max_length=32) if I have another class that receives an instance of the model, can I read the max_length there? class Hypothetical_form (forms.Form): def __init__(self, model_instance):

RE: Help and Training

2010-07-21 Thread Sells, Fred
FWIW I'm an old time Pythonista who was also forced into a Java world, but the pendulum has now swung back to Python. I would agree with the advice of others, but also offer the following: It is very hard to debug program logic in a web environment. I have my Django view convert anything I need

Re: formatting values list

2010-07-21 Thread n3ph
Definitely the better way.. On 07/21/10 23:42, Franklin Einspruch wrote: > Nick, > > I think you're looking for this: > > http://docs.djangoproject.com/en/dev/howto/outputting-csv/ > > Franklin > > > On Wed, Jul 21, 2010 at 5:38 PM, Nick wrote: >> I would like to format the

Re: formatting values list

2010-07-21 Thread n3ph
maybe this way: from django.shortcuts import get_list_or_404 from MY_APP.models * def values_view(request) list = get_list_or_404(MyModel) template = loader.get_template('mytemp.html') c = Context({'list': list}) html = t.render(c) HttpResponse(html) Template: {% for item

Re: Help and Training

2010-07-21 Thread Shawn Milochik
This list and the Python mailing list[1] are both great for that. Of course, both are forums where you get the best assistance by showing that you've tried and failed before you asked others for their time. Shawn 1. http://mail.python.org/mailman/listinfo/python-list -- You received this

Re: formatting values list

2010-07-21 Thread Franklin Einspruch
Nick, I think you're looking for this: http://docs.djangoproject.com/en/dev/howto/outputting-csv/ Franklin On Wed, Jul 21, 2010 at 5:38 PM, Nick wrote: > I would like to format the output of a values_list into something a > little more usable for a CSV. > > My view is

Help and Training

2010-07-21 Thread zero00
I'm a web developer and I would like to adopt Django as my primary web framework. But where I live there is no Python programmers at all. "I live in a Java Island :( " . So I'm in need of a mentor/trainer to get around some question that books either are too outdated right now and dont cover and

formatting values list

2010-07-21 Thread Nick
I would like to format the output of a values_list into something a little more usable for a CSV. My view is really simple def values_view(request) list = MyModel.objects.values_list('id', 'name', 'type') template = loader.get_template('mytemp.html') c = Context({'list': list})

Re: about some ideas for our very largest project

2010-07-21 Thread Antoni Aloy
2010/7/21 RNGLAB : > hi django peoples > > i m rıdvan from turkey and working in a web based big project for now > this project about web based healthcare and hospital systems. > and the project is realty big.. we have a team for this. > > we are searching a different tech.

Re: about some ideas for our very largest project

2010-07-21 Thread Javier Guerra Giraldez
On Wed, Jul 21, 2010 at 2:24 PM, RNGLAB wrote: > thanks for your ideas > > yes django is amazing framework for daily web applications. not for > core programming. this project's is needs very powerful cores > programming. it's usually accepted that most web frameworks

Re: about some ideas for our very largest project

2010-07-21 Thread CLIFFORD ILKAY
On 07/21/2010 03:24 PM, RNGLAB wrote: thanks for your ideas yes django is amazing framework for daily web applications. not for core programming. this project's is needs very powerful cores programming. Perhaps you ought to talk to the creators of the Turkish Linux distribution, Pardus,

Re: about some ideas for our very largest project

2010-07-21 Thread RNGLAB
thanks for your ideas yes django is amazing framework for daily web applications. not for core programming. this project's is needs very powerful cores programming. thanks again. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

django-tinymce no links allowed

2010-07-21 Thread Bobby Roberts
hi all. I'm using: Django 1.2.1 (mod_wsgi 3.2/Python 2.5) django-tinymce 1.5 i'm having an issue where the ahref link button is not working properly. Although I am getting the popup windows, i complete the data and hit the button but no link information is inserted. The only way to get a href

Re: request.is_ajax() good practices

2010-07-21 Thread DrBloodmoney
On Wed, Jul 21, 2010 at 1:37 PM, Juan Hernandez wrote: > Hey there, > I have been working a lot with request.is_ajax() to handle forms and the > results have been great so fat yet, I have a question about good practices > and best uses for this function. > Lets say that I

Re: distinct() ?

2010-07-21 Thread rmschne
statuscodes=Member.objects.values('status').order_by('status').distinct() It gives me the expected results. Three items in the dictionary from a database table of about 10,000 records: [{'status': u'ACTIVE'}, {'status': u'RESIGNED'}, {'status': u'TRANSFER'}] it's what i both expected and want.

Dangerous "If-Modified-Since"

2010-07-21 Thread Torsten Bronger
Hallöchen! We've programmed a Django app with mandatory login. Under somewhat obscure circumstances, the browser (Firefox and Chrome) sends spurious If-Modified-Since header fields and may take the page of another user from the browser cache. It is like this: 1. User A logs in. 2. User A

Re: distinct() ?

2010-07-21 Thread Subhranath Chunder
I would have rather done something simple like: set(Member.objects.values_list('status', flat=True)) Thanks, Subhranath Chunder. On Thu, Jul 22, 2010 at 12:03 AM, Subhranath Chunder wrote: > I thought you were trying to get: > > I'm expecting only the four distinct

Re: distinct() ?

2010-07-21 Thread Subhranath Chunder
I thought you were trying to get: I'm expecting only the four distinct records. You'll get a ValuesQuerySet or list of dictionaries with redundant keys this way. Thanks, Subhranath Chunder. On Wed, Jul 21, 2010 at 11:40 PM, rmschne wrote: >

Re: Inline forms

2010-07-21 Thread Ramesh
Thank you very much! On Jul 21, 10:02 am, Alex Robbins wrote: > You'll have to write your own javascript to add forms dynamically. > Django doesn't provide front-end javascript. > Here are some >

Re: distinct() ?

2010-07-21 Thread rmschne
Member.objects.values('status').order_by('status').distinct() from jaymzcd works perfectly. Thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this

Re: distinct() ?

2010-07-21 Thread Subhranath Chunder
> > > Member.objects.values('status').order_by('status').distinct() > > I don't think this will ever work, to achieve what is required by him. Thanks, Subhranath -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Facebook

2010-07-21 Thread mtnpaul
Trying to decide on which way to go with facebook http://github.com/teebes/django-facebookconnect.git or http://code.google.com/p/django-facebookconnect/ ? Same name, but very different apps. Does anyone have experience with either one? Does anyone have any other suggestions? -- You received

Re: custom tag and filtered value

2010-07-21 Thread Micky Hulse
> The django sources for the standard tags show the method, make > sure you are calling parser.compile_filter() on the relevant arg. Thanks David! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: distinct() ?

2010-07-21 Thread jaymzcd
"I've solved the problem by passing the returned dictionary through my own distinct() function which strips out duplicates." Don't roll your own implementations unless you actually really need to! It's bad practise and can introduce added complexity to your solution. The .distinct() call will

Re: Plese guide to solve this

2010-07-21 Thread jaymzcd
I'm going to guess you have been following along with the http://www.djangobook.com/ site. It was great in the day but *do not use that* now-a-days as it covers 0.96. There have been significant changes, one of which is the maxlength to max_length on CharFields. Stick with the particular version

request.is_ajax() good practices

2010-07-21 Thread Juan Hernandez
Hey there, I have been working a lot with request.is_ajax() to handle forms and the results have been great so fat yet, I have a question about good practices and best uses for this function. Lets say that I executed a function that returned True and instead of sending the boolean to the

Re: distinct() ?

2010-07-21 Thread jaymzcd
I'm guessing your Members model is referencing the User model? Check the ordering as related models will influence your distinct. If your Members model has its own ordering that will also come into effect even though your picking your value out explicitly: "If you order by fields from a related

Iterating over model instances ordered_with_respect_to in templates

2010-07-21 Thread Marek Dudek
Hello I have two models and 1-to-many relation between them, using ForeignKey (gallery with pictures). Additionally instances on 'many' side are ordered_with_respect_to owning instance. I need to iterate over them in template, respecting imposed order. I can use "get_pictureingallery_order"

Re: distinct() ?

2010-07-21 Thread rmschne
Yep. (as I slap my forehead). I read that but erroneously concluded that since I had no sort_by on the query, I didn't pursue it. There is a default ordering in the model. I've solved the problem by passing the returned dictionary through my own distinct() function which strips out duplicates.

Re: distinct() ?

2010-07-21 Thread Scott Gould
Does your model refer to any other fields for its default ordering? http://docs.djangoproject.com/en/1.2/ref/models/querysets/#distinct On Jul 21, 1:06 pm, rmschne wrote: > I'm trying to use the distinct() and it's giving me unexpected > results.  Surely it's something

distinct() ?

2010-07-21 Thread rmschne
I'm trying to use the distinct() and it's giving me unexpected results. Surely it's something simple, but I can't spot it. I've referred to http://docs.djangoproject.com/en/dev/ref/models/querysets/#distinct In SQL, it would be: select distinct status from members; in Django I am using:

Re: Plese guide to solve this

2010-07-21 Thread Subhranath Chunder
Must be using very old docs: Use these instead: http://docs.djangoproject.com/en/dev/ Thanks, Subhranath Chunder. On Wed, Jul 21, 2010 at 8:47 PM, n3ph wrote: > Another one who's confused about all the deep API-Changes in Django :-( > > But reading the doc's is very

Re: best practice for widget that edits multiple model fields

2010-07-21 Thread Scott Gould
I'd definitely go that route (I think the "serialized data" bit in your first post made me think you wanted to just wrap it up and be done with it). I'd probably even make it a OneToOneField instead of a ForeignKey to reinforce the concept that an EventDateRange is a dedicated satellite bit of

Django mod_wsgi PicklingError while saving object

2010-07-21 Thread Etam
Do you know any solution to this: [Thu Jul 08 19:15:38 2010] [error] [client 79.162.31.162] mod_wsgi (pid=3072): Exception occurred processing WSGI script '/home/www/shop/ django.wsgi'., referer: http://shop.domain.com/accounts/checkout/? [Thu Jul 08 19:15:38 2010] [error] [client 79.162.31.162]

Re: How retrieve a single object rather than a list from DB?

2010-07-21 Thread Michael
On Wed, Jul 21, 2010 at 12:04 PM, Darius Damalakas < darius.damala...@gmail.com> wrote: > Hi, > > I want to select a single object or get None if my query does not > return a single object. > > > So far here is what i have found in the docs (http:// >

How retrieve a single object rather than a list from DB?

2010-07-21 Thread Darius Damalakas
Hi, I want to select a single object or get None if my query does not return a single object. So far here is what i have found in the docs (http:// docs.djangoproject.com/en/dev/topics/db/queries/#limiting-querysets): To retrieve a single object rather than

csrf_exempt ==> anonymoususer ??

2010-07-21 Thread Oran
Hi, I'm using django 1.2 behind Apache 2.2.x, and authenticating with mod_python PythonAuthenHandler. My purpose is to call a view function from a non-human authorized HTTP client. Hence, I would like to use both the @csrf_exempt and the @user_passes_test decorators together. However, there

Re: Free web-hosting sites that support Django ?

2010-07-21 Thread Qwavel
I'm looking at using Google App Engine for Django. You requested Python > 2.5, but Django doesn't work with Python 3.x, and 2.7 it just out the door, so the only thing beyond 2.5 is 2.6 and I don't think the difference is that big. I can't deny, though, that it would be nice if GAE would add

Re: ManyToMany incompatibility between Django 1.1 and 1.2?

2010-07-21 Thread Yngve Nysaeter Pettersen
Hello Russel, Ticket submitted: http://code.djangoproject.com/ticket/13975 IIRC there has been no identifier length warnings when I have validated or synced the tables. While I was at it, I also filed a ticket about a pet-peeve in the admin view: http://code.djangoproject.com/ticket/13976

Re: Plese guide to solve this

2010-07-21 Thread n3ph
Another one who's confused about all the deep API-Changes in Django :-( But reading the doc's is very helpful to preventing you from thees traps... Am 21.07.2010 17:04, schrieb euan.godd...@googlemail.com: The traceback tells you exactly what the problem is. The correct kwarg is max_length

Re: Free web-hosting sites that support Django ?

2010-07-21 Thread Bill Liao
On Wed, Jul 21, 2010 at 9:28 PM, Ron Barak < google_maps_forum.comve...@9ox.net> wrote: > Hi, > > I'm starting to learn Django, and was wandering if there were any free > web-hosting sites that would support modern Python (e.g. > 2.5) and > Django ? > > Once the site I have in mind is developed

Re: iPython and Django issue

2010-07-21 Thread Shawn Milochik
Are you using the default version of Python that came with Snow Leopard? If so, try a virtualenv. I did some searching on Google and saw similar errors reported but it seems that bugs which would cause them have been patched in current versions. I do all my development in virtualenvs with

Re: iPython and Django issue

2010-07-21 Thread Dario Ghilardi
2010/7/21 Shawn Milochik > Evidently the function you are trying to call has been moved. I see, but that function is called by iPython, not by me. This is a bit strange. 2010/7/21 euan.godd...@googlemail.com > I think you need to install readline

Re: Plese guide to solve this

2010-07-21 Thread euan.godd...@googlemail.com
The traceback tells you exactly what the problem is. The correct kwarg is max_length On Jul 21, 2:00 pm, balu wrote: > Respected sir > > This is balu studying B.Tech third year. I started working on django > in order to create dynamic website. My Python version is 2.6.5. While

Re: Plese guide to solve this

2010-07-21 Thread Subramanyam
Hi In your models.py Change the below to name = models.CharField(maxlength=30) this name = models.CharField(max*_*length=30) underscore is the diff Regards Subramanyam On Wed, Jul 21, 2010 at 6:30 PM, balu wrote: > Respected sir > > This is balu studying B.Tech third

Re: Plese guide to solve this

2010-07-21 Thread Shawn Milochik
> > > TypeError: __init__() got an unexpected keyword argument 'maxlength' > > Your error is right there, at the bottom of your stack trace. The keyword maxlength is not valid. You probably meant max_length. In the future, please actually read the error message output. It is usually very helpful.

Re: Inline forms

2010-07-21 Thread Alex Robbins
You'll have to write your own javascript to add forms dynamically. Django doesn't provide front-end javascript. Here are some ideas: http://stackoverflow.com/questions/501719/dynamically-adding-a-form-to-a-django-formset-with-ajax Hope that helps, Alex On Wed, Jul 21, 2010 at 9:52 AM, Ramesh

Re: iPython and Django issue

2010-07-21 Thread euan.godd...@googlemail.com
I think you need to install readline before you compile python. iPython doesn't work properly without it, although I've never seen it give a traceback - it usually just looks a bit forlorn. On Jul 21, 2:02 pm, Ingo86 wrote: > Hello all, > i'm on MacOSX Snow Leopard and I

Re: iPython and Django issue

2010-07-21 Thread Shawn Milochik
Evidently the function you are trying to call has been moved. http://docs.python.org/library/commands.html Try subprocess instead of commands. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Free web-hosting sites that support Django ?

2010-07-21 Thread Shawn Milochik
http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Free web-hosting sites that support Django ?

2010-07-21 Thread Ron Barak
Hi, I'm starting to learn Django, and was wandering if there were any free web-hosting sites that would support modern Python (e.g. > 2.5) and Django ? Once the site I have in mind is developed and working in beta on the free web-hosting site, I'll get myself a real domain and paid web- hosting,

iPython and Django issue

2010-07-21 Thread Ingo86
Hello all, i'm on MacOSX Snow Leopard and I have an issue with iPython. When i launch "python manage.py shell" I get the following error: Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File

Plese guide to solve this

2010-07-21 Thread balu
Respected sir This is balu studying B.Tech third year. I started working on django in order to create dynamic website. My Python version is 2.6.5. While I'm using creating a app the following error has displayed in the command line. /

Re: Inline forms

2010-07-21 Thread Ramesh
I had already gone through those tutorial, they are really great. Here is my problem: At django tutorial it has two tables defined at models, Poll and Choice, Choice table has a foreign key that refers to Polls table. When adding Poll questions, I can add choices at the same time which

Register Multiple ModelAdmins for a Table or Create a Admin View for a "Query"

2010-07-21 Thread Michael
Hello, I have two tables... one contains information about a Family and the other has all the Financial Records for them. I am trying to figure out (while staying within the framework/interface of the Admin Model) to pull the two tables together... My thoughts were that for the Family

Searching in Admin View --- Foreign Key

2010-07-21 Thread Michael
Is there a way to search on the Foreign Key's __str__ representation in admin views? I have the FK listed in the search_fields but it fails to find it. Thanks, Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Searching in Admin View --- Foreign Key

2010-07-21 Thread Michael
Is there a way to search on the Foreign Key's __str__ representation in admin views? I have the FK listed in the search_fields but it fails to find it. Thanks, Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Is Django right for what I am trying to do

2010-07-21 Thread SteveB.
Hi Bradley, Just my 2c re feeling comfortable with how django does things:- A high level walkthrough of which bits of Django are used and how they fit together. 1. You define the URL's that you want to present via a web server in urls.py. 2. In the urls.py file you configure url's and map these

Sending emails, threads, progress back to user

2010-07-21 Thread Michael Hipp
I've been googling extensively but can't seem to find an real answer for this... - User clicks a button to send a batch of emails to customers - Django view kicks off a thread to send the emails using django.core.mail - The view response sends the user to a page that will monitor progress

Re: about some ideas for our very largest project

2010-07-21 Thread derek
On Jul 21, 11:07 am, RNGLAB wrote: > hi django peoples > > i m rıdvan from turkey and working in a web based big project for now > this project about web based healthcare and hospital systems. > and the project is realty big.. we have a team for this. > > we are searching

Re: Inline forms

2010-07-21 Thread Alex Robbins
The ability to make multiple forms of the same type is a formset. http://docs.djangoproject.com/en/1.2/topics/forms/formsets/#topics-forms-formsets If you want those forms to represent models, then you want a model formset. http://docs.djangoproject.com/en/1.2/topics/forms/modelforms/#id1 Hope

Re: Send email attachment from memory buffer

2010-07-21 Thread Michael Hipp
On 7/20/2010 9:08 PM, Ale wrote: On Tue, Jul 20, 2010 at 10:04 PM, Michael Hipp > wrote: Is it possible to give it a file-like object instead? Did you see the documentation regarding creating an EmailMessage and the attach() method? """You can

Re: Problem validating two forms in a view

2010-07-21 Thread Renne Rocha
That's exactly what I need!!! Thank you! On Wed, Jul 21, 2010 at 12:15 AM, Ivan wrote: > http://charlesleifer.com/blog/djangos-inlineformsetfactory-and-you/ > might be the one you're looking for. > > Cheers, > Ivan > > > > On Wed, Jul 21, 2010 at 7:30 AM, Renne Rocha

Re: best practice for widget that edits multiple model fields

2010-07-21 Thread Brad Buran
<> Hi Scott: Thank you for the suggestion. I reviewed the docs, and it appears like it could work but would restrict the functionality. For example, I would have to somehow serialize two datetime types plus a boolean

Re: custom tag and filtered value

2010-07-21 Thread David De La Harpe Golden
On 20/07/10 22:57, owidjaya wrote: > how can i pass a filtered value to a custom tag? > > ie > if i do this > > > {% somecustomtag template_variable|lower %} > The django sources for the standard tags show the method, make sure you are calling parser.compile_filter() on the relevant arg.

Re: best practice for widget that edits multiple model fields

2010-07-21 Thread Brad Buran
Hi Scott: Thank you for the suggestion. I reviewed the docs, and it appears like it could work but would restrict the functionality. For example, I would have to somehow serialize two datetime types plus a boolean type into a single database column. This would take away a lot of advantages

Re: Possible to create models programatically?

2010-07-21 Thread Daniel Roseman
On Jul 21, 1:56 am, Andy wrote: > I have N models that are identical except the model names (i.e. they > all have the same attributes, methods): > > MyModel0, MyModel1, MyModel2, ... > > Normally I'd need to type out the model definitions for those N models > by hand

Composite Primary Keys Status?

2010-07-21 Thread Rory Hart
Hey Folks, Just wondering if anyone had been squirreling away on the composite primary key support that David Cramer and others were working on. It doesn't appear any commits have been made on the git for almost a year and a half so I'm wondering if anyone is still working on it. I'm happy to put

about some ideas for our very largest project

2010-07-21 Thread RNGLAB
hi django peoples i m rıdvan from turkey and working in a web based big project for now this project about web based healthcare and hospital systems. and the project is realty big.. we have a team for this. we are searching a different tech. from .net or java. than we find and develop some ideas

session cookie problem in IE

2010-07-21 Thread vamsy krishna
Hi, I am doing the below in my login form. I am setting the session cookie expiry to expire on close of browser unless the user chooses the remember me on this computer option. My problem is that the cookie expires mid-way and too frequently between user actions on IE. Is there anything more i

Re: Send email attachment from memory buffer

2010-07-21 Thread Ale
On Tue, Jul 20, 2010 at 10:04 PM, Michael Hipp wrote: > I will be sending pdfs generated from django and would like to email them > but without writing them to the filesystem. > > I can generate the pdf to a buffer but django.core.mail seems to only > handle attachments that

Re: Possible to create models programatically?

2010-07-21 Thread Ale
On Tue, Jul 20, 2010 at 9:56 PM, Andy wrote: > Normally I'd need to type out the model definitions for those N models > by hand inside models.py. > > Is there a way to generate the N model definitions programatically > instead of manually? > > Did you try creating an

Re: best practice for widget that edits multiple model fields

2010-07-21 Thread Scott Gould
My immediate thought upon reading your post was that you should build an accompanying custom model field. Having said that, I haven't had cause to do one that involved (only extend -- simply -- the stock fields) so can't provide any specifics.

Re: import model from other module

2010-07-21 Thread David De La Harpe Golden
On 20/07/10 20:04, Andreas Pfrengle wrote: > I've tried it with and without installing in settings.INSTALLED_APPS, > didn't work, table wasn't created vis syncdb. > > David, nevertheless the link you've posted gave me the clue how to > solve the problem. I've defined my external module's class

Re: can foreign key fields be empty?

2010-07-21 Thread rmschne
Em, Perfect. Thanks for taking the time on this. Greatly appreciated!! I'm going to re-write the code here. (in all my reading, I missed _isnull field lookup) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email