Re: using django templates to generate and replace a file

2012-02-29 Thread Kurtis Mullins
Hey, I just thought I'd give you a quick reply. First, you can save the rendered output of a template using this: https://docs.djangoproject.com/en/1.3/ref/templates/api/#rendering-a-context Then, take that String and write over that 'users.cfg' file. For example, http://docs.python.org/tutoria

Re: Uploading Large Files via Ajax

2012-03-10 Thread Kurtis Mullins
Hey, I don't have a good answer for your exact question. One alternative, though, may be to use nginx, or another httpd, to handle the upload and just have it pass the path along to Django. e.g. http://www.grid.net.ru/nginx/upload.en.html Good luck! On Sat, Mar 10, 2012 at 11:18 AM, Fedel Bari w

Re: Django application performance estimates?

2012-03-15 Thread Kurtis Mullins
Sorry for the late chime-in. Here's the "budget scalability" route we at http://www.fireflie.com are taking for our rewrite in Django. We decided to go with AWS. Initial hosting costs are free for the server until we are ready to push to production and need a larger instance. We are using Nginx fo

Re: Django application performance estimates?

2012-03-15 Thread Kurtis Mullins
; infinite and beyond. I meant "paying $1,000 for a *scalable* web application, and therefore expecting a large amount of traffic...". Sorry about that. On Thu, Mar 15, 2012 at 9:55 PM, Kurtis Mullins wrote: > Sorry for the late chime-in. Here's the "budget scalability"

Re: intriguing django session save behavior

2012-03-19 Thread Kurtis Mullins
What are you using for your session engine? Maybe try another one? ( https://docs.djangoproject.com/en/1.3/topics/http/sessions/#configuring-the-session-engine ) On Sun, Mar 18, 2012 at 9:51 AM, pyramid...@gmail.com wrote: > If i clear my cookies and run this view, i get a new session key each >

Re: Combining two model fields into one

2012-03-19 Thread Kurtis Mullins
Personally, I would just create a custom Form for that validation logic then store the number in some generic Model Field (like IntegerField). You can write a method in your model to format that integer as a telephone number for display purposes using __string__ or other similar methods. Just conve

Re: Combining two model fields into one

2012-03-19 Thread Kurtis Mullins
field, though. They do include telephone numbers. Judging by the django developer's choice to put that logic in Form Fields instead of Model Fields, it may be a good idea (or at least easier) to follow their lead on doing it that way. On Mon, Mar 19, 2012 at 9:49 AM, Kurtis Mullins

Re: New way to run your Django projects

2012-03-19 Thread Kurtis Mullins
> > I'm not sure what you meant by "simply using nginx" since as far as I > know it doesn't have standard WSGI module. I use Nginx w/ WSGI (Django running under uWSGI, communicating w/ WSGI Protocol) out of the box. No special modules or anything were installed -- just a quick download and compil

Re: Send SMTP Email Through GoDaddy

2012-03-19 Thread Kurtis Mullins
People will probably need more information to help you. For example, what are the errors you are seeing? On Mon, Mar 19, 2012 at 9:44 AM, Enrique Juan de Dios wrote: > Hello Everyone. > I tried to send email with the email settings shown below, but doesn't > work. > > EMAIL_HOST = 'smtpout.secure

Re: New way to run your Django projects

2012-03-19 Thread Kurtis Mullins
I wouldn't call it "out of the box" > either if I'd have to rebuild Nginx instead of using one shipped with > my Linux distro (Debian Squeeze has Nginx with uwsgi module in > backports and uWSGI is only available in unstable branch). > > I didn't say gevent-

Re: Question about threading a view

2012-03-19 Thread Kurtis Mullins
Check out django-celery. On Mon, Mar 19, 2012 at 1:52 PM, Felipe Arruda < felipe.arruda.pon...@gmail.com> wrote: > Hi, I'll try to explain the best I can my problem, and I don't know if > what I'm trying to archive is the best way to get where I want, but > here is it: > I want that a specific vi

Re: Question about threading a view[REPOSTED]

2012-03-19 Thread Kurtis Mullins
Did you check out django-celery yet? On Mon, Mar 19, 2012 at 2:18 PM, Arruda wrote: > *(I've created a topic like this a few minutes ago, but was using the old > google groups, and now it's broken. So I created a new one using the new > google groups).* > Hi, I'll try to explain the best I can my

Re: ModelForms

2012-03-23 Thread Kurtis Mullins
If you're worried about stylizing specific fields, it'll be setup as a table, ul, or paragraph based upon how you "render the form" (paragraph by default I think). The individual fields are named with the following convention (if I recall correctly) . So for a field named "password" in a paragraph

Re: Django Book

2012-04-12 Thread Kurtis Mullins
I keep a checked out copy of the Django source code and just refer to the source code, docs, google, the mailing list and IRC for reference, I tried the book when I first started but it lacked the Class Based Views which I prefer to use when possible. Good luck! On Thu, Apr 12, 2012 at 8:49 AM, R

Re: Django questions.

2012-04-25 Thread Kurtis Mullins
Man, I think if you don't know the answers to these questions -- you may not want to apply for that job. Go research and play with NoSQL. Read the documentation on Template Tags -- and realistically, the point of the Templating engine in general. If you don't know about the Data Layer then read the

Re: Django CRUD questions

2012-04-25 Thread Kurtis Mullins
Check out ModelForms: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#django.forms.ModelForm Note: I'm not sure which version of Django you are using but you may want to choose a different document-version respectively. Also, check out CreateView, UpdateView, and DeleteView for your

Re: [JOB] Urgent - PHP/Python Developer needed

2012-05-01 Thread Kurtis Mullins
Congrats on finding people to fill your position(s), Cal! At first I read that and thought "man, that's almost insulting". I can honestly say that it's not completely unfair to pay someone $20/hour -- especially if they're still in school. I barely make more than that as a lead-developer for a sta

Re: Django - Worldwide Developer Rates - Hourly Income - location and project duration specific

2012-05-01 Thread Kurtis Mullins
Raphael, According to another topic -- some developers are being paid roughly $20/hour. It's under a post by Cal Lemmings where he is trying to hire some entry level developer(s). You might be able to use that information as well. I just thought I'd let you know. On Mon, Apr 30, 2012 at 4:24 PM,

Re: serving client uploaded files

2012-05-01 Thread Kurtis Mullins
You could use a pseudo-random filename so that it's very unlikely people will be able to easily find other's photos. If you're very concerned with users being authenticated before viewing the media (which to me, sounds like there won't be a huge load on that segment of your web application) then y

