Re: Django 1.4: TypeError: get_db_prep_value() got an unexpected keyword argument 'connection'

2012-04-07 Thread Shawn Milochik
On Sat, Apr 7, 2012 at 12:03 AM, xthepoet wrote: > This was working fine for my Ubuntu 10.04LTE system with Django > 1.3.1. It seems broken now in 1.4. > > In Django 1.4, I get this error TypeError: get_db_prep_value() got an > unexpected keyword argument 'connection' when saving an image to an

Re: Django 1.4: TypeError: get_db_prep_value() got an unexpected keyword argument 'connection'

2012-04-08 Thread Shawn Milochik
On 04/08/2012 11:25 AM, shacker wrote: alias delpyc='find . -name "*.pyc" -print0 | xargs -0 rm -rf' Then you safely run "delpyc" from the top level of your project at any time to remove them all, ensuring that whatever problem you're experiencing isn't a result of them. This is probably

Re: Question about threading a view[REPOSTED]

2012-04-09 Thread Shawn Milochik
The best solution for this, in my opinion and experience, is to use supervisord. It's easy, requires no root access, and allows you to control all your long-running processes (Django app, celery, Redis, MongoDB, etc.) from one place. -- You received this message because you are subscribed to

Re: Django Caching with Redis

2012-04-20 Thread Shawn Milochik
For what it's worth, Redis itself allows you to set expiration at the millisecond level. That won't help you with Django's own caching, but if you need to write something custom using the Redis Python module then you can. -- You received this message because you are subscribed to the Google G

Re: New to Jdango - What IDE to use?

2012-04-21 Thread Shawn Milochik
There are eleventy bajillion discussions on this already. Please search the group history on Google Groups. -- 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

Re: Django questions.

2012-04-25 Thread Shawn Milochik
On 04/25/2012 11:04 AM, Marcin Tustin wrote: Apologies, these are job application questions: https://www.odesk.com/jobs/Programmers-Python-Django-and-client-side-programming-MySQL_~~c7db577bb2246e77?tot=5000&pos=4&_redirected

Re: deploying django - including third party apps

2012-04-26 Thread Shawn Milochik
There's no reason a user couldn't run virtualenv, regardless of permissions. Download the virtualenv tarball and extract it. It contains a file named virtualenv.py. Done. Run python virtualenv.py some_path and it will work. -- You received this message because you are subscribed to the Goog

Re: Edit-once object in admin?

2012-04-28 Thread Shawn Milochik
I think you have to change your model. Override the save() method to raise an exception if "self.id is not None." This won't prevent developers from using the 'update()' or 'delete()' methods of a queryset, but for a single instance it shouldn't be editable. It will still be able to be deleted

Re: Databases

2012-04-28 Thread Shawn Milochik
Assuming your PYTHONPATH is set up properly, and your DJANGO_SETTINGS_MODULE is correct or you import your settings file from your crawler, then you can just import and use the models. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: a very simple beginners question

2012-05-02 Thread Shawn Milochik
On 05/02/2012 08:59 AM, alon wrote: running $python manager.py shell opens a python shell is there any way (a parameter) to make the manager run a python file with my commands?? thanks If you have iPython installed then running manage.py shell will run in iPython. Then, you can use iPython

Re: How to change the schma of database using python manage.py syncdb?

2011-08-18 Thread Shawn Milochik
As was mentioned previously, South is the best solution in Django at this time. south.aeracode.org The docs are good, there's a Google Group you can join, and plenty of people on this list use it all the time and can help with it. Shawn -- You received this message because you are subscribe

Re: How to change the schma of database using python manage.py syncdb?

2011-08-18 Thread Shawn Milochik
On 08/18/2011 04:22 PM, Mike Seidle wrote: When I started with Django, I ran into the same issue... seemed kind of silly that we had this amazing framework that did so much but it had no way to really alter tables... Enter South. South works pretty well, but if you roll your own ModelFields it

Re: Anyone use mod_security with Django?

2011-08-18 Thread Shawn Milochik
This was actually discussed in a talk by Adam Baldwin at DjangoCon 2010: http://www.ngenuity-is.com/blog/2010/sep/10/pony-pwning-djangocon-2010/ I don't believe it's a good idea at all to disregard something like mod_security just because we're using Django, because mod_security isn't l

