Perplexed

2008-09-17 Thread Adi
d 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. -Regard

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 was

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: 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 d

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 app, but cannot see how I

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 cli

Using login view

2008-05-27 Thread Adi
redirect the user 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"

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 usi

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 supp

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 ed

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')] f

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 ModelC

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 be

clean_ question

2008-06-10 Thread Adi
es not select the value 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 me

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 based

Form Validation

2008-06-10 Thread Adi
hen I call 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,

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

Re: Form Validation

2008-06-10 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.. ho

Re: Form Validation

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

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

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

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

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 because

Re: Another question about form validation?

2008-06-23 Thread Adi
AIL PROTECTED]> 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 word

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&#x

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 repre

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

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 PROT

problem getting mod_python to serve application..

2008-06-26 Thread Adi
__import__(module_name, {}, {}, ['*']) ImportError: No module named 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 a

Re: ModelChoiceField setting value manually

2008-06-26 Thread Adi
step. -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): >     i

querying an object

2008-07-07 Thread Adi
been 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 [

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"), initial=Theme.objects.get(section="1",representa

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

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: 'flatpages'

Re: flatpages templatetags missing

2011-01-31 Thread Adi
ble the admin: >     'django.contrib.admin', >     # Uncomment the next line to enable admin documentation: >     'django.contrib.admindocs', >     'django.contrib.flatpages', > ) > > TEMPLATE_DIRS = ( >         '/var/www/html/tamada2/templates', >

Re: Two different django version on the same server?

2008-12-07 Thread Adi Sieker
" in this VirtualHost points to a pre newforms 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

Re: range-like template tag?

2008-12-08 Thread Adi Sieker
ange(self): 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 pos

Re: Problem saving a User object to a profile

2008-12-19 Thread Adi Sieker
ns the model instance. 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

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

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 > wrote: >> Are you sa

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: 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
not in a > javascript 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 --~--~-~--~~---

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

Re: DateField with Django

2009-03-18 Thread Adi Sieker
rtunately, 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 -

Re: Using

2009-03-18 Thread Adi Sieker
rk 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

Re: yet another unicode question...

2009-03-18 Thread Adi Sieker
ettings.py > and followed many things 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? Re

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
ect? > In the diff file there are some regression tests which show you how to use the Fields. adi > On 18 Mar, 13:45, Adi Sieker wrote: >> Hi, >> >> On 18.03.2009, at 13:01, MarcoS wrote: >> >> >> >>> Hi Adi, thanks for your reply! >

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 valu

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, > > [Sorry

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: Django and IIS 7

2009-03-26 Thread Adi Sieker
idea about IIS, but a quick 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 us

Re: Determining server identity from views.py?

2009-03-31 Thread Adi Sieker
gt; Thx for the info... > Do you 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 --~--~-~--~~~---~--~~ Y

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

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

2009-04-08 Thread Adi Sieker
rties. > formContent.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: Pre-filling form data without submission?

2009-04-08 Thread Adi Sieker
how the 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 error

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

2009-04-09 Thread Adi Sieker
d. >> >> 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: Positive integer form field with max lenght

2009-04-09 Thread Adi Sieker
.999. 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&qu

Re: How To Change App Label in Admin Pages

2009-04-09 Thread Adi Sieker
'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 are subscribed to the

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, qr

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 c

wrong redirect from admins "View on site" link

2008-10-24 Thread Adi Jörg Sieker
'day': self.pub_date.strftime('%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/ --~--~-~--~

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.

Re: datetime widget without admin

2008-10-25 Thread Adi Jörg Sieker
ed to get 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

Re: Triggering a custom signal

2008-10-27 Thread Adi Jörg Sieker
n't fire at certain times. So 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 --~--~-~--~~-

Re: Where to put signals?

2008-10-29 Thread Adi Jörg Sieker
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 sig

Re: Where to put signals?

2008-10-29 Thread Adi Jörg Sieker
that is imported before django 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: >

Re: changing the Manager the admin-site should use

2008-10-30 Thread Adi Jörg Sieker
e 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

Re: how to get the id in an admin template

2008-11-04 Thread Adi Jörg Sieker
, 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: Upload Form does not validate

2008-11-12 Thread Adi Jörg Sieker
e snipped] > 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.c

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: Django ORM and phpMyAdmin

2008-11-26 Thread Adi Jörg Sieker
then notify a django specific 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 no

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: Practical Django Projects - Problem with CMS Search

2008-07-25 Thread Adi J. Sieker
eyError 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: Is it possible to use Django + Postgresql on leopard?

2008-08-23 Thread Adi J. Sieker
ot;MacPorts" 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

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 unsubscribe

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 --~--~-~--~~~---~--~

Re: Can this be solved without hardcoded SQL?

2008-10-07 Thread Adi Jörg Sieker
gt; get it 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: 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 bec

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

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

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 fo

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: When to use admin, and when not to.

2009-05-26 Thread Sieker Adi Jörg
min 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: 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 > 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 creates an account

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.

Re: accessing model instance in ModelAdmin.get_urls

2009-05-26 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 > wrote: > > Hi, > > I'm implementing some new urls in my ModelAdmin.get_urls method and > I need access to the current models instance or id.

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 runni

Re: Problem with Postgres 8.2

2008-05-09 Thread Adi Jörg Sieker
d the data in your tables. you can drop all your apps ables and then run ./ manage.py syncdb again. adi On 09.05.2008, at 18:48, Marcin Gorczyński wrote: > > The manage.py sql app shows > > CREATE TABLE "groups_groupdata" ( >"id" serial NOT NULL PRIMARY KEY

Re: Problem regouping date list

2008-05-11 Thread Adi Jörg Sieker
ed_list %} year: {{ group.grouper }} {% for item in group.list %} {{ item.date }} {% endfor %} {% endfor %} hope that helps. adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance d

Re: Setting request-parameters per default

2008-05-12 Thread Adi Jörg Sieker
tion, but I > dont know how and where to realize it elegant. > If you are using trunk and using RequestContext you could do it in a context processor. http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext adi > Toni > > > > On 11 Ma

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

2008-05-12 Thread Adi Jörg Sieker
at does it all for you. See also the fine documentation at http://www.djangoproject.com/documentation/authentication/#the-login-required-decorator Regards adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsieker SAP-Consultantweb:htt

Re: Ignore query on views?

2008-05-12 Thread Adi Jörg Sieker
r) # btw get will raise an AssertionError if more than record is found. # i.e. if a user posted more than one post except Record.DoesNotExist: posts = None return RequestContext(foo,bar, {'posts' : posts}) and in your template: {%if posts %} display the po

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

2008-05-12 Thread Adi Jörg Sieker
On 12.05.2008, at 20:59, M.Ganesh wrote: > > Adi Jörg Sieker wrote: >> >> On 12.05.2008, at 15:13, M.Ganesh wrote: >> >>> Thanks Ronny for your response, however this doesn't answer my >>> requirement. Probably I've to state my requireme

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

2008-05-12 Thread Adi Jörg Sieker
Hi, On 12.05.2008, at 22:07, Adi Jörg Sieker wrote: > but the idea is the same. > > def login_view(request, next_url_from_page): this might need to be a default parameter like: def login_view(request, next_url_from_page=None): > if request.method == 'POST': >

Re: Ignore query on views?

2008-05-13 Thread Adi Jörg Sieker
) and user.post_set.count() will give you number of posts of the user. all this information is in the docs at: http://www.djangoproject.com/documentation/db-api/ specifically http://www.djangoproject.com/documentation/db-api/#related-objects and http://www.djangoproject.com/documentation/db-

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

