Re: extend User Model for custom fields

2011-03-27 Thread Derek
On Mar 26, 12:53 pm, Antonio Sánchez wrote: > Yeah sure, i should have used "recommended" word instead of correct. > > The difference between link i wrote and b-list is that the last one > uses a foreign-key, while first uses one-to-one, and this is the way > is recommended in doc, so... I think i

Re: validate user input on templates

2011-03-27 Thread Sam Walters
hey use: str.isdigit() http://www.tutorialspoint.com/python/string_isdigit.htm what is idDigit() ? is that a call to a method somewhere else. and arent you trying to validate numberofapples = request.POST['numberofapples'] not playerid? Personally if this is form data you are trying to validate

validate user input on templates

2011-03-27 Thread django beginner
Hi django experts, just want to know your opinion on how to validate the user input (example: the user input field should be integer, but the user accidentally inputs any character), here is my code: FYI; the numberofapples field is IntegerField here is my sample code: def apples_edit(request):

Re: Seeking Django Counsel when adding a new model using South and a custom field for my ProtectedFileField subclass

2011-03-27 Thread Matteius
Ah most excellent, I certainly was missing something. Well this documentation was OK, but the having the schema migration auto- generate is priceless. I must have left my regex thinking mind elsewhere this morning ... blaming Nascar. Thanks for taking the time this solved my issue and the new mo

Re: TemplateDoesNotExist at /admin/ - admin/login.html

2011-03-27 Thread Jimmy
Thank you tracey, I already allow web server to read the files and it works. -- 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 djang

Re: Two way many-to-many relationships

2011-03-27 Thread Mike Ramirez
On Sunday, March 27, 2011 02:32:15 pm Dilan wrote: > Hi All, > > I'm working on a model similar to > http://docs.djangoproject.com/en/1.3/topics/db/models/#extra-fields-on-many > -to-many-relationships . > > Say, I need to add the field, groups = models.ManyToManyField(Group, > through='Membershi

Re: how to parse string in django

2011-03-27 Thread Mike Dewhirst
On 28/03/2011 1:38pm, django beginner wrote: hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 wherein I could compare the results - convert in integer: Further to my earlier reply ... >>> x = 3 >>> y = '%02d' % x >>> y '03' >>> if 14> 3 . .

Re: how to parse string in django

2011-03-27 Thread Mike Ramirez
On Sunday, March 27, 2011 07:38:46 pm django beginner wrote: > hi django experts, > > how do I strip the following string in python (Charfield format) > > 14:00 > 3:00 > > wherein I could compare the results - convert in integer: > > if 14 > 3 . . . > > thanks in advance! a = "14:00" b = "3:0

Re: how to parse string in django

2011-03-27 Thread Mike Dewhirst
On 28/03/2011 1:38pm, django beginner wrote: hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 Do you also keep am and pm? What about UTC offsets? You need a helper method to interpret the numbers, convert them to seconds, do the comparison and re

how to parse string in django

2011-03-27 Thread django beginner
hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 wherein I could compare the results - convert in integer: if 14 > 3 . . . thanks in advance! -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

how to parse string in django

2011-03-27 Thread django beginner
hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 wherein I could compare the results - convert in integer: if 14 > 3 . . . thanks in advance! -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

how to parse string in django

2011-03-27 Thread django beginner
hi django experts, how do I strip the following string in python (Charfield format) 14:00 3:00 wherein I could compare the results - convert in integer: if 14 > 3 . . . thanks in advance! -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

django-simple-friends template help

2011-03-27 Thread justin jools
need some help setting up templates for friends list: how do I iterate a list of invited friends and are friends? I have tried: {% for friends in Friendship.objects.are_friends %} target_user: {{ friends.target_user}} current_user:{{ friends.current_user}} are_frien

simple friends template help

2011-03-27 Thread justin jools
need some help setting up templates for friends list: how do I iterate a list of invited friends and are friends? I have tried: {% for friends in Friendship.objects.are_friends %} target_user: {{ friends.target_user}} current_user:{{ friends.current_user}} are_frien

Re: Updating to Django 1.3 - how to preserve file field previous behaviour