Re: Django Not Populating AutoField

2011-08-18 Thread Shawn Milochik
As defined your id field doesn't differ from Django's default. Just get rid of your custom id field. -- 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 g

Re: Random File Path

2011-08-19 Thread Shawn Milochik
The reason it's generating the same one every time is that the code as written executes when Django starts and that name is kept until you restart your Django process. You can use a lambda to fix that in general Example: wrong: #all records get the datetime the Django process was

Re: Django beginner question

2011-08-20 Thread Shawn Milochik
Christian, We understand that you're a beginner, and there are a lot of people that are willing to help people new to Django on this list. However, you've basically laid out an assignment here and asked how to go about it. That comes across as asking others to do your work for you. You won't

Re: extending the User profile - which way to go?

2011-08-21 Thread Shawn Milochik
Using a OneToOne field does the same thing as a FK with unique set to true, and simplifies queryset syntax. -- 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 t

Re: dynamic form with popup

2011-08-22 Thread Shawn Milochik
On 08/22/2011 05:21 PM, ozgur yilmaz wrote: thats not the answer. you can add item to basket by clicking a button "add to basket" on every item page. My purpose is to fill a single form, with 1 or many products. Than a single button, saves a checkout object and many product object. Use formsets

Re: dynamic form with popup

2011-08-22 Thread Shawn Milochik
On 08/22/2011 05:33 PM, ozgur yilmaz wrote: thanks, but i think i have to use a suitable js for adding a new product. am i wrong? To do it the way you want you'll have to use JavaScript, but it's easy (especially with jQuery) to dynamically add elements to your form. No refreshing necessary

Re: dynamic form with popup

2011-08-22 Thread Shawn Milochik
On 08/22/2011 05:44 PM, ozgur yilmaz wrote: Ok. Thank you so much. So, formset is a suitable way to achieve this. But, is it the most django-oriented way? Is there any alternative way? Maybe using popup window to select a product, and handle the return value of popup, then use a hiddenvalue to ho

Re: Django Development environment

2011-08-22 Thread Shawn Milochik
On 08/22/2011 06:07 PM, Stephen Jackson wrote: I am new to the world of Django. I would like to hear from other django developers describe their dev environment (tools, os, editors, etc.). Ubuntu, virtualenv, Komodo Edit, vim, git Must-haves: Development: South, pyflake

Re: Problem updating data

2011-08-23 Thread Shawn Milochik
The main issue is that your queryset entries wasn't refreshed from the database. Do your queryset again and you'll see one fewer. Also, instead of zero you should use False when querying a boolean field. Shawn -- You received this message because you are subscribed to the Google Groups "Djang

Re: m2m assignments lost when saving in admin but not shell

2011-08-24 Thread Shawn Milochik
In case anyone's interested: I still don't know what the problem was, but I solved it by just doing a delay call to a Celery task, so it happens asynchronously. I was already using Celery/RabbitMQ, and the functionality was one of the things I wanted to make async anyway. -- You received th

Re: Update the parent model when a related (inline) model changed?

2011-08-25 Thread Shawn Milochik
Use django-celery and call the update in the save() or with a post_save signal. That will work under all circumstances, admin or not, and occur asynchronously. If you're not already using RabbitMQ or django-celery it's super easy. -- You received this message because you are subscribed to th

Re: Update the parent model when a related (inline) model changed?

2011-08-25 Thread Shawn Milochik
Sure. Just write your code and call it from the save() or post_save signal. -- 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

Re: ipython 0.11 with django 1.3 /in virtualenv

2011-08-27 Thread Shawn Milochik
If iPython is installed it should be used automatically in Django's manage.py shell. If it's not working and works when you run iPython directly, the most likely case is that you're running two different Python environments and one has iPython installed and the other doesn't. You mention vir

Re: How to use email as user login name

2011-08-28 Thread Shawn Milochik
On 08/28/2011 03:26 PM, quasar wrote: Question is how to use email as user login name, and make user name not unique? What's the best way to do that? To use e-mail as login, write your own backend (about four lines of code). You'll be using the 'email' field, not username, because username i