Re: The template tag {% load tz %}

2012-05-01 Thread Kurtis Mullins
http://stackoverflow.com/questions/550632/favorite-django-tips-features -- Fourth Answer Down from the Top: from django import template template.add_to_builtins('project.app.templatetags.custom_tag_module') On Mon, Apr 30, 2012 at 9:40 PM, CLIFFORD ILKAY wrote: > On 04/30/2012 09:21 PM, Rajat

Re: [help] Server Config: django + uwsgi + nginx

2012-05-01 Thread Kurtis Mullins
Judging from your Import Error -- I think you're having a problem with Django not being on the Python path. In my uwsgi configuration file (I used .xml), it looks like this: DJANGO_SETTINGS_MODULE=fireflie.settings 4 0.0.0.0:7999 /home/fireflie/staging/fireflie/ django.co

Re: Paramiko EOFErrors start to occur after a while

2012-05-01 Thread Kurtis Mullins
I messed with the SFTP implementatoin a while back. I noticed it was pretty tough and, if I'm not mistaken, a bit out-dated. We ended up moving to Amazon S3 so it wasn't a big deal. Anyways, maybe you could try using another file system? SSH isn't really an ideal solution for this sort of a proble

Re: [help] Server Config: django + uwsgi + nginx

2012-05-03 Thread Kurtis Mullins
Hey, I'm glad to hear you got it working! If you run into any more problems, don't hesitate to ask. On Wed, May 2, 2012 at 1:31 AM, easypie wrote: > Thanks. I was missing the virtualenv= mentions earlier. I'm glad I > know this those settings are meant for development only. I was a little > conf

Re: Access specific ModelForm field option within array of ModelForms for use with .js

