Re: creating project in Django

2014-08-10 Thread Kelly Nicholes
Django-admin has to be on your environments path. Find where your Django-admin.oh file is and do the whole path. python c:\...\Django-admin.python startproject myproject. Maybe you forgot to activate your virtualenv? Sorry about random capitalization. Typed on my phone. -- You received

Class that extends a model that is not a model

2014-03-05 Thread Kelly Nicholes
Just a guess, but have you tried putting it in a file not called models.py? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Fast and Easy way to check if an instance of an Model exists in the Database

2014-01-20 Thread Kelly Nicholes
Wait-- Why aren't you using exists()? Don't even check the pk. Model.query.exists() was made for this. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: app to record and play video

2014-01-13 Thread Kelly Nicholes
Django, as far as the front-end is concerned, has little to do with actually capturing the video. This is going to be on the frontend with your browser. Depending on your audience, they might not have browser web capture available and will have to use a browser plugin like flash or

Re: handling IntegrityError: Duplicate entry in UserCreationForm

2013-04-25 Thread Kelly Nicholes
If you ever want to know how the UserCreationForm works, the source is always available not only on your machine but also on https://github.com/django/django/blob/master/django/contrib/auth/models.py On Wednesday, April 24, 2013 9:27:39 AM UTC-6, sachin wrote: > > Hello, > > I m extending my

Re: Need good image on the fly resizing

2013-04-23 Thread Kelly Nicholes
For the problem with sorl-thumbnail not resizing to the same size as the others-- Are you cropping the image at all or just resizing? If you crop, I don't understand how the images wouldn't be all the same size. When I've used sorl, if the image is bigger than the dimensions to which I'm

Re: e commerce django framwork

2013-04-04 Thread Kelly Nicholes
I recommend you take a look at https://www.djangopackages.com/grids/g/ecommerce/. I've used satchmo a couple times. I recall setting it up having a couple snags, but nothing unmanageable. Overriding the templates isn't a big deal if you understand the TEMPLATE_URLS setting. I haven't

Re: Is there an easy way to popup forms?

2013-02-14 Thread Kelly Nicholes
I was looking for something like this for CBVs about a week ago! I'm glad this guy posted this question more clearly than mine to get this response. I might try this out! Thanks. This is a very common pattern, I've found, and wasn't sure why it wasn't included in django's core! On

Pattern for Ajax Forms using Django ModelForm and Class Based Views.

2013-02-08 Thread Kelly Nicholes
What's the best practice for this? In my function based views, I'd check if the form is_ajax() and if so, validate the form, render_to_string it to a form template, and return that in a json dump along with a status code. Then I check the status code to see if there are errors. If so, I

Re: No module named models again

2013-02-07 Thread Kelly Nicholes
Yeah, for things like forms.py and views.py, it's best to use relative imports for the models.py within the same app. from .models import Object1 On Wednesday, February 6, 2013 7:22:19 PM UTC-7, frocco wrote: > > I found the answer. > in my app directory called checkout, I also have a

Re: On the fly image resize

2013-02-03 Thread Kelly Nicholes
Check out sorl-thumbnail. https://github.com/sorl/sorl-thumbnail . This lets you specify the desired size in a template.and can deal with cropping. It caches the results so it doesn't have to regenerate it each time. On Saturday, February 2, 2013 1:33:36 PM UTC-7, nYmo wrote: > > Hi all, >

Re: Moving a Django website to another server

2013-01-31 Thread Kelly Nicholes
If you're storing your images in your database (don't) then your db migration should have done it. If you're storing the paths in the database, let's hope they're relative paths to the images. You'll have to copy the images to your new server using the same approaches listed above. One

Re: How do you extend a queryset object with another queryset as in list.extend(another_list)

2012-11-06 Thread Kelly Nicholes
You can always use itertools.chain() if you want to do it in memory. Instead of doing it in memory as you've suggested, perhaps you need to index the account's PK so when your Items object manager queries for them, it can be quick. import itertools list1 = [1,2,3,4] list2 =

Re: Iphone applications via django

2012-09-11 Thread Kelly Nicholes
If you go HTML/JS, a phonegap alternative for cross-device compatibility would be appcelerator. On Tuesday, September 11, 2012 2:59:12 AM UTC-6, Sait Maraşlıoğlu wrote: > > How do you create iphone applications via django. > Application logic will be django but what about user interface, do we