Re: Delete after specific date

2011-08-29 Thread Shawn Milochik
django-celery is even better -- 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...@googlegroups.com. For more o

Re: "manage.py" command not found

2011-08-30 Thread Shawn Milochik
On 08/30/2011 04:18 PM, Yves S. Garret wrote: I don't know about Windows (if anyone does, please say so), but in a *nix OS putting this (don't remember its official name) at the top of your file can help: #!/usr/bin/env python It's called a 'shebang line,' and it's ignored in Windows. It's i

Re: django setup.py access denies

2011-08-31 Thread Shawn Milochik
On 08/31/2011 04:32 PM, Bill Freeman wrote: So far today I've gotten two useless messages from you, and no spams. Don't feed the trolls. I'm sure a moderator will fix this, if they didn't already unsubscribe themselves. -- You received this message because you are subscribed to the Google G

Re: Authorization workflow model

2011-09-05 Thread Shawn Milochik
You could use a model with three fields: A generic foreign key to the instance to be modified. A char field containing the fieldname on that instance. The new value. Of course you'd need another field to store the user (assuming the person making the authorization will base their decis

Re: How to use ModelForm for both new or existing data

2011-09-05 Thread Shawn Milochik
How about checking for the existence of course_id in the view? Then if it's blank you just send request.POST and if not you grab the instance in the view and pass it as the instance kwarg. Alternately you could do the same in the __init__ of the modelform, before you call the super __init__. It de

Re: Django queries with dates and __lte

2011-09-08 Thread Shawn Milochik
I think your order by needs to be "-start" instead of "start," then take [0] instead of [:1]. That will get the newest entry that matches your query. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-use

Re: Admin Site appending letter "s" to end of each model\table name

2011-09-10 Thread Shawn Milochik
On 09/10/2011 07:46 PM, gillwill2...@yahoo.com wrote: It was only a problem insofar as I didn't like the way such a listing looked, particulalrly when I have several models that already, originally, have an "s" at the end of their name like "Movies", "Books", etc... which would then be listed

Re: Admin Site appending letter "s" to end of each model\table name

2011-09-10 Thread Shawn Milochik
On 09/10/2011 11:55 PM, Gil wrote: I'm a newbie to object-oriented programming too, so I suppose my mindset is still in procedural, SQL and "recordset" modes, and otherwise: my old ways :-) Thanks for that additional info. Good Points. *From:* Shawn Milochik ** You're

Re: Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Shawn Milochik
You can use the post_delete signal in Django's signals. Then, assuming your MongoDB collection name is derived from your model in a consistent manner then you're all set. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: installing django

2011-09-13 Thread Shawn Milochik
On 09/13/2011 01:21 PM, re64 wrote: I am having trouble installing django. I cant seem to do it any suggestions https://code.djangoproject.com/wiki/UsingTheMailingList Pay special attention to the 'Prepare the Question' section. -- You received this message because you are subscribed to th

Re: problem with "\"

2011-09-13 Thread Shawn Milochik
Better to use os.sep. -- 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...@googlegroups.com. For more options,

Re: problem with "\"

2011-09-13 Thread Shawn Milochik
This is a Python question, not a Django issue. Check out the python-list group: http://mail.python.org/mailman/listinfo/python-list Also, split is working. You just have a non-ASCII character in your data. Please follow up on the Python list, as this is off-topic for this group. -- You rece

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
Take your study/research one step further: https://code.djangoproject.com/browser/django/trunk/django/forms/forms.py When it checks for self.errors, the _get_errors() function calls the full_clean. -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
On Tue, Sep 20, 2011 at 4:14 PM, Jacob G wrote: > Thanks, I didn't realize errors is property that calls _get_errors(). > Yeah, it's non-obvious. That's one of the nice things about open-source, though. You can go through the code and understand how your tools work so you can better apply them.

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
On Tue, Sep 20, 2011 at 4:46 PM, Jacob G wrote: > I doubt I'm familiar enough with Django to fix bugs. > Wait until the talks from DjangoCon US 2011 are out, then watch my lightning talk. I guarantee you could submit at least three patches today alone. > I am puzzled by what I am see though with

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
I think this can be easily explained by pointing out a misunderstanding. Whether or not a form's values are valid has nothing to do with whether the values are meaningful. That is, a login form with a present but incorrect password is in fact valid. I'm sure that full_clean is getting called, and

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Shawn Milochik
On Wed, Sep 21, 2011 at 5:54 PM, Marc Aymerich wrote: > On Wed, Sep 21, 2011 at 11:46 PM, David Watson > wrote: >> Looks like they are online now http://blip.tv/djangocon >> regards, >> David >> > > Wow, great news!! I'm going to check it out right now :) > Awesome. They're not all there, but