2008-05-13 Thread Adi Jörg Sieker
On 13.05.2008, at 16:18, phillc wrote: > > "I am new to web programming" > "I am trying to use my own loginpage " > > is there a reason that contrib.auth doesnt meet your needs? > Good question. :) adi -- Adi J. Sieker mobile: +49 - 178 -

Re: Search Result Pagination

2008-05-14 Thread Adi Jörg Sieker
Hi, On 14.05.2008, at 00:47, Michael Ellis wrote: > results = paginator.page(pager) shouldn't this be results = paginator.page(pager).object_list see http://www.djangoproject.com/documentation/pagination/ adi -- Adi J. Sieker mobile: +49 - 178 -

Re: problem with DateQuerySet

2008-05-14 Thread Adi Jörg Sieker
dates('app_date','year') and it works like a charm adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype: adijsieker SAP-Consultantweb:http://www.sieker.info/profile

Re: Django with non-sql database

2008-05-14 Thread Adi Jörg Sieker
Hi, I'm new to django but from what I understand can use django without models, then you'd have to do the loading of the data from your text files yourself. If you want to use models then you have to use some kind of database, at minimum SQLite. but someone else may prove me w

Re: Python issues on mac. Python not working.

2008-05-14 Thread Adi Jörg Sieker
on.framework/ Versions/2.5/bin/pythonw /usr/bin/pythonw2.5 -> ../../System/Library/Frameworks/ Python.framework/Versions/2.5/bin/pythonw2.5 so a: cd /usr/bin ln -s ../../System/etc/etc/etc/pydoc pydoc reapeat for each of the files in the above list could fix your problem. adi > and when i

Re: Search Result Pagination

2008-05-14 Thread Adi Jörg Sieker
Hi, the query parameter page=1 probably won't be there when you submit the search form. I 'd guess your forms action parameter is either empty or set to the url of your search view. Have you tried 'results': results.object_list in your render_to_response? regards

  1   2   >