2011-03-27 Thread Russell Keith-Magee
On Sun, Mar 27, 2011 at 6:20 PM, -RAX- wrote: > Hi all, > > According to > http://docs.djangoproject.com/en/dev/releases/1.3/#filefield-no-longer-deletes-files > FileField fields no longer delete the related file when the instance > is deleted. > > I understand the motivations behind this decisio

Re: Read-only fields and complex relationships in admin

2011-03-27 Thread Micah Carrick
Thank you Jacob. That's actually the answer I was hoping for. On Fri, Mar 25, 2011 at 8:48 PM, Jacob Kaplan-Moss wrote: > On Fri, Mar 25, 2011 at 6:39 PM, Micah Carrick > wrote: > > I have an application which handles a typical "checkout" process for an > > e-commerce website. Orders from online

Two way many-to-many relationships

2011-03-27 Thread Dilan
Hi All, I'm working on a model similar to http://docs.djangoproject.com/en/1.3/topics/db/models/#extra-fields-on-many-to-many-relationships . Say, I need to add the field, groups = models.ManyToManyField(Group, through='Membership') to Person class Two questions: 1. In Django, is this allowed? 2

Re: Seeking Django Counsel when adding a new model using South and a custom field for my ProtectedFileField subclass

2011-03-27 Thread Ian Clelland
On Sun, Mar 27, 2011 at 1:47 PM, Matteius wrote: > add_introspection_rules([], ["^student_portal\.fields > \.ProtectedFileField"]) ... >  ! Cannot freeze field 'student_portal.assignment.provided_files' >  ! (this field has class > classcomm.student_portal.fields.ProtectedFileField) Without look

Seeking Django Counsel when adding a new model using South and a custom field for my ProtectedFileField subclass

2011-03-27 Thread Matteius
I've read the documentation at South and I would really like to take this opportunity to say this project would be way better with improved documentation or maybe I'm just missing something. I recently added a new model to my project which is using South, which means syndcb no longer simply adds th

Re: Initial Data SQL not sticking?

2011-03-27 Thread fdo
Hmm, I see your commit; Did you get a confirmation message from your database that the commit worked? Perhaps you could try inserting the data via a python script. import sqlite3 # create/connect to a permanent file database con = sqlite3.connect("pyfitness2.db") # establish the cursor, needed to

Re: url - hot to set properly?

2011-03-27 Thread galgal
I have APPEND_SLASH True but / is not added :) -- 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 django-users+unsubscr...@googlegrou

Twitter like graph with django model

2011-03-27 Thread Shamail Tayyab
Hi, Can you give me a hint on some model schema that can optimally store a big social graph (follow/following type). Tx -- 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 u

Re: Looking for development services

2011-03-27 Thread Aryeh Leib Taurog
On Mar 23, 6:22 pm, Aryeh Leib Taurog wrote: > My employer (not me) is looking for development services to build a > relatively small site/service with django. Let me explain what I mean by "relatively small." I think this could be a one or two month project for one individual. Someone with a l

Deploying Pinax to bluehost

2011-03-27 Thread Antik
I created a Pinax website on localhost and I have been trying to deploy it to my hosting server at bluehost.com, but I am really lost as to how this works. COuld anyone shed light on the process? Thanks! -- You received this message because you are subscribed to the Google Groups "Django users"

Re: subclassing User: can't log in, can't change password

2011-03-27 Thread Kees Hink
Thanks. The blog post made it look like this was the "old" way, but i value information from djangoprojects.org more. I'll go and create profiles, then. Kees On 03/27/2011 07:08 PM, Calvin Spealman wrote: > Do not subclass the User model. Create a profile model and register > that with the auth a

Re: subclassing User: can't log in, can't change password

2011-03-27 Thread Calvin Spealman
Do not subclass the User model. Create a profile model and register that with the auth app, which is how the authentication documentation tells you to go about this. http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users On Sun, Mar 27, 2011 at 10:54 AM, Kees

subclassing User: can't log in, can't change password

2011-03-27 Thread Kees Hink
I'm subclassing django.contrib.auth.models.User to create a custom user type (Student) with extra fields, following http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/. (Is there no documentation on djangoproject.org on how to do this?) Some relevant snippets o

Updating to Django 1.3 - how to preserve file field previous behaviour