Re: retrieving data from list of dictionaries

2011-09-25 Thread Shawn Milochik
This is a Python question. Please subscribe to this list: http://mail.python.org/mailman/listinfo/python-list Look up the built-in command "zip" and the keys method of dict to solve your issue. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: Multiple forms with same name.

2011-09-26 Thread Shawn Milochik
Use the 'prefix' kwarg that comes with Django forms. -- 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...@goog

Re: circular dependency in models.py

2011-09-26 Thread Shawn Milochik
If I'm understanding your question properly, you can use the unique_together option. https://docs.djangoproject.com/en/1.3/ref/models/options/#unique-together -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Using exists() on queryset for a User

2011-09-26 Thread Shawn Milochik
if User.objects.filter(email = data['email']).exists() -- 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...@go

You -- yes, you -- should contribute to Django.

2011-09-28 Thread Shawn Milochik
This is my lightning talk, given at DjangoCon US 2011. If you're on this list and have never submitted a patch to the Django project because you think you aren't "good enough" yet, please watch this. Skip to about 11:45, and watch for about four minutes. http://blip.tv/djangocon/lightning-talks-t

Re: Create singular instance with ManyToManyField input as ids

2011-09-29 Thread Shawn Milochik
I think you need the commit=False argument. https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#the-save-method -- 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 un

Re: You -- yes, you -- should contribute to Django.

2011-09-29 Thread Shawn Milochik
On Wed, Sep 28, 2011 at 10:36 PM, Kurtis wrote: > Out of curiosity, is this a good place to start? > https://code.djangoproject.com/query?status=!closed&easy=1 > That could be a good place to start. But we do have a lack of triage volunteers, so many tickets won't have been marked easy yet. I r

Re: ManyToMany problem

2011-09-29 Thread Shawn Milochik
I don't think you can make the 'through' argument a string, and I don't think there's circular dependency issue with the 'through' kwarg. -- 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@googlegro

Re: form.is_valid() NOT triggering model validation?

2011-09-29 Thread Shawn Milochik
This exact thing was just discussed on this list. https://groups.google.com/d/topic/django-users/R2HUGqZ1BAQ/discussion -- 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 unsub

Re: Overwriting queryset from models for templates

2011-10-03 Thread Shawn Milochik
That's what a custom manager is for: https://docs.djangoproject.com/en/1.3/topics/db/managers/#custom-managers So you can replace your Book.objects with another Manager(), or add another manager to be used for your custom stuff. -- You received this message because you are subscribed to the Goo

Re: Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Shawn Milochik
A clean way would be to read in the CSV with csv.DictReader, and ensure that the key names match your field names. Then use a ModelForm for your model, and pass in each dict as the 'data' field. This lets you re-use all the hard work already done in the ModelForm, because the is_valid() method wi

Re: Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Shawn Milochik
> To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Shawn Milochik CTO Greenphire 484-334-2752 sh...@milochik.com -- You received this message becau

Re: What is the right way to use S3 as a storage backend?

2011-10-05 Thread Shawn Milochik
Could it be the ADMIN_MEDIA_PREFIX setting? -- 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...@googlegroups.

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
Make as many files as you want, and make sure you import their classes in models.py so they get picked up by syncdb. Normally, to do something like this you'd replace the file (in this case models.py) with a folder named 'models' containing a file called __init__.py, and import all the additional

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
On Fri, Oct 7, 2011 at 10:47 AM, Chris Czub wrote: > Shawn -- what do you recommend instead? A friend and I recently had > this debate. His suggestion was to split off as much behavior into > smaller apps with only a handful of models in the models.py as > possible, but I said that if it's not re

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
Tom, The 'magic' I was referring to was the check for the existence of a 'models.py,' thus preventing you from replacing it with a models directory containing __init__.py. That's what a Pythonista would normally do in this case. That 'magic' requires you to import the things from models.py instead

