Re: Error :- Debuge= True

2015-07-04 Thread Bradford Wade
Happy to assist—a few notes/questions up-front: - It's much easier to troubleshoot if you provide the full stack-trace, as is. It helps answer questions like - Which URL were you requesting that ultimately gave you this 404? - Which URL patterns were "tried" or were regex-compar

Creating User object with is_active = False

2015-05-03 Thread bradford li
I posted the same question on stackoverflow if anyone wants to answer it there. I am trying to create a builtin User object that has `is_active = False` but I am getting this error: null value in column "is_active" violates not-null constraint Traceback: File "/Library/Python/2.7/site-

Django ReverseSingleRelatedObjectDescriptor.__set__ ValueError

2015-03-18 Thread Bradford Wade
I am creating a custom data migration to automatically create GenericRelation entries in the database, based on existing entries across two different models. *Example models.py:* ... class Place content_type = models.ForeignKey(ContentType) object_id = models.PositiveIn

SMTPAuthenticationError sending email via smtp.gmail

2015-02-09 Thread bradford li
I am trying to have django send emails but I am getting this error: Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/django/core/mail/__init__.py", line 62, in send_mail return mail.send() File "/Library/Python/2.7/site

Re: upload_to for ImageField changes name of file being uploaded

2015-02-02 Thread bradford li
There is bounty on this stackoverflow question is anyone is interested On Thursday, January 29, 2015 at 12:35:22 AM UTC-8, bradford li wrote: > > I posted a question on stackoverflow regarding my issue: > > > http://stackoverflow.com/questions/28205560/upload-to-value-changes-photo

upload_to for ImageField changes name of file being uploaded

2015-01-29 Thread bradford li
I posted a question on stackoverflow regarding my issue: http://stackoverflow.com/questions/28205560/upload-to-value-changes-photo-name-attribute Basically upload_to value will change my ImageField.name to the upload_to value -- You received this message because you are subscribed to the Googl

Putting picture thumbnails within admin page

2015-01-26 Thread bradford li
I am trying to put thumbnail pictures of my photos within my admin page. I am currently running into the issue where the thumbnail isn't displayed, when I click on thumbnail I am redirected to the homepage of my project with this as the URL: http://127.0.0.1:8000/media/tumblr_ngotb4IY8v1sfi

Display form content instead of object name

2015-01-03 Thread bradford li
I posted a question on stackoverflow regarding creating forms and displaying the content. Right now I am only displaying the object name and location. I am aiming to have it's content and widget displayed but being new to Django I am having trouble =/ I feel the problem resides in beatle field

displaying album title for appropriate image (ForiegnKey)

2014-05-11 Thread bradford li
I am trying to display the album titles related to my image in my admin interface class Album(models.Model): title = models.CharField(max_length = 60) def __unicode__(self): return self.title class Tag(models.Model): tag = models.CharField(max_length = 50) def __unicode__(self): return self.ta

admin layout for Gallery app

2014-05-11 Thread bradford li
I want to create me admin like this: http://lightbird.net/dbe/_static/p1.png What I have right now is: def get_upload_file_name(instance, filename): new_file_path_and_name = os.path.join(MEDIA_ROOT,'img/albums') return new_file_path_and_name class Album(models.Model): title = models.CharField(ma

Re: Gallery App in Django project

2014-05-09 Thread bradford li
I want to do so without using an app because I feel that way I can really learn Django. Currently this is what I have in my models.py from django.db import models from django.contrib import admin #from PIL import Images as PImage import os from PersonalWebsite.settings import MEDIA_ROOT #def get

Gallery App process

2014-05-08 Thread bradford li
I want to know how to display images separated by albums onto a page in Django. So far, I've learned how to do so with the line in my html file. What I want to do is have a few album thumbnails out and upon click, all the images from the album should be displayed. I believe I would do this

Gallery App in Django project

2014-05-08 Thread bradford li
I'm pretty new to Django and I thought, what better way to learn than to create your own website?! I posted a question on Stackoverflow. http://stackoverflow.com/questions/23534170/album-app-process-in-django I want to create a Gallery App that would display a list of albums. These albums woul

Re: Confused on Where to Put SQL

2006-08-24 Thread bradford
it's actually going to be thousands of sql queries for each user. would doing it all in one object lock out all of the users for the entire time the "magic" is being done (until it is updated)? [EMAIL PROTECTED] wrote: > Do you really need to perform hundreds of SQL queries? Wouldn't it be > a l

Confused on Where to Put SQL

2006-08-23 Thread bradford
It seems like I'm constantly using custom SQL statements, because the ORM won't offer what's necessary to achieve the desired data query/manipulation. Right now I need to wrap up the following in a transaction that will be called a few hundred times in a for loop. delete from table ... create te

Re: Understanding FKs vs JOIN

2006-07-08 Thread bradford
Thanks, Malcolm -- as always :) --~--~-~--~~~---~--~~ 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

Understanding FKs vs JOIN

2006-07-08 Thread bradford
I have a Model Foo, with a FK to user. if i do f = Foo.objects.get(id=1) and all i need from that is f.title and j.user.username in my template... is it returning more info than needed with User. I mean, is it getting the entire user object for each returned record? If it is returning the enti

Settings Model

2006-06-16 Thread bradford
I need a model called settings that has some application settings the user can edit in the admin. How should I set this model up so that one and only one settings record always exists for the lifetime of the application. Also, please let me know if this approach is incorrect. --~--~-~-

Will Complex URLs Slow Things Down?

2006-05-26 Thread bradford
I'm trying to match emails in my urls.py by doing the following (which was taken from core.validators: (?P[A-Z0-9._%-][+A-Z0-9._%-]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}) I have a few questions, though. 1. If the url pattern is too complex, will it slow anything down? 2. I'm assuming this matches the u

Restrictions: Triggers or Save

2006-05-23 Thread bradford
I have a blog with categories. Users who read the blog are allowed to add up to five unique posts to their favorites for each category. So Favorites - CategoryID - PostID - UserID How should I limit the number of favorites per user (per category), while enforcing favorite post uniqueness for e

Add a Button in Admin

2006-04-20 Thread bradford
I hope this makes sense: I have two models: Foo and Bar. Bar contains a FK to Foo. In the admin, when the admin looks at one of the Foo records, I want them to be able to clear all Bar records that contain a FK to the Foo record that's being used. How can I add a button to the Foo admin view

Dependent Fields in Admin

2006-03-30 Thread bradford
In my admin I am trying to create a new object, A. A has a FK to B, which has a FK to Category, as shown: A -> B-> Category. The problem is that when I create a new A object in my admin, it only shows a drop down for B, and there you can have multiple B titles, but just not for the same Categor

Highlighting Search Results

2006-03-26 Thread bradford
A question came up in #django and I was wondering what the best solution may be: how to highlight search results. Here are some possibilities: 1. Add in around the returned results for the searched words in the view. 2. Template filter 3. Template tags Please expand on any ideas. Thanks -