2011-03-27 Thread -RAX-
Hi all, According to http://docs.djangoproject.com/en/dev/releases/1.3/#filefield-no-longer-deletes-files FileField fields no longer delete the related file when the instance is deleted. I understand the motivations behind this decision BUT this creates several side effects in various websites w

Paid 8 hour tutorial/mentoring/development gig

2011-03-27 Thread David Kovar
Good morning, I could really benefit from about eight hours of intense tutoring in Django in the fairly near future. I'll pay $600 for those eight hours of time ($75/hour), or a bit more if necessary. You need to be within three hours of Central Illinois - Chicago, St. Louis, Indianapolis. I'll

Re: Django 1.3 - Question about static files

2011-03-27 Thread Sultan Imanhodjaev
Just set the static *STATIC_URL* copy your static files into you application root e.g. *MY_APP/core and nothing like * * * r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': os.path.join(PROJECT_ROOT, 'static')} in *urls.py* **run server this should work, down below my you can s

Re: Newbie Problem with Django reverse()

2011-03-27 Thread Alendit
Hi, if only one url is bound to a controller there is no need for a name argument. When you are specifying a name for an expression and it have got the same name as the controller a conflict arise. Just drop the name argument and it should work. Alendit. On 27 Mrz., 09:54, Ajay wrote: > I am mi

Re: Integrity Error on chained FKs

2011-03-27 Thread shofty
Daniel, thanks for pointing that out, the amended code now does what it was supposed to do. makes perfect sense when you explained it. i already had the slug and user excluded, which is why it allowed me to add them but didn't validate them im guessing. chained fk's was down to the error message.

Re: url - hot to set properly?

2011-03-27 Thread Łukasz Rekucki
On 27 March 2011 14:51, Pascal Germroth wrote: > Hi, > >>    urlpatterns = patterns('', >>    url(r'^admin/', include(admin.site.urls)), >>    (r'^', include('apps.textcontent.urls')), >>    ) > >> when i pass: /admin/ all is ok, but when I pass /admin - >> apps.textcontent.urls are executed, but

Re: images in a template

2011-03-27 Thread Vladimir
I have found a solution but it's very strange! Remind I use Django 1.2.5, development web server, Windows 7. Project level (named galiontours) urls.py: import os from django.conf.urls.defaults import * from galiontours.galion import views from galion.views import index from galiontours import setti

Re: Integrity Error on chained FKs

2011-03-27 Thread Daniel Roseman
On Sunday, March 27, 2011 9:41:53 AM UTC+1, shofty wrote: > > this is the view code... > > u = get_object_or_404(UserProfile, user=request.user) > if request.method == "POST": > # submitted the add venue form > venue_form = VenueForm(request.POST) > venue_form.u

Re: url - hot to set properly?

2011-03-27 Thread Pascal Germroth
Hi, urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), (r'^', include('apps.textcontent.urls')), ) when i pass: /admin/ all is ok, but when I pass /admin - apps.textcontent.urls are executed, but why? Well because the URL pattern is a regular expression th

Re: Integrity Error on chained FKs

2011-03-27 Thread shofty
been playing with this some more and i still can't work out what ive done to cause this issue. as i see it, when saving a Venue, the Survey model which is FK'd to the Venue is complaining that the user_id isn't set. However there is nothing being saved by the Survey model, so why is it even getti

url - hot to set properly?

2011-03-27 Thread galgal
I need to make some settings in urls. I want admin site enabled and 1 view method to catch rest of the request parts. So if someone's url is :/admin - ADMIN panel is show, also if someone pass: /admin/ (/ <- is important) If someone pass: /, /contact, gallery,. my custom method is activated.

Newbie Problem with Django reverse()

2011-03-27 Thread Ajay
I am missing something really basic here. I am trying to reuse django's change password views. I have following in urls.py: (r'^change-password/$', 'profile.views.change_password', {},'change_password'), url(r'^change-password-done/$', 'profile.views.password_change_done', name='django.contrib.au

Re: Integrity Error on chained FKs

2011-03-27 Thread shofty
this is the view code... u = get_object_or_404(UserProfile, user=request.user) if request.method == "POST": # submitted the add venue form venue_form = VenueForm(request.POST) venue_form.user = u venue_form.slug = slugify(request.POST['name']) if ven