Re: Easy question (I hope)

2011-10-07 Thread Shawn Milochik
On Fri, Oct 7, 2011 at 11:15 AM, Tom Evans wrote: > I do this a lot, and haven't found any problems with doing so. My main > app has no models.py, but has models/{__init__,foo}.py, and it is > still found quite happily by syncdb, south, the admin interface, the > app template loader etc. > > Is t

Re: can't use django session object

2011-10-07 Thread Shawn Milochik
Session variables are strings. If you want an object you're going to have to serialize it (probably using pickle) and deserialize it when you retrieve it before you can use it. As you're doing it now, you're probably just storing the unicode representation in the session, not the actual object.

Re: can't use django session object

2011-10-07 Thread Shawn Milochik
On Fri, Oct 7, 2011 at 1:07 PM, Saba Bokhari wrote: > I thought it was something like that, but when I do: > > a_cred=request.session['user_cred'] > print type(a_cred) > > I get this result: > > not unicode > > Do you get that in the view where you just inserted it into the session? What do yo

Re: PayPal Adaptive Payments

2011-10-08 Thread Shawn Milochik
Please read this: https://code.djangoproject.com/wiki/UsingTheMailingList Your question is so vague that it's gives the impression you haven't actually tried to solve your own problem and you want someone to do your work for you. Assuming that's not the case, please let us know what you've tried

Re: TemplateSyntaxError at /admin/

2011-10-08 Thread Shawn Milochik
See your urlpatterns section that has the prefix 'myapp.views.' It's at the bottom of your e-mail. You have some stuff in there that doesn't belong there. It should be broken out into another "urlpatterns += patterns(...)" section that has no prefix or the correct prefix. -- You received this me

Re: Problem in registration form

2011-10-10 Thread Shawn Milochik
Your problem is made clear in the error message. -- 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...@googlegr

Re: django free web hosting list

2011-10-14 Thread Shawn Milochik
A more comprehensive and canonical list is already on the wiki: https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts If anything's missing then this site should probably be updated, rather than splintering the list. -- You received this message because you are subscribed to the Google Gro

How do you pinpoint a performance issue?

2011-10-21 Thread Shawn Milochik
Real-life situation: I deployed a week's worth of code changes to production. Upon restart, site wouldn't load anymore. Nothing but a 404 error. Long story short: By using Django's logging, I discovered that a query was being run tens thousands of times -- obviously in a loop. I inserted

Re: wsgi, URL patterns and standard deploy practices

2011-11-16 Thread Shawn Milochik
You might be interested in this talk from DjangoCon US 2011: http://blip.tv/djangocon/restful-apis-promises-lies-5572618 -- 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 unsu

Re: Easiest Way to Deploy Django?

2013-02-22 Thread Shawn Milochik
To answer the original question, my vote is for nginx + gunicorn. -- 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 django-users+unsubscr...@googlegroups.com. To

Re: strange DatabaseError by ForeignKey

2013-02-23 Thread Shawn Milochik
You probably need to run syncdb, or migrate if you're using South. -- 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 django-users+unsubscr...@googlegroups.com. To

Re: I need a form that allows users to select from a list of choices, or add a new choice.

2013-02-27 Thread Shawn Milochik
Remember, it's just Python. In the end, all you need is for the 'choices' of the field (which is just an iterable) to contain the value after the form's __init__ so that the form won't consider the value invalid. You could: 1. Have a pop-up form that allows the user to submit the new choice via A

Re: ANNOUNCE: Django 1.5 released

2013-02-27 Thread Shawn Milochik
Ahh, the release of a new version of Django. Always a fantastic time to support the Django Software Foundation: https://www.djangoproject.com/foundation/donate/ The money goes to support sprints and other things -- see the donate page for more details. -- You received this message because you a

Re: Best practices for 1.5 configurable user model and profiles

2013-02-27 Thread Shawn Milochik
Do a search on the history of the django-developers mailing list. There are many reasons, and they were discussed for literally years. Some of the main ones that come to mind: first_name/last_name is US-centric. e-mail address field length was too short. e-mail address could not be used as the us

Re: Best practices for 1.5 configurable user model and profiles

2013-02-27 Thread Shawn Milochik
On Wed, Feb 27, 2013 at 12:46 PM, Doug wrote: > Thanks Shawn. So what is your take? Only authentication data in User? > Separate Profile model and app? I think Russell hit the main points well. Make User only what it needs to be for identification/authentication, and put other stuff elsewhere, un

Re: Use variable in my template?

2013-02-28 Thread Shawn Milochik
On Thu, Feb 28, 2013 at 11:30 AM, Maria wrote: > Can you tell me where exactly to insert that Variable? Have a look at this page in the tutorial: https://docs.djangoproject.com/en/1.5/intro/tutorial03/ See how a variable in the view is added to the context? Exactly like that. -- You received t

Re: Django + Raspberry PI

2013-03-01 Thread Shawn Milochik
Yep, I got my full development environment for one of my company's applications running on it with almost no problem. The one exception was MongoDB, which is for x86 only, so I had to compile a fork, which took about 10 hours on the Pi. It was definitely pretty slow, but it works. Our stack inclu

Re: Is there a way to list users that have logged in within the pass 30 minutes

2013-03-04 Thread Shawn Milochik
On Mon, Mar 4, 2013 at 1:02 PM, frocco wrote: > ok, do you have a better idea on how I might do this? > user is used to seeing this from a PHP site that I am porting. > I use this at the shell sometimes: from django.contrib.auth.models import User for user in User.objects.order_by('-last_login')

Re: How to pass a value from a Django View to a JQuery Slider bar.

2013-03-04 Thread Shawn Milochik
Probably consume the view with AJAX, doing a POST on the change event of the slider. http://api.jquery.com/category/ajax/ Put your result in a dictionary within your view and return it as JSON: return HttpResponse(json.dumps(result), mimetype="application/json") -- You received this message be

Re: Is there a way to list users that have logged in within the pass 30 minutes

2013-03-04 Thread Shawn Milochik
On Mon, Mar 4, 2013 at 2:05 PM, frocco wrote: > So are you saying the best I can do is show users that logged in xx minutes > ago, even through they may have logged off? Actually, yes. Because most users never log out. They just close their browsers. So even if you did look at the session data it

Re: Is there a way to list users that have logged in within the pass 30 minutes

2013-03-04 Thread Shawn Milochik
No, because that will just invalidate the cookie so that they'll have to log in again when they reopen their browser. It doesn't magically notify your Django app that the browser closed. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

Re: I need to play a wav file

2013-03-04 Thread Shawn Milochik
This has nothing to do with Django. It's an HTML or maybe a JavaScript thing. Just do a Google search. Unless you're going to dynamically generate the WAV file and need help streaming it, I don't think list this is the best resource. -- You received this message because you are subscribed to the

Re: I need to play a wav file

2013-03-04 Thread Shawn Milochik
On Mon, Mar 4, 2013 at 3:35 PM, frocco wrote: > ok, I was thinking it was a python code thing. > No, you can't execute arbitrary Python code on the user's machine. People were playing wav files (hampster dance, anyone?) many years ago in HTML. http://www.w3schools.com/html/html_sounds.asp -- Y

Re: django DB optimization

2013-03-04 Thread Shawn Milochik
Rule #1: Measure first. Don't add any complexity to fix any bottlenecks until you know for a fact where they are. Once you know where one is, the solution will probably be fairly obvious. Caching, denormalization, etc. Come up with a way to stress-test your app and add measurements. -- You rece

Re: Django admin - Insert into another table

2013-03-05 Thread Shawn Milochik
Sure. Just use the post-save signal: https://docs.djangoproject.com/en/1.5/ref/signals/#post-save -- 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 django-users+u

Re: Extending the base file depending on User type

2013-03-05 Thread Shawn Milochik
Instead of extends, you could use the "include" directive. -- 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 django-users+unsubscr...@googlegroups.com. To post to