2012-05-03 Thread Kurtis Mullins
You could do something along these lines: {% for field in form %} ... {% ifequal field form.someSpecificField %} > {{ form }} > > {% endfor %} > > Previously I have accessed certain ModelForms using {% if forloop.counter > == # %} to add some customization. > > However, now I would like more de

Re: jquery form post without refresh the page

2012-05-03 Thread Kurtis Mullins
quot;, it won't work. }); // On Error: jqxhr.error(function() { // Do something in here in the case of errors. }); }); Good luck! -Kurtis Mullins On Thu, May 3, 2012 at 1:46 PM, Bill Freeman wrote: > AJAX > > You may require a separate view, but maybe not. > > If you

Re: Need help

2012-05-03 Thread Kurtis Mullins
Your Database may very well be setup to Authenticate the Accessing User on 127.0.0.1 and not 'localhost' (or vice-versa). This would be setup in the database when setting credentials for a user, in the case with MySQL. On Wed, May 2, 2012 at 9:52 PM, Peter of the Norse < rahmcoff+...@radio1190.org

Re: Django - Worldwide Developer Rates - Hourly Income - location and project duration specific

2012-05-03 Thread Kurtis Mullins
t many people don't factor in project >> management and sales/phone calls into the hourly rate - they simply absorb >> the costs - which further drives it down. >> >> Cut a long story short though, I personally think that around £1700/month >> after tax is the '

Re: Short I hope explanation

2012-05-03 Thread Kurtis Mullins
When I first dove into Django, everything was confusing. I can't say I ever used the book because I wanted to use class-based-views immediately (was recommended in IRC). They were confusing as could be, I constantly needed hand-holding, etc... Eventually, I started to understand things a bit more,

Re: users and groups management without admin site??

2012-05-03 Thread Kurtis Mullins
It might help to get a little bit more information. Do you want to programmatically manage them to use in another application (or though the command-line), do you want a web-based interface, etc...? On Thu, May 3, 2012 at 3:34 PM, William Ibarra Rodriguez < legolas...@gmail.com> wrote: > i've wor

Re: users and groups management without admin site??

2012-05-03 Thread Kurtis Mullins
Awesome. Well, I'm not sure how familiar you are with Django but I'd just create views for the different functionality (for example, creating a new user). There's nothing the admin does that you can't do yourself. If you run into a specific problem, feel free to ask! On Thu, May 3, 2012 at 4:10 PM

Re: 404 errors reported as 500 errors

2012-05-03 Thread Kurtis Mullins
Are those symlinks? It might be worth seeing if that's part of the problem (although doubtful that it would be). If that's not the problem, does Django-CMS have its own specialized 404 handling? I've never used it but it's a couple of ideas to try out. On Thu, May 3, 2012 at 10:03 AM, James Hargre

Re: help with "Key 'timeout' not found in "

2012-05-03 Thread Kurtis Mullins
Can we see what your "Reservation" model looks like? Specifically, that 'timeout' field? On Thu, May 3, 2012 at 6:22 PM, psychok7 wrote: > hi i have done a succefull query and i converted the results into links so > i can make a post by clicking on the links to make a reservation. > > my problem

RE: help with "Key 'timeout' not found in "

2012-05-03 Thread Kurtis Mullins
(”The timeout variable wasn’t posted.”) This time, you should see exactly where that error is popping up. Also, ModelForm + CreateView would be a great an easy combination for this exact situation. Good luck! -Kurtis Mullins *From:* psychok7 *Sent:* Thursday, May 03, 2012 4:47:56 PM *To:* django-

Re: Why does django use mysqldb over mysql-connector?

2012-05-03 Thread Kurtis Mullins
I think what he was trying to get at is that the Python MySQL Adapter is in early stages of development where-as Django is depended upon to be a very stable platform/framework. It would be great to have the option to use that adapter though for situations like yours. On Fri, May 4, 2012 at 1:21 AM

Re: help with "Key 'timeout' not found in "

2012-05-04 Thread Kurtis Mullins
Jani is right, I didn't take a close look at that HTML. Using this (without any Javascript), you're not submitting a form with method="post" so you won't actually have any of that request.POST data available that you're looking for. On Fri, May 4, 2012 at 3:58 AM, Jani Tiainen wrote: > > 4.5.201

Re: UpdateView issue

2012-05-04 Thread Kurtis Mullins
In your form (template), are you trying to modify the is_active? I don't see anything that pops out at me that's missing. If you want to explicitly set this, you could do someting like this: class UserForm(ModelForm): # def save(self): m = super(UserForm, self).save(commit =

Re: UpdateView issue

2012-05-05 Thread Kurtis Mullins
hmm, are you supplying the user's pk to the UpdateView? On Fri, May 4, 2012 at 11:24 PM, William Ibarra Rodriguez < legolas...@gmail.com> wrote: > i made it but isn't solved, maybe i need to override another function > in the class UpdateUserView? > > -- > You received this message because you ar

Re: Paramiko EOFErrors start to occur after a while

2012-05-08 Thread Kurtis Mullins
Hey, I'd take a look at these options if you want to stick with Django-Storages ( http://django-storages.readthedocs.org/en/latest/index.html listed on the top of the page). Otherwise, I wonder if you could use the hadoop fileystem or some other, similar distributed file system built for high pe

Re: how to get text of a ChoiceField populated with ajax

2012-05-08 Thread Kurtis Mullins
cleaned_data should return the value of the field, not the index. Did you create your own clean__fieldname method? On Tue, May 8, 2012 at 11:35 AM, francescortiz wrote: > You have to make sure that the javascript code that populates the second > select box sets the value properly, or create a cus

Re: how to get text of a ChoiceField populated with ajax

2012-05-09 Thread Kurtis Mullins
Hey, It would help a lot to see your code posted to dpaste.com or somewhere. As far as grabbing the choices in your clean method, here's a little copy-and-paste from Django's own ChoiceField so you can see how they do it: class ChoiceField(Field): > > widget = Select > > default_error_mes

Re: Django AJAX forms and views

2012-05-15 Thread Kurtis Mullins
I'll try to help out a bit. The first problem I see is in your Javascript. I believe your JQuery selector is supposed to be the field's ID -- so, for example, $("#csrfmiddlewaretoken"). Next, in your view -- I don't see where you're actually returning any data. You should use Firebug or the Chrome

Re: Can I override get_object() of a generic view?

2012-05-15 Thread Kurtis Mullins
Hey, I'm not really sure what you're trying to do here. You're using a CreateView (which is built for creating new objects) and overriding the get_object(self, queryset=None) method (found in SingleObjectMixin -- https://github.com/django/django/blob/master/django/views/generic/detail.py) to, I'm

Re: Is this a bug in the documentation? ModelForm 'fields' attributes throwing error without trailing comma in the Tuple

2012-05-16 Thread Kurtis Mullins
Irfan, I had a feeling it was something along those lines -- although I couldn't find a source for that information. It's definitely not a bug in the Django Documentation -- although it may be a helpful mention :) Then again, I guess a better Python foundation before jumping into Django wouldn't h

