Re: flatpages templatetags missing

2011-01-31 Thread Adi
% extends "base.xhtml" %} > > {% block content %} > {{flatpage.content}} > > {% endblock %} > > On 31 янв, 08:10, Adi <aditya.rus...@gmail.com> wrote: > > > Hi: > > I am trying to use flatpages in my app, and i set up the settings.py > >

flatpages templatetags missing

2011-01-30 Thread Adi
Hi: I am trying to use flatpages in my app, and i set up the settings.py correct, and I am able to create the flatpages using the admin site. However, when in my app I try to load the template tags for flatpages using: {% load flatpages %} I get a TemplateSyntaxError Exception Value:

Re: Show HTML in Labels for Model Choice Fields

2011-01-02 Thread Adi
django.forms import ModelChoiceField from django.utils.safestring import mark_safe class ThemeChoiceField(ModelChoiceField): def label_from_instance(self,obj): return mark_safe("%s - Click here to see an example. \ " \ % (obj.name, obj.pk, obj.pk, obj.image.url)) -Adi

Show HTML in Labels for Model Choice Fields

2010-12-30 Thread Adi
Hi I have a situation like this class AppearanceThemesForm(forms.Form): page_theme = forms.ModelChoiceField(widget=forms.RadioSelect(attrs={'title':'Select the appropriate theme for your pages.'}), queryset=Theme.objects.filter(section="1"),

Passing data into django-registration

2010-09-22 Thread Adi
So I have this situation. I have users that register with the application. Prior to registration, they have to choose a pricing plan. So on page 1, there are 3 links that all link to register, but the first one is for a basic pricing plan, the 2nd for a premium and 3rd for enterprise. When they

Re: Custom manager and delete()

2009-08-10 Thread Adi Andreias
I manage to do row delete operations. Not very nice, since there's no delete-related, no signalst etc. I don't think delete can be fixed for multiple databases without modifying Django source or without duplicating code. Since delete_objects function uses the global connection variable. Would be

Re: Custom manager and delete()

2009-08-09 Thread Adi Andreias
Hello, Anyone can give us a hint with this? I have the same problem: with a custom manager (for a 2nd database) SELETs and INSERTs are working, but not the DELETE operation. Seems like DELETE references a global connection variable (to the main database). Thanks michael wrote: > Hi, > >

Dynamic/complex forms

2009-08-07 Thread Adi Andreias
Hello Django-ists, I'm looking for a Django component that solves this problem: In real life forms are often more complex than just displaying some fields and doing validation on them. Often fields are required or not, they appear or not, have different validation rules based on other fields

fastcgi memory usage

2009-07-25 Thread Adi
I'm running a couple of django sites on a VPS with nginx and fastcgi and I'm a little concerned because of the memory usage. According to the "free" command, each site uses about 50MB of RAM (I've ran free before and after starting the fastcgi daemons and each sites seems to use the same amount).

Re: Ajax with JSON-RPC -- new Django handler

2009-06-18 Thread Adi Andreias
This module could be useful, but there are all sort of problems in code. Like, __public__ = True you meant: self.__public__ = True ? After fixing that I get: AttributeError: 'tuple' object has no attribute 'args' on line return [ a for a in getargspec(self.method).args if (a != "self") ] This

Re: Using Request Info in Generic Views

2009-06-02 Thread Sieker Adi Jörg
/howto/custom-template-tags/#howto-custom-template-tags adi On 02.06.2009, at 13:33, Keyton Weissinger wrote: > > I know I'm in the minority, but I'm still having some trouble grokking > the details of generic views. I keep thinking I should be using them > but keep running into th

Re: accessing model instance in ModelAdmin.get_urls

2009-05-27 Thread Sieker Adi Jörg
Hi Alex, On 26.05.2009, at 22:52, Alex Gaynor wrote: > > > On Tue, May 26, 2009 at 3:41 PM, Sieker Adi Jörg <a...@sieker.info> > wrote: > > Hi, > > I'm implementing some new urls in my ModelAdmin.get_urls method and > I need access to the current model

accessing model instance in ModelAdmin.get_urls

2009-05-26 Thread Sieker Adi Jörg
Hi, I'm implementing some new urls in my ModelAdmin.get_urls method and I need access to the current models instance or id. I didn't find anything in the ModelAdmin docs, but maybe I'm just blind. Any pointers in the right direction would be nice. Thanks Adi

Re: When to use admin, and when not to.

2009-05-26 Thread Sieker Adi Jörg
On 26.05.2009, at 14:28, Sam Kuper wrote: > 2009/5/26 Sieker Adi Jörg <a...@sieker.info> > In my humble opinion. As soon as you mention users, the admin is the > wrong tool. > contrib.admin is for admin's and not for users. > > Another take on it is: > - Anyone that

Re: When to use admin, and when not to.

2009-05-26 Thread Sieker Adi Jörg
rs, the admin is the wrong tool. contrib.admin is for admin's and not for users. Another take on it is: - Anyone that creates an account on your site, doesn't get to ses the admin - Anyone that you create an account for, might be a user to get to see the admin. Regards adi --~--~-~--~~

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-25 Thread Sieker Adi Jörg
Hi, On 25.05.2009, at 10:59, Mike Ramirez wrote: > On Monday 25 May 2009 01:41:31 am Andy wrote: > >> But how do I stop user A from trying to edit the profile of user B? > > in urls.py > > url(r'profile/(P)/', 'up.views.profile', name='profile') you don't need the user name in the url for edit

Re: environment variable DJANGO_SETTINGS_MODULE is undefined

2009-05-07 Thread Sieker Adi Jörg
Hi, On 07.05.2009, at 16:02, bconnors wrote: > > I saw this chat related to DJANGO_SETTINGS_MODULE is undefined. > Hello I am new to Django. > I am trying to exercise "templates" through the interactive shell, > however I end up getting this error. Can anyone help? > here is the exact steps I

Re: django.views.generic.date_based.object_detail called through a custom function - simple issue

2009-04-22 Thread Sieker Adi Jörg
sed.object_detail( >> request, >> year, >> month, >> day, >> Mymodel.objects.filter(status=1), >> 'pub_date', >> slug = 'slug', this sould probably be: slug = slug adi --~--~-~--~~---

Re: Registration

2009-04-21 Thread Adi
I agree with Parveen. Have you read the tutoria? http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01l On Apr 17, 5:35 pm, TP wrote: > Hi I have a HTML website and im looking to use Django-registration > with it. > > I have downloaded the registration

Re: Models.py - retrieve information from other models via ForeignKey field?

2009-04-15 Thread Adi
paste the code for your models --~--~-~--~~~---~--~~ 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

Re: Form Wizard and captcha

2009-04-13 Thread Adi Sieker
r the second validation of it). > Is there any chance to get it into the trunk? > Do I need to make any additional steps for this to happen? open a ticket on code.djangoproject.com/simpleticket attach the patch and see what the devs think of it. adi > > Kirill. > > On 8 апр, 22:29, q

Re: How To Change App Label in Admin Pages

2009-04-09 Thread Adi Sieker
pages. But I dont't want to override >> admin html >> pages. Can i add a new name to appp like verbose name in models? This might help: http://code.djangoproject.com/ticket/10436 adi --~--~-~--~~~---~--~~ You received this message because you ar

Re: Positive integer form field with max lenght

2009-04-09 Thread Adi Sieker
To actually achieve what you want read through the form validation docs http://docs.djangoproject.com/en/dev/ref/forms/validation/ adi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: Does anyone know how to prepopulate a form with model data

2009-04-09 Thread Adi Sieker
e tried. >> >> s = get_object_or_404(Scientist, pk=7) >> form = ScientistProfileForm(initial=s) >> have you tried making a dict with the keys being the fieldnames and the dict values should then be prepopulated in the fields. adi >> I've also tried. >> >

Re: Pre-filling form data without submission?

2009-04-08 Thread Adi Sieker
e errors but I still don't think that is the best way > to do it. > > Any help would be appreciated. > If you create tHe Form ala form = Form( initial={'user': request.user}) it should prepopulate the field and not throw validation errors. if on the other hand you create the form like

Re: request.user Null value in foreign key save[Repost]

2009-04-08 Thread Adi Sieker
ormContent.save() > try. # create the new Property model instance, but don't save it to the DB. new_property = formContent.save(commit=False) # assign the user. new_property.user = request.user #save the model instance to the DB. new_property.save() adi --~--~-~--~~--

Re: OperationError: fe_sendauth: no password supplied

2009-04-08 Thread Adi Sieker
Hi, a full traceback would be helpful. did you supply a password for your database in the settings.py? adi On 08.04.2009, at 15:12, LeeRisq wrote: > > I've been following along with the Djangobook. When I try to configure > the postgresql db, I get that error. I've tried tracing th

Re: Determining server identity from views.py?

2009-03-31 Thread Adi Sieker
really need to determine between devserver and mod_python or do you actually want to determine between dev and production server? If it's just dev and production server why not use settings.DEBUG? adi --~--~-~--~~~---~--~~ You received this message because you are

Re: Django and IIS 7

2009-03-26 Thread Adi Sieker
ck google for django on iis7 turned up this: http://ironpython-urls.blogspot.com/2008/11/wsgi-on-net-and-in-cloud.html adi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Django form: Allow user to insert a date in dd-mm-yyyy format and then convert in yyyy-mm-dd

2009-03-19 Thread Adi Sieker
ere are some regression tests which show you how to use the Fields. adi > On 18 Mar, 13:45, Adi Sieker <a...@sieker.info> wrote: >> Hi, >> >> On 18.03.2009, at 13:01, MarcoS wrote: >> >> >> >>> Hi Adi, thanks for your reply! >>

Re: yet another unicode question...

2009-03-18 Thread Adi Sieker
hings on different threats with no success at all > > Everything on the DB is utf8 and I also have DEFAULT_CHARSET = > 'utf8' at settings.py > > How can I have django display html code from the databse without any > problems? Read this http://docs.djangoproject.com/en/dev/releas

Re: Using

2009-03-18 Thread Adi Sieker
in html to mark the spot > > > ...in html to jump to the spot. > < href="/mypage#top_of_page"> > I'd guess that the href doesn't match the current url, so the browser think it has to load the page in the href before being able to jump to the ancho

Re: DateField with Django

2009-03-18 Thread Adi Sieker
different countries use different customs to > represent dates and I'd like to represent the date in another > international format (%d-%m-%Y). Any help would be very much > appreciated! > > A major thanks, Check this ticket: http://code.djangoproject.com/ticket/3672 adi -- Adi J. Sieker

Re: Django form: Allow user to insert a date in dd-mm-yyyy format and then convert in yyyy-mm-dd

2009-03-18 Thread Adi Sieker
Hi, On 18.03.2009, at 13:01, MarcoS wrote: > > Hi Adi, thanks for your reply! > > I had just tried the DateField.input_formats, but the problem was that > I'm using the date admin widgets. > If I specify input_formats like: '%d.%m.%y', I can't use the admin > widgets 'cau

Re: Django form: Allow user to insert a date in dd-mm-yyyy format and then convert in yyyy-mm-dd

2009-03-18 Thread Adi Sieker
function, but directly in views.py or forms.py before > cleaning the date? check the DateField form widget. It allows you to specify what format the date should be in. http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield adi --~--~-~--~~~---~--~~ You

Re: Django Pluggable application for invoicing / accounts?

2009-03-06 Thread Adi Sieker
Hi, there is also djime http://github.com/mikl/djime/tree/master though that leans more in the direction of hourly charges. adi On 06.03.2009, at 21:15, John Boxall wrote: > > Trolling through the board a bit here are some other postings on > similar topics: > > Suggesting loo

Re: Adding a slug

2009-01-24 Thread Adi Sieker
Hi, as far as I know loaddata doesn't use the ORM to insert the data. So things like signals and overloaded save methods don't work when using loaddata. adi On 24.01.2009, at 17:48, Kless wrote: > > > > On 24 ene, 15:51, Daniel Roseman <roseman.dan...@googlemail.com> &

Re: Flatpages

2009-01-21 Thread Adi Sieker
Hi, check this out. http://code.djangoproject.com/ticket/6932 adi On 21.01.2009, at 16:53, Gordon wrote: > > Hi > I've just started to use Django and have been using the flatpages > plugin for serving static pages. Does anyone know how or a plugin that > will generate a cont

Re: Problem saving a User object to a profile

2008-12-19 Thread Adi Sieker
e. So you should be able todo: profile = profile_form.save() profile.user = user profile.save() that'll cause 2 database hits, but should work fine. adi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Re: range-like template tag?

2008-12-08 Thread Adi Sieker
return range(self.someInt) in your template you could then do: {% for i in object.get_range %} adi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: Two different django version on the same server?

2008-12-07 Thread Adi Sieker
orms admin version of django and then a duplicate of this VirtualHost where the points to a trunk version of django. The _really_ important part is that sys.path comes after the version you want to use for this host. Since sys.path will include your site.packages it'll find the trunk version f

Re: Django ORM and phpMyAdmin

2008-11-26 Thread Adi Jörg Sieker
listener (method). It can't tell PHPMyAdmin that something has changed. > If you have other informations about ORM or a way to bind the whole > thing together. > You won't be able to bind PHPMyAdmin with the Django ORM, the two things have nothing to do with one another. adi --

Re: Executing raw Python

2008-11-24 Thread Adi Jörg Sieker
Hi, if you are using 1.0 or newer, than you can use a file backend to directly on S3. Have a look if http://code.google.com/p/boto/ or http://github.com/paltman/django-aws/tree/master help you along. adi On 24.11.2008 18:35 Uhr, Alex Jonsson wrote: > Hey everyone, > > I u

Re: Upload Form does not validate

2008-11-12 Thread Adi Jörg Sieker
pped] > The problem is that in the view the form never validates, it always > behaves like if the form were submitted with all fields blank. > > Any hint? > > You are mising the multipart/form-data bit in you html form. Have a read in the docs: http://docs.djangoproject.com/en

Re: how to get the id in an admin template

2008-11-04 Thread Adi Jörg Sieker
ethod, then the Admin will automatically create a "view on site" link on the change detail page. See also http://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolute-url adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer web:http://www.si

Re: changing the Manager the admin-site should use

2008-10-30 Thread Adi Jörg Sieker
site uses the first manager not necessarily the one called objects. If you do set a none default manager, be sure to also set an objects manager, since django won't create the objects manager if it already finds a different manager. adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88

Re: Where to put signals?

2008-10-29 Thread Adi Jörg Sieker
o can initialize itself. I sometimes just create a module named core in the project directory and place stuf I need in various place there. how about creating an app called global put the signals.py in there and in the __init__.py do an import signals. > @adi: > What do you mean by 'whatever

Re: Where to put signals?

2008-10-29 Thread Adi Jörg Sieker
it as an application but other than that you are free to create whatever you want. Gruß adi On 29.10.2008 9:17 Uhr, Benjamin Buch wrote: > Hi, > > short summary for all who didn't follow or don't remember (it's been a > while since the last reply...): > > I have signals wired up f

Re: Triggering a custom signal

2008-10-27 Thread Adi Jörg Sieker
your best bet is actually going for a normal cron job. or using something like django-cron adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer web:http://www.sieker.info/profile SAP-Developer --~--~-~--~~~---~--~~ You receiv

Re: datetime widget without admin

2008-10-25 Thread Adi Jörg Sieker
to your admin media files or add the setting ADMIN_MEDIA_PREFIX to the template context. adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer web:http://www.sieker.info/profile SAP-Developer --~--~-~--~~~---~--~~ You received this message be

Re: wrong redirect from admins "View on site" link

2008-10-25 Thread Adi Jörg Sieker
Hi, On 25.10.2008 13:48 Uhr, felix wrote: > its gets the domain value from the Site object. I'm guessing that you > have that domain set to "localhost" thank you very much. That was excatly the problem. Setting the site to localhost:8000 did the trick. adi -- Adi J. Sieke

wrong redirect from admins "View on site" link

2008-10-24 Thread Adi Jörg Sieker
rftime('%d'), 'slug': self.slug }) get_absolute_url = models.permalink(get_absolute_url) Is this a config issue on my side? adi [1] http://code.google.com/p/coltrane-blog/ --~--~-~--~~~---~--~~ You received this message because you are