Re: Setting Django to not quote table names

2013-03-05 Thread Shawn Milochik
I'm taking a look at this as someone pretty unfamiliar with the ORM. Hopefully someone more knowledgeable will jump in. However, in the meantime (if you're feeling adventurous), you could look in django/db/backends/oracle/base.py and have a look at function quote_name. A naive look at it makes me

Re: Setting Django to not quote table names

2013-03-05 Thread Shawn Milochik
This works for me in Postgres as well. This script: from django.contrib.auth.models import User qs = User.objects.filter(username='smilochik') print qs.query.sql_with_params() returns this output: ('SELECT "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name"

Re: Setting Django to not quote table names

2013-03-05 Thread Shawn Milochik
On Tue, Mar 5, 2013 at 5:41 PM, Johan ter Beest wrote: > Not an Oracle expert at all but maybe this SO answer explains some things?: > > http://stackoverflow.com/questions/563090/oracle-what-exactly-do-quotation-marks-around-the-table-name-do > So if it's down to case-sensitivity then everything

Re: Changing SECRET_KEY for a project that was already launched

2013-03-06 Thread Shawn Milochik
Are you using it as the key for any encrypted fields, or anything other than the built-in stuff Django does with session cookies? If not, I don't think you'll have a problem. Of course, back up your database first as a precaution, and use version control on your code so you can revert if necessary

Re: I screwed up my django site using touch

2013-03-07 Thread Shawn Milochik
On Thu, Mar 7, 2013 at 10:38 AM, frocco wrote: > Thanks you, I think I will only use Pycharm now to help prevent this issue > again. > I hope future versions will offer better trace. Even better, use version control, such as git. Then your editor will be irrelevant and it will be trivial to find

Re: RSS combinator

2013-03-07 Thread Shawn Milochik
I doubt there's a Django app for that -- it's not a problem for a Web framework. You may be able to find a project that does this on Github or Bitbucket. RSS feeds are just XML files. You need something that will parse the XML from multiple files, then re-write one XML file containing the items fr

Re: How can my JQuery Sliderbar pass a value to the Veiw and cause the View to execute?

2013-03-08 Thread Shawn Milochik
I think we've come all the way around to where my response is now appropriate. :o) https://groups.google.com/d/msg/django-users/kB27nmftPng/btPKtxvoumYJ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and s

Re: how to automatically create userprofile when user is created from admin

2013-03-08 Thread Shawn Milochik
Yes. Use a post-save signal. -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to djan

Re: How can my JQuery Sliderbar pass a value to the Veiw and cause the View to execute?

2013-03-08 Thread Shawn Milochik
You'll need to attach something to the "change" event of your slider to execute a JavaScript function. The function would contain something like this: // $.ajax({ // url: your_url, // cache: 'false', // success: function

Re: Template inheritance

2013-03-09 Thread Shawn Milochik
If the refresh is the only thing in your "extrahead" block, then just don't add block.super to extrahead in your change form, and you can eliminate the "if" statement from it in your base template. -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: MultipleFileField

2013-03-10 Thread Shawn Milochik
https://docs.djangoproject.com/en/1.5/topics/forms/modelforms/#inline-formsets -- 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 django-users+unsubscr...@googlegro

Re: Installing current Django on current Debian with current Python

2013-03-12 Thread Shawn Milochik
The best solution is to use a virtualenv. The decision to purge Python2.6 was a very, very bad one. You should never mess with the version Python that comes with your OS. Lots of software on the system relies on it. You could try to use aptitude to restore it. Hopefully that will work. Otherwise,

Re: Problems install/download Django 1.5

2013-03-12 Thread Shawn Milochik
You can just download the tarball and "pip install filename." -- 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 django-users+unsubscr...@googlegroups.com. To post

Re: Installing current Django on current Debian with current Python

2013-03-13 Thread Shawn Milochik
On Wed, Mar 13, 2013 at 6:08 AM, wrote: > > Question remains how to get current releases of Debian, Python and Django > running together. > As I said in the earlier e-mail, use virtualenv: https://pypi.python.org/pypi/virtualenv -- You received this message because you are subscribed to the G

<    1   2   3   4   5   6   7   8   9   10   >