Re: Use Django to implement my GUI!

2012-05-18 Thread Kurtis Mullins
If you're dead set on using a non-browser GUI for the administration application, just use the HTTP Protocol for your communications between the Django Server and whatever Desktop Application you build. However, if you can just use a web browser for that (even if it's a Qt browser or something that

Re: Use Django to implement my GUI!

2012-05-18 Thread Kurtis Mullins
> > My questions are: > - Can I override the djando admin methods so that i can not only > customized my views and html page, but also manipulate objects in > database, so that i can do another action when catching an event in > the GUi. Anything that can be done with Django's Admin interface ca

Re: Template: Foreign Key

2012-05-18 Thread Kurtis Mullins
Try something along these lines (Note: I'm switching up your variable names a bit to make it easier to read) {% for house in houses %} {{ house.name }} {% for person in house.people.all %} {{ person.name }} {% endfor %} {% endfor %} I just wrote that code block pretty quickly

Re: Template: Foreign Key

2012-05-18 Thread Kurtis Mullins
Whoops -- that might need to be 'house.people_set.all'. Sorry. On Fri, May 18, 2012 at 10:50 PM, Kurtis Mullins wrote: > Try something along these lines (Note: I'm switching up your variable > names a bit to make it easier to read) > > {% for house in ho

Re: After python upgrade, User.objects.get(username= doesn't work consistently

2012-05-22 Thread Kurtis Mullins
Hey, Sorry I'm a bit confused so I'm going to try to make some sense of your situation "out loud" :) 1. User.objects.get(username="some_username") works some-times 2. When it doesn't work, then you get the DoesNotExist exception, right? 3. If not, what error(s) do you see? 4. Are you sure the use

Re: Django site updater

2012-05-22 Thread Kurtis Mullins
We use a versioning system (Subversion to be precise, git or mercurial would probably be better for you). Then I commit everything to the main repository and just checkout (update after the initial checkout) on the development server. It's not too bad of a system although I still have to go onto th

Re: Static files management

2012-05-22 Thread Kurtis Mullins
Can you give us some more detail on what's not working? Thanks. On Tue, May 22, 2012 at 9:34 AM, Xavier Ordoquy wrote: > Hi, > > If you follow what the doc says, there shouldn't be any issue > (https://docs.djangoproject.com/en/1.4/howto/static-files/#basic-usage) > > Regards, > Xavier Ordoquy,

Re: After python upgrade, User.objects.get(username= doesn't work consistently

2012-05-23 Thread Kurtis Mullins
Wow, nice find! I would've never thought an index would cause that sort of a problem. I'm glad you figured it out and thanks for sharing that crazy find! On Wed, May 23, 2012 at 4:23 AM, Hanne Moa wrote: > On 23 May 2012 00:30, akaariai wrote: >> On May 22, 11:49 pm, Hanne Moa wrote: >>> I upgr

Re: how to get text of a ChoiceField populated with ajax

2012-05-23 Thread Kurtis Mullins
Hey, no problem! My apologies for missing out on this thread for a while. I hope you got it figured out! Anyways, I'm thinking that if you're actually basing this validation (done in your clean method), you may want to use a ForeignKey Field. You can define a custom queryset to filter through the

Re: how to get text of a ChoiceField populated with ajax

2012-05-23 Thread Kurtis Mullins
Sorry, somehow I completely overlooked the post where it says you've solved the problem. Happy hacking! On Wed, May 23, 2012 at 10:52 AM, Kurtis Mullins wrote: > Hey, no problem! My apologies for missing out on this thread for a > while. I hope you got it figured out! > > Anyw

Re: Need Help with ForeignKeys

2012-05-23 Thread Kurtis Mullins
The related name, basically, specifies a way to back-reference that particular Team. If you don't specify it, it just uses an automatically generated variable name (for example, just 'team'). You'd have a conflict because there'd be two 'team' variables generated in your game class. The method Simo

Re: JQuery .get new url is not updating the page

2012-05-23 Thread Kurtis Mullins
I'm not sure of the use-case on this but you could possibly take the following approach: 1. Get your dynamic page via AJAX with some given query 2. Modify the URL to match the query 3. When a user accesses the same page with the given query (my/page/?foo=bar) then they'll see the same thing Of co

Re: Question object permission approach

2012-05-23 Thread Kurtis Mullins
Hey, I think it really depends on how much complexity you want. We use a package called userena which depends upon Guardian. All that I know about Guardian is it's no fun when schema migrations get messed up :) In all honestly, though, I should have probably read more about it before using an appl

Re: Taggit fragmentation

2012-05-29 Thread Kurtis Mullins
Open Letters scare me ... They remind me of the pseudo-beginning of mainstream, non-free software :) I'd say just do like Russ mentioned. Try to pull everything together in one repository. Then when it's mature and you still want to take over the project, contact the original author and see if he/

Re: Question object permission approach

2012-05-29 Thread Kurtis Mullins
Hey, I'm glad you got it all running! I just wanted to specify some of my exact code in case anybody references this in the future. It's a bit off from where I was. In my UpdateViews and DetailViews, I do something along the lines of this: # Limit Editing Access to User's Own Objects. def

Re: Inverting URL security diligence - suggestions?

2012-05-29 Thread Kurtis Mullins
If you tend to use the standard Class Based Views, you could always add a mixin for that functionality. Or just start subclassing to make it even easier to read (e.g. AuthenticatedUpdateView, AuthenticateCreateView, etc...) On Tue, May 29, 2012 at 7:50 PM, Mike Dewhirst wrote: > On 30/05/2012 4:2

Re: Django ModelForm user best practices

2012-05-30 Thread Kurtis Mullins
I tend to put as much functionality in my forms as possible. I've asked a similar question before (many months ago) and I believe that was the consensus. One advantage is you can re-use your forms (and its save functionality) for your Create and Update views. On Wed, May 30, 2012 at 3:45 PM, RM w

Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Kurtis Mullins
Unless a player can play for multiple teams (which I'm doubting since Team is a ForeignKey for a Player), why not remove that 'captain' attribute from your Team and put it into your Player model as a boolean field? You could create a ModelManager or class-level model method to grab the associated t

Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Kurtis Mullins
orm you're using (outside of Admin) On Wed, May 30, 2012 at 4:02 PM, Kurtis Mullins wrote: > Unless a player can play for multiple teams (which I'm doubting since > Team is a ForeignKey for a Player), why not remove that 'captain' > attribute from your Team and put i

Re: Django ModelForm user best practices

2012-05-30 Thread Kurtis Mullins
> On second method some experience users can > override hidden data For the second method, you'd just use -- class Meta: fields = ('board', 'post', 'name') to prohbit anyone from trying to override the 'user', if that's what you're talking about. > And it's a bad idea to > override __init__ and s

Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Kurtis Mullins
player in the same team is a captain before allowing it to pass. Different context, but hopefully this approach can help. On Wed, May 30, 2012 at 4:05 PM, Kurtis Mullins wrote: > Sorry, I completely mis-read the last part of your problem. You > already thought about the same solution,

Re: Python IDLE

2012-05-30 Thread Kurtis Mullins
Back to the original question, Did you try running "python manage.py runserver" from the command prompt? As far as changing those icons back to Python, I believe you have to change your 'Default Program'. I'm not sure which version of Widnows you're using (or even how to do it in Windows, I'm runn

Re: App inside another app or nesting in django apps

2012-05-31 Thread Kurtis Mullins
Sure. They're just Python modules. All you need to do is: 1. Include the files: __init__.py and models.py 2. Add the application to your settings.py, for example: myproject.myapp.subapp It *should* work, although I haven't personally tested it yet. On Thu, May 31, 2012 at 7:46 AM, vijay shanker

Re: Adding values to formdata of ModelForm before saving

2012-05-31 Thread Kurtis Mullins
Hey, I tried re-writing your view and form for you -- but I ran into a snag. I don't read German so other than code-wise (and a couple of obvious words, like kalender and participants) I'm not really sure what you're trying to accomplish. I do see one obvious issue, though. Participants is a many

Re: Adding values to formdata of ModelForm before saving

2012-05-31 Thread Kurtis Mullins
One minor edit to that: form.save(request) -> form.save(request, kalender) On Thu, May 31, 2012 at 8:47 PM, Kurtis Mullins wrote: > Hey, > > I tried re-writing your view and form for you -- but I ran into a snag. I > don't read German so other than code-wise (and a cou

Re: Make ManyToMany field editable in a ModelForm

2012-06-01 Thread Kurtis Mullins
The Form just validates that the object you choose is a valid choice for that M2M field. If you wanted to created a new one on the fly, you'd probably want to use another Form and maybe go the Javascript way. You could *possibly* get by, in the same form, with doing something like this: class MyF

Re: A question about Model.full_clean

2012-06-01 Thread Kurtis Mullins
>From the docs: https://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#django.db.models.Model.full_clean from django.core.exceptions import ValidationError, NON_FIELD_ERRORStry: article.full_clean()except ValidationError as e: non_field_errors = e.message_dict[NON_FIELD_E

Re: Libraries for generating URL of uploading files in Django

2012-06-01 Thread Kurtis Mullins
Check out django-storages (if you use off-site hosting like S3, Rackspace Files, etc...). Then, just request the ImageField or FileField's .url() method. I think this may be the case for the bulit-in ImageField and FileField as well (actually, I'm pretty sure it is) but I haven't used it in so lon

Re: Scaling django installation

2012-06-01 Thread Kurtis Mullins
Check out django-cache-machine. It uses memcache to cache your ORM qureies and updates (invalidates) that cache when they change. On Fri, Jun 1, 2012 at 10:35 AM, Tim Chase wrote: > On 06/01/12 09:17, Subhranath Chunder wrote: > > On Fri, Jun 1, 2012 at 6:57 PM, Tim Chase < > django.us...@tim.the

Re: Scaling django installation

2012-06-01 Thread Kurtis Mullins
To me, the biggest bottleneck in a "Django Application Installation" (not application) is not going to be Django at all. It's going to be I/O -- typically to the database and/or file system. These are used heavily (from my personal experience) by all sorts of django functions. As for the database -

Re: A question about Model.full_clean

2012-06-01 Thread Kurtis Mullins
What version of Django are you using? On Fri, Jun 1, 2012 at 10:47 AM, David Markey wrote: > That is my exact class for that model. > > > On 1 June 2012 15:27, Kurtis Mullins wrote: > >> From the docs: >> https://docs.djangoproject.com/en/dev/ref/mod

Re: A question about Model.full_clean

2012-06-01 Thread Kurtis Mullins
ields()) methods. I'm going to look into the source of the Model module and see what's going on On Fri, Jun 1, 2012 at 10:55 AM, David Markey wrote: > 1.4 > > On 1 June 2012 15:54, Kurtis Mullins wrote: > >> What version of Django are you using? >> >> >

Re: A question about Model.full_clean

2012-06-01 Thread Kurtis Mullins
, Jun 1, 2012 at 11:08 AM, Kurtis Mullins wrote: > Yeah, I'm getting exactly the same results. It seems that it's not > throwing the IntegrityError until you try to save it. I suppose that's > because it's marked as 'not null' in the database. It appears to be &g

Re: How to perform a simple search ignoring characters with accents (á, é, í, ó, ú)

2012-06-01 Thread Kurtis Mullins
Maybe you could just build a simple index? It'd basically be a set of keywords, each with a set of matching books. So in your example, you'd have two keywords: hola (with accent) -> book1, book2, etc.. hola (without accent) -> (same as previous) And then just write some sort of functionality to r

Re: How to upload Django/Python to FTP

2012-06-01 Thread Kurtis Mullins
Hey, Welcome to Django! While you could, possibly, manage to upload your project and get it running -- it would be well worth the effort to learn the basics of using a Linux command-line. You don't have to edit your files in the command line but it'll make things a lot easier when trying to deplo

Re: How to upload Django/Python to FTP

2012-06-01 Thread Kurtis Mullins
immediate help. You can catch me on Skype from Monday-Friday 10am-5pm EST if you or your web developer have any small/quick questions. I don't mind helping out as long as it doesn't pull me away from my job for too long. My username is kurtis.mullins. On 6/1/12, Kurtis Mullins wr

Re: list indices must be integers, not str

2012-06-01 Thread Kurtis Mullins
If the error is "list indices must be integers, not str" then I imagine you are trying to access a list using a String rather than Integers :) We'd have to see your View and probably the related model you're using the "key_uniquekey" value on to help you out a bit more. On 6/1/12, Nikolas Stevens

Re: Obtaining objects from a many-to-many relationship

2012-06-02 Thread Kurtis Mullins
Have you tried b.haveone.all()? On Sat, Jun 2, 2012 at 12:36 AM, Thomas Lockhart wrote: > I've got two models with one having a many-to-many relationship with the > other: > > class A(models.Model): > name = models.CharField("name") > > class B(models.Model): > haveone = models.ManyToManyField(

Re: Obtaining objects from a many-to-many relationship

2012-06-02 Thread Kurtis Mullins
https://docs.djangoproject.com/en/dev/topics/db/queries/#many-to-many-relationshipsfor more information. (Unless I read your question wrong :)) On Sat, Jun 2, 2012 at 4:15 AM, Kurtis Mullins wrote: > Have you tried b.haveone.all()? > > > On Sat, Jun 2, 2012 at 12:36 AM, Thomas Lockh

Re: syncdb does not find model, but it does in the shell

2012-06-06 Thread Kurtis Mullins
I'm pretty sure you can't have a folder named models and that your models file needs to be called models.py -- unless you use some sort of a 'hack' to work around it. I remember seeing a bug posted about this issue which was pretty easily google-able. I just don't remember the bug number off hand,

Re: syncdb does not find model, but it does in the shell

2012-06-06 Thread Kurtis Mullins
+1 -- Nice find! On Wed, Jun 6, 2012 at 10:47 AM, jmolmo wrote: > I think that you have to indicate app_label in your separate model > file > According to: > https://docs.djangoproject.com/en/1.4/ref/models/options/ > > -- You received this message because you are subscribed to the Google Grou

Re: Accessing Backend DB for UI

2012-06-06 Thread Kurtis Mullins
On 05/06/2012 18:04, Ali Shaikh wrote: > Hey.. > > I am working for project, in that the back-end code is return in perl > and am working for front-end part i.e UI using Django, > Can any one can tell me how to access back-end database which is > return in perl or any othere languages .??

Re: limit number of related instance for m2m field in django-admin

2012-06-07 Thread Kurtis Mullins
You could customize the Admin Book Creation Form's save() method to check for X number of books an author already has. Note: I have very limited experience customizing the Admin application and have only used this method through a normal Form. On Thu, Jun 7, 2012 at 7:56 AM, vijay shanker wrote:

Re: DRY violation using get_or_create with defaults

2012-06-11 Thread Kurtis Mullins
hmm, have you considered creating a custom Model Manager with a custom method for this purpose? I don't really have any ideas at the moment, sorry! On Mon, Jun 11, 2012 at 9:44 AM, ojno wrote: > Hi all, > > In my app, which involves doing background tasks and possibly rerunning > them a number o

Re: 1.2 ModelForm.is_valid() backward incompatible change

2012-06-12 Thread Kurtis Mullins
I'm not sure if I understand the problem correctly, but I think this might be what you're looking to do. In your ModelForm, simply exclude the fields you don't want or explicitly include only the fields you do want to use. Those are both under the ModelForm's Meta class. e.g. # Include only thes

Re: AnonymousUser as Foreignkey?

2012-06-12 Thread Kurtis Mullins
Well, unfortunately the standard Anonymous User ID is always none. (source: https://docs.djangoproject.com/en/dev/topics/auth/#anonymous-users) So, you can't really use their ID as a foreign key. However, I'm having trouble picturing your use-case here. If you could give some more information on

Re: cookie based sessions or no?

2012-06-13 Thread Kurtis Mullins
I wouldn't authenticate on every request. That seems like a lot of unnecessary work. Just authenticate once and use Cookies/Authentication Tokens to sustain the session. It's already built in so it's pretty easy to do. They even have a code snippet that shows how to use a special HTTP Header to kee

Progromatically creating Images using Django-Cumulus?

2012-06-15 Thread Kurtis Mullins
Hey guys/girls, I've ran into a problem which I'm not quite sure how to tackle. We use Django-cumulus for handling our user's media. I need to programatically create an image and save it as a ImageField. I want to avoid any "hackish" ways of doing it and try to keep it consistent with the way Djan

Re: Any clue why Facebook iframe would be blank?

2012-06-15 Thread Kurtis Mullins
Haha, no problem! Yep, it's in there (like you saw). I opened up a Stackoverflow post with the question here: http://facebook.stackoverflow.com/questions/11056283/iframe-showing-up-blank On Fri, Jun 15, 2012 at 1:58 PM, Rafał Stożek wrote: > Sorry, I didn't read the code. > > > On Friday, June 1

Re: How to setup Python 2.7 and Virtualenv on a shared host with no root access?

2012-06-15 Thread Kurtis Mullins
Honestly, if your host doesn't provide those services out of the box -- you might have better luck going with a different hosting provider. I would choose a cheap VPS or Cloud Server if I were you. On Fri, Jun 15, 2012 at 4:18 PM, Dan Santos wrote: > Hi darwin, > > Sorry for the late reply. Tha

Re: Problem with order_by on one record only

2012-06-15 Thread Kurtis Mullins
You could try grabbing the exact SQL statement(s) executed for this query and run them yourself on the Oracle Database. At least that would tell you if the problem lay in Django or not. Then, maybe use a debugger to step through the query (try using ipdb or something similar) and see where it gets

Re: How do I get django working without having to manually run the server?

2012-06-16 Thread Kurtis Mullins
> > But you still need manage.py runserver for development because it is > specially designed to prioritise debugging over security and performance. Really? I could see the use for it when running an actual debugger but otherwise, I'm not so sure there's any benefit to using it. Do you have any s

Re: Django on Mac OS X

2012-06-16 Thread Kurtis Mullins
Try using the Brew (or ports or whatever it's called on Mac) system to install Python, PostgreSQL, and the postgresql development libs. On Sat, Jun 16, 2012 at 11:22 PM, Moshe Voloshin wrote: > Replying to this old post as I am having this problem of: > Symbol not found: _PQbackendPID > On MAC OS

Re: upload image

2012-06-17 Thread Kurtis Mullins
> > On Sun, Jun 17, 2012 at 2:33 AM, Satvir Toor > wrote: > but when i try to submit data it makes the upload file empty and gives > notification this field(file upload) is required. Make sure you set up the Form enctype correctly. () MEDIA_ROOT = > '/usr/local/lib/python2.7/dist-packages/d

Re: How do I get django working without having to manually run the server?

2012-06-17 Thread Kurtis Mullins
ver, not for production web > server. > > so make it what you like ... it's in the documentation.. > > > > On Sun, Jun 17, 2012 at 12:20 PM, Kurtis Mullins > wrote: > >> But you still need manage.py runserver for development because it is >>> specially

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread Kurtis Mullins
Give this a shot: user = User.objects.create_user(request.POST['apelido'], request.POST['email'], request.POST['pwd']) user.save() profile = user.get_profile() profile.apelido = request.POST['apelido'] profile.save() Also, I recommend using Forms (and better yet, ModelForms with Class-Based Views

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Kurtis Mullins
> > On Mon, Jun 18, 2012 at 9:30 AM, Daniel Roseman > wrote: There are certain "advanced" features of Django - multiple DBs, model > subclassing, that sort of thing I feel there's quite a few problems that would be relatively unsolvable without model subclassing. At least in any efficient way.

  1   2   3   4   >