Re: Can't Syncdb

2012-09-08 Thread Kelly Nicholes
Did you add the app name in settings.py under the INSTALLED_APPS list? On Friday, September 7, 2012 10:23:31 PM UTC-6, Kollin wrote: > > I create a project. I create app by name "app" in the project. The app > that : > app > __init__.py > models > __init__.py > a.py >

Re: Choosing a JS framework to go together with Django

2012-09-05 Thread Kelly Nicholes
It would be a travesty to not mention backbone.js. On Tuesday, September 4, 2012 7:39:49 AM UTC-6, dotnetCarpenter wrote: > > Hi all. > > I'm new here and just took over a Django project for the first time. I'm > still getting to grip with Django but as a front end dev for the past 5 > years,

Re: Storing Sorl-thumbnail created images in separate folder

2012-04-29 Thread Kelly Nicholes
It always just caches the files for me in a completely different directory. On Saturday, April 28, 2012 1:06:12 PM UTC-6, Swaroop Shankar wrote: > > Hello All, > I am using sorl-thumbnail extensively in my project. It works perfectly > fine except for one issue which is regarding the storage.

Re: viewing generated SQL without running the query

2012-02-23 Thread Kelly Nicholes
Can't you get a queryset, like print MyObject.objects.all().query ? On Feb 21, 7:32 pm, diafygi wrote: > There's a previous thread about this[1], but it was closed back in > 2006 without resolution. So I'd like to check back in and see if there > is a way to get a complete

Re: Associating Form Data with Users

2012-02-21 Thread Kelly Nicholes
And by "API" do you mean "ORM?" On Feb 21, 10:45 pm, Kelly Nicholes <kelbolici...@gmail.com> wrote: > errr-- > > django.contrib.auth.models import User > > class YourModel(models.Model): >     user = models.ForeignKey(User) > > On Feb 21, 10:42

Re: Associating Form Data with Users

2012-02-21 Thread Kelly Nicholes
errr-- django.contrib.auth.models import User class YourModel(models.Model): user = models.ForeignKey(User) On Feb 21, 10:42 pm, Kelly Nicholes <kelbolici...@gmail.com> wrote: > Your YourModelForm is a modelform of a model.  If you're setting a > property of that model,

Re: Associating Form Data with Users

2012-02-21 Thread Kelly Nicholes
Your YourModelForm is a modelform of a model. If you're setting a property of that model, AND YOU WANT IT TO PERSIST IN THE DATABASE, you set the property equal to the request.user and save that object. If you don't have a foreignkeyfield to User, there's no way you're going to associate that

Re: Somebody please attend to me

2012-02-06 Thread Kelly Nicholes
This is link holds the PERFECT answer for you: http://bit.ly/wc0psc If you want to do it differently, try: First you'll have to send an XMLHttpRequest (jQuery post() or get()) to your server to post a form (create a modelform with a "Comment" model with all of the required fields. You might

Re: Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Kelly Nicholes
Isn't there a form.changed_data ? On Jan 9, 6:39 pm, Jeff wrote: > Hi all, > > I need to be able to determine, at .save() time (before I call the > parent class' .save()), if a certain field on my model object was > changed, and act on that via some custom code.  How can I do

Re: how to use "{% url *** %}" in django template file?

2011-08-11 Thread Kelly Nicholes
You need to set the name parameter. name="card_create_card". Once you do that, reference it in the {% url %}. On Aug 7, 6:34 pm, muhdazwa wrote: > You can add name to the url in the urlpatterns: > > urlpatterns = patterns('', >    url(r'card/create$',

Re: Django Improper Configuration

2011-01-24 Thread Kelly Nicholes
I think I had this error too when I was cloning a repo from WebFaction to use on my local dev machine. I ended up having to replace WebFaction's manage.py with the one from Django. Let me know if it works for you! I wish I could explain why. Can't. On Jan 23, 8:55 pm, Graham Dumpleton

Re: DJANGO BOOTCAMP

2011-01-01 Thread Kelly Nicholes
I've found many books that demonstrate how Django can be used. Django 1.0 Web Site Development Practical Django Projects, Second Edition and The Definitive Guide to Django: Web Development Done Right, Second Edition are all pretty nice. I'd recommend checking these out. On Dec 31 2010, 6:17 am,