Re: how to assign a value to a model object field

2008-10-15 Thread Adi Jörg Sieker
Lenny wrote: > Hi! > How can I assign a value to a model object field where the field name > in a string? > Just like any other object as far as I know. setattr(obj, fieldname, value) adi --~--~-~--~~~---~--~~ You received this message

Re: Can this be solved without hardcoded SQL?

2008-10-07 Thread Adi Jörg Sieker
to work for my solution. Is there an easier way? And can i get > rid of the SQL and use "pure" django models? > > Have a look at: http://docs.djangoproject.com/en/dev/ref/models/querysets/#dates-field-kind-order-asc adi --~--~-~--~~~---~--~~

Re: Perplexed

2008-09-17 Thread Adi
One more thing.. After logging in, user.is_anonymous and user.is_authenticated are both returning false. Why would this happen? On Sep 18, 12:29 am, Adi <[EMAIL PROTECTED]> wrote: > Hi, > I have built a login form using the django provided view. All i did in > the urls.py

Perplexed

2008-09-17 Thread Adi
and the if conditional is being evaluated as false even when the username/password are wrong. Also, once I login correctly, the user.is_authenticated is returning false. I am using the post 1.0 SVN any help, suggestions to trouble shoot would be most welcome. -Regards Adi

Re: weird osx problem (templates path)

2008-09-09 Thread Adi J. Sieker
e in this url. > http://www.deneloper.com/django-error/index.html > > please tell me, what is the problem :( what's the content of the directory /Users/onurozkan/Documents/django/bjango/templates? Is there a base.html in that directory? adi --~--~-~--~~~---~--~~ You

Re: neue Dateien für den Q-Spooler

2008-09-01 Thread Adi J. Sieker
Damn, wrong email address. Sorry about that. adi --~--~-~--~~~---~--~~ 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 unsubs

Re: Is it possible to use Django + Postgresql on leopard?

2008-08-23 Thread Adi J. Sieker
version that > everyone tells me to use is for Python 2.4, and I'm on Python 2.5. > all python 2.5 ports are called py25- so psycopg2 would be py25-psycopg2 sudo port install py25-psycopg2 adi --~--~-~--~~~---~--~~ You received this message because you are

Re: Practical Django Projects - Problem with CMS Search

2008-07-25 Thread Adi J. Sieker
DictKeyError at /search/ > "Key 'Q' not found in " > Request Method: GET > Request URL: http://127.0.0.1:8000/search/ > Exception Type: MultiValueDictKeyError > Exception Value: "Key 'Q' not found in ['test']}>" > ----

Re: How to display UserProfiles in newforms-admin

2008-07-20 Thread Adi J. Sieker
ing like: > > class UserProfile(models.Model): > ... > user = models.ForeignKey(User, unique=True, edit_inline=models.STACKED) > > How can the same effect be achieved with newforms-admin? The docs know all: http://www.djangoproject.com/documentation/admin/#inlinemodeladmin-object

Re: URLs rewrite

2008-07-09 Thread Adi J. Sieker
On Wed, 09 Jul 2008 16:06:23 +0200, Adi J. Sieker <[EMAIL PROTECTED]> wrote: > True, but then it opens another are which needs to be maintained. ups, thats meant tobe "another area" Regards Adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelanc

Re: URLs rewrite

2008-07-09 Thread Adi J. Sieker
l I do agree that mod_rewrite is faster. Regards Adi --~--~-~--~~~---~--~~ 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

Re: URLs rewrite

2008-07-09 Thread Adi J. Sieker
apache mod_rewrite > http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html > > Hope it helps! > or contrib.redirects see: http://www.djangoproject.com/documentation/redirects/ Regards Adi --~--~-~--~~~---~--~~ You received this message because y

querying an object

2008-07-07 Thread Adi
submitted. Thanks, -Adi --~--~-~--~~~---~--~~ 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 [EMAIL

Re: Share models among applications and split them in multiple files

2008-07-04 Thread Adi J. Sieker
els/__init__.py ? There is no magic in the models. You just need to make sure you added models_app to your INSTALLED_APPS directive in the settings.py. syncdb only install models from installed apps. Regards adi --~--~-~--~~~---~--~~ You received this message because you

Re: MySQL-python-1.2.2 - build errors

2008-07-02 Thread Adi J. Sieker
blog/2007/Nov/14/installing-django-leopard-mac-os-105/ Regards adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsieker SAP-Consultantweb:http://www.sieker.info/profile openbc: https://www.openbc.com/hp/AdiJoe

Re: MySQL-python-1.2.2 install problems

2008-07-01 Thread Adi J. Sieker
ically install py25-hashlib. See http://trac.macports.org/ticket/11931 Regards, adi --~--~-~--~~~---~--~~ 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

Re: ModelChoiceField setting value manually

2008-06-26 Thread Adi
. -Regards Adi On Jun 26, 12:27 pm, mwebs <[EMAIL PROTECTED]> wrote: > Hello, > > I try to set data for a ModelChoiceField() manually. This means the > data is not in my db, so it s not in a Queryset. > > my form: > > class PictureForm(forms.Form): >     image

problem getting mod_python to serve application..

2008-06-26 Thread Adi
django.core.handlers.modpython In my /usr/lib/python2.5/site-packages, I have lrwxrwxrwx 1 root root 34 Jun 25 13:52 django -> /home/adi/django- trunk/django/ In my python.conf apache conf file, LoadModule python_module modules/mod_python.so # Override typ

Need some help with form implementation.

2008-06-24 Thread Adi
appreciated. -Adi --~--~-~--~~~---~--~~ 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 [EMAIL

Re: Data representation question

2008-06-23 Thread Adi
I figured it out after going through the django source.. gotta create a subclass of MultiValueField and MultiWidget and then use em together. By the way.. django kicks is AWESOME. the best piece of code i have seen.. The django developers kick ASS!! On Jun 23, 9:23 pm, Adi <[EMAIL PROTEC

Data representation question

2008-06-23 Thread Adi
What is the best way of of implementing a form field that is comprised of multiple text fields.. lets say.. i want to capture the time that an athlete took to run a marathon. I'd want the user to be able to enter the hour, minute, seconds and milliseconds in separate fields.. Other ideas of

Re: Another question about form validation?

2008-06-23 Thread Adi
ere > > On Jun 23, 12:23 pm, Adi <[EMAIL PROTECTED]> wrote: > > > > > do you mean something like this. > > > class FormFoo(ModelForm): > > >         def __init__(self,*args,**kwargs): > >                    self.object1 = kwargs.pop('obj1') >

Re: Another question about form validation?

2008-06-23 Thread Adi
TED]> wrote: > Pass it through form custom constructor > > On Jun 23, 7:12 pm, Adi <[EMAIL PROTECTED]> wrote: > > > How do you pass model objects that you may need access to when > > implementing the clean() or clean_ methods? > > > In other words, how can

Another question about form validation?

2008-06-23 Thread Adi
How do you pass model objects that you may need access to when implementing the clean() or clean_ methods? In other words, how can a form access model objects that it may need access to perform its validation? --~--~-~--~~~---~--~~ You received this message

Re: Accessing model from view

2008-06-20 Thread Adi J. Sieker
interacting with your models in your views, you should already have an import statement for your models. adi > On Jun 20, 2:29 pm, "Richard Dahl" <[EMAIL PROTECTED]> wrote: >> sure, its just python: >> for r in ROLES: >>     r[0] #retrieves 'Associate' the first

Re: Initializing a form.

2008-06-20 Thread Adi
Thanks !!@ On Jun 19, 7:13 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > On Jun 19, 4:36 pm, Adi <[EMAIL PROTECTED]> wrote: > > > In order to set up the initial values on a couple of fields of my > > form, I need to pass in a couple of model objects to

Initializing a form.

2008-06-19 Thread Adi
In order to set up the initial values on a couple of fields of my form, I need to pass in a couple of model objects to my ModelForm's init method. What is the right way to write the __init__ method so that it works both when I initialize it with form data and without form data. How do i call the

ModelForm Question

2008-06-19 Thread Adi
Lets say I have a model: class Foo(models.Model): name = models.charField() age = models.IntegerField () Then I create a form like this: class FooForm (ModelForm): salutation = forms.ChoiceField(choices=common.SALUTATION_CHOICES, label="Salutation") class

Re: Form Validation

2008-06-11 Thread Adi
for the form. -Adi On Jun 11, 9:09 am, "Richard Dahl" <[EMAIL PROTECTED]> wrote: > Just an idea, not sure if it will work for you as I don't know a whole lot > about how it works, but wouldn't setting unique_together on the Relation > class for owner and pet accomplish what

Re: Form Validation

2008-06-11 Thread Adi
, which will return > an instance of the model, but doesn't save it to the db, so you can > just assign request.user to owner and than save it. > > On Jun 11, 12:07 am, Adi <[EMAIL PROTECTED]> wrote: > > > > > I guess... the more deeper question is.. how

Re: Form Validation

2008-06-10 Thread Adi
I guess... the more deeper question is.. how can I pass a related model object and potentiall an unrelated model object into the form's validations methods? On Jun 10, 10:42 pm, Adi <[EMAIL PROTECTED]> wrote: > Hi, > I have a model  Owner and a model Relation. > > class  Rel

Form Validation

2008-06-10 Thread Adi
RelationForm.is_valid() -Adi --~--~-~--~~~---~--~~ 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

Re: Problem with login()

2008-06-10 Thread Adi
I would check a couple of things. 1. Your session middleware is installed and configured. 2. 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', are in your installed apps 3. if your session mgr implementation is database

clean_ question

2008-06-10 Thread Adi
lue for eventtype and enters a value greater than 1 in the particpants, the program craps out saying key 'eventtype' not found in cleaned data. Is this a bug? What is the best way to do this? -Adi --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Dynamic initialization of MultipleChoiceField

2008-06-09 Thread Adi
gt; Isn't it necessary to initialize the super class with > > super(RecoverForm, self).__init__(*args, **kwargs) > > When I did so i got an illegal keyword argument! > > On Jun 9, 1:55 pm, Adi <[EMAIL PROTECTED]> wrote: > > > > > Another option would

Re: ModelChoiceField option values

2008-06-09 Thread Adi
The text displayed in the drop down comes from the __str__ method of the referenced model. So, just implement the __str__ method in the model that your ModelChoiceField references, and the display will show you that. On Jun 7, 10:55 am, Mihai Damian <[EMAIL PROTECTED]> wrote: > I'm using a

Re: Dynamic initialization of MultipleChoiceField

2008-06-09 Thread Adi
Another option would be to create a __init__ (self,choices=()) method on form Then in the method, assign self.fields['items'].choices = choices and when you instantiate a form, you can specify the choices choices = [('1', '1'), ('2', '2')] form=RecoverForm(choices) -Adi On Jun 9, 12:43 pm

clean_, EDIT versus CREATE case.

2008-06-08 Thread Adi
I have a UserForm that is a modelform on the model User. I have a method called clean_username(). The purpose of this method is ensure that the username that the user picks while creating a User object is not taken. So this works great when a new user is created. I also use the same form on my

Re: "Global" variables for templates

2008-06-08 Thread Adi J. Sieker
; or something? Thanks for any comments. If you are using the SVN version check out context processor they should do the trick: http://www.djangoproject.com/documentation/templates_python/#writing-your-own-context-processors adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freel

Re: Newform and validating of date literals

2008-06-08 Thread Adi J. Sieker
nk is also always Y-m-d and you currently can't change that. adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsieker SAP-Consultantweb:http://www.sieker.info/profile o

ModelChoiceField, Cascading Selections

2008-05-29 Thread Adi
I have a form that has three fields 1. State 2. League 3. School The model for League has a foreign Key into the model for State The model for School has a foreign Key into the model for League The user is supposed to chose the state first (which is USStateField), then the list of League is

Re: Json / Ajax problem

2008-05-28 Thread Adi J. Sieker
mwebs wrote: > I am sorry :-) could answer this by googling after "django > Querydict" > > __getitem__(key) is the solution. > doesn't request.POST["tags"] work, like with any other dict. adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freel

Re: Using login view

2008-05-27 Thread Adi
I just thought of a solution to my own problem. Instead of having three different 'next' pages, i should just have one page which adjusts itself based on who the user is. What else can I do? On May 27, 2:00 pm, Adi <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently using thelogi

Using login view

2008-05-27 Thread Adi
to the appropriate welcome page. Any suggestions on how to do this? if there are forms that I need to extend.. etc -Regards Adi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: IntegerField with choices raising an TypeError

2008-05-22 Thread Adi J. Sieker
? > > works fine here. I define my choiches like this. APPLICATION = 1 CUSTOMER = 2 EXCUSTOMER = 3 CUSTOMER_STATES = ( (APPLICATION, 'Anfrage'), (CUSTOMER, 'Jugendlicher'), (EXCUSTOMER, 'Ehemaliger'), ) adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance

Re: Adding Adjacent fields in the dajngo templates

2008-05-21 Thread Adi J. Sieker
> can anybody help me how to proceeds to solve this problem ? > > If you are using newforms, I suggest reading http://www.djangoproject.com/documentation/newforms/#outputting-forms-as-html adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsi

Re: Printing out HTML that doesn't get converted to

2008-05-16 Thread Adi J. Sieker
jangoproject.com/documentation/templates/#automatic-html-escaping adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsieker SAP-Consultantweb:http://www.sieker.info/profile

Re: Getting back to the same page after completing a task in another page

2008-05-15 Thread Adi J. Sieker
in has a login page that uses the contrib.auth login page. But you can still use contrib.auth even if the admin app is disabled. admin uses contrib.auth but it's not the other way around. adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsieker SAP-Cons

  1   2   >