blank and null with Oracle

2013-02-27 Thread Skylar Saveland
Some odd behavior with Oracle involving blank and null. blank is True on this field: my_auto = models.AutoField(blank=False, null=False, primary_key=True) null is True on this field: uncles = models.ManyToManyField(Uncle, blank=False, null=False) null is True on this field: photo =

Re: charField null=false not enforced for table creation in oracle

2013-02-22 Thread Skylar Saveland
This is still a good question :) On Thursday, March 11, 2010 5:57:13 AM UTC-8, Wayne wrote: > > Hi Karen, > > Many thanks for your reply. > Now our business requirements do not allow either empty string or null > value for this particular charField column (name = >

Possible Bug with GenericRelation and values_list

2012-12-10 Thread Skylar Saveland
I may have found a bug. I made a test case here: https://github.com/skyl/django/commit/556df1c46146c2fc9c4022d838fa23f652f0ea8d The final assertion fails. Is this a bug or do I misunderstand how this should work? Thanks -- You received this message because you are subscribed to the Google

Re: Class based views and form processing

2011-01-12 Thread Skylar Saveland
what's wrong with just defining form_valid sth like: form_valid(self, form): self.object = form.save(commit=False) #ponies self.object.save() return HttpResponseRedirect(self.get_success_url()) does that not work? -- You received this message because you are subscribed to

Re: Class based views and form processing

2011-01-12 Thread Skylar Saveland
instead of calling super, you could just call FormMixin.form_valid directly, yes? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: User.get_profile() not working

2010-09-28 Thread Skylar Saveland
Using *args and **kwargs might work then maybe self.website = kwargs.get('website', 'default.com') On Sep 28, 1:45 pm, adj7388 wrote: > Django newbie issue. Just trying to understand. I'm setting up a > simple UserProfile class to link to User (as described in several >

Re: User.get_profile() not working

2010-09-28 Thread Skylar Saveland
Overriding __init__ might be a little shady, but you probably can get away with it if you use *args and **kwargs On Sep 28, 1:45 pm, adj7388 wrote: > Django newbie issue. Just trying to understand. I'm setting up a > simple UserProfile class to link to User (as described in

Re: iPhone talking to Django server (matching session)

2010-09-28 Thread Skylar Saveland
User.objects.get(pk=Session.objects.get(pk=session_id).get_decoded() ['_auth_user_id']) via @SmileyChris On Sep 28, 9:36 pm, Danny Bos wrote: > Heya, > > I've got a Django application talking to an iPhone sending photos and > User data back and forth. I figured the best

Re: form validation for empty checkboxes that are not required (and they are the only fields present)

2010-09-28 Thread Skylar Saveland
=forms.CheckboxSelectMultiple ) class Meta: model = Asset fields = ('languages',) Adding a hidden garbage field works. Seems like it's just a little edge-case bug/gotcha. On Sep 28, 8:49 am, Brian Neal <bgn...@gmail.com> wrote: > On Sep 27, 11:35 am, Skylar

form validation for empty checkboxes that are not required (and they are the only fields present)

2010-09-27 Thread Skylar Saveland
I have some modelforms within a . Each form has one checkboxselectmultiple that is not required. If I post nothing (all checkboxes are empty) then all of the forms are invalid. If I post anything then all of the forms are valid. This anything could be that one of the forms has a box checked,

Re: Unexpected query behavior

2010-07-09 Thread Skylar Saveland
http://docs.djangoproject.com/en/1.2/topics/db/queries/#spanning-multi-valued-relationships On Jul 10, 12:33 am, Skylar Saveland <skylar.savel...@gmail.com> wrote: > If I chain my .filter()s > > Collection.objects.filter(collection_revisions__articles=art

Re: Unexpected query behavior

2010-07-09 Thread Skylar Saveland
the second query should read: Collection.objects.filter(collection_revisions__articles=article, collection_revisions__revision_tag="p") -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Unexpected query behavior

2010-07-09 Thread Skylar Saveland
If I chain my .filter()s Collection.objects.filter(collection_revisions__articles=article).filter(collection_revisions__char_fi="p") collection_revisions is related_name, FK to Collection. articles relname, m2m with collection_revision (with a through table). I get ~20 results with this query::

Re: Serving django admin files using mod_python

2010-06-24 Thread Skylar Saveland
mod_python is dead. you can just serve your static files .. statically. usually you might point at a cdn or put nginx in front although you could set /media or / ash/media to serve statically with apache. On Jun 24, 5:47 pm, commonzenpython wrote: > i have been

pointer 1to1, '_ptr', what are the rules?

2010-06-24 Thread Skylar Saveland
I have: class Foo(models.Model): ... class Bar(Foo): class Meta: proxy=True class Baz(Foo): ... my baz instances have a `foo_ptr` attr on them and my bar instances do not. The only reason I can think of that this is is b/c Bar is a proxy. Is this correct? Is there some

Re: djapian not working with apach2

2010-06-21 Thread Skylar Saveland
I would guess that you are trying to access /index with the webserver user but that is owned by another user and the user that owns the web process has not the sufficient permissions to do the attempted operation. Set the permissions on the directory accordingly, perhaps ownership as well. You

ModelForm with ManyToManyField on the other side

2010-06-21 Thread Skylar Saveland
class Material(models.Model): products = ManyToManyField('Product', related_name='materials') class Products(models.Model): ... class ProductForm(forms.ModelForm): class Meta: model = Product fields = ('materials', ) I want to do this. I saw this discussion:

Re: Localization and date format

2010-04-24 Thread Skylar Saveland
I presume that you mean date formatting in the templates: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date you can use the strftime format bits iirc: http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior you can set the default with a setting

Re: SCORM(Sharable Content Object Reference Model) Compliant for Django?

2010-04-23 Thread Skylar Saveland
I was about to need to do something along these lines, so I used inspectdb to look at Moodle. I was going to connect django and moodle to the same DB since moodle was going to be a certainty in the position that I didn't end up taking: http://github.com/skyl/django-moodle This is a really

Re: Performing an action on model.save() but not on update

2010-04-23 Thread Skylar Saveland
se depending on if > the object is being created or updated. Check out the post_save > documentation:http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.si... > > On Apr 23, 3:32 pm, Skylar Saveland <skylar.savel...@gmail.com> wrote: > > > > > > > On A

Re: Oracle cursor.execute problem

2010-04-23 Thread Skylar Saveland
:32 pm, Skylar Saveland <skylar.savel...@gmail.com> wrote: > Looking at the source for execute on django-trunk in > django.db.backends.oracle > > If you have a param, you will have an arg for the query (type: > string). > > http://docs.djangoproject.com/en/dev/topi

Re: Oracle cursor.execute problem

2010-04-23 Thread Skylar Saveland
Looking at the source for execute on django-trunk in django.db.backends.oracle If you have a param, you will have an arg for the query (type: string). http://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly ... your params should be a list of things to interpolate into

Re: auto generate "dummy" content (e.g. Lorem ipsum generator for Django)

2010-04-23 Thread Skylar Saveland
http://docs.djangoproject.com/en/dev/ref/contrib/webdesign/#ref-contrib-webdesign On Apr 23, 3:41 pm, Brad Buran wrote: > Is there any easy way of generating dummy content for models in Django?  As > I'm learning how to use Django, I often find myself deleting the sqlite >

Re: Autocomplete with two tables

2010-04-23 Thread Skylar Saveland
http://docs.djangoproject.com/en/dev/topics/db/queries/ On Apr 23, 11:11 am, Pep wrote: > Hi everybody ! > > I have two tables on my database : one for the products (named > Product) and one for my clients (name Client). > In Client, there is a row named 'products' where

Re: Filtering for an object that is modified in memory loses those modifications?

2010-04-23 Thread Skylar Saveland
Yes. The filter method returns a queryset which is a lazy database object that will query the database to get the queryset. You would have to save the object for the queryset to return it. You could however get all of the objects which are not your select objects

Re: Performing an action on model.save() but not on update

2010-04-23 Thread Skylar Saveland
On Apr 23, 3:27 pm, Jim N wrote: > Hi, > > I have overridden the default save() on a model so that I can update > some counts every time a save occurs.  Unfortunately, I don't want to > perform these actions every time the model is updated, which seems to > happen. > > Is

Re: Django IDE

2010-02-14 Thread Skylar Saveland
This might be the wrong way to help you if you want something super- gui-fabulous. But, I have a dusty old project that is not gaining any traction to make a nice IDE out of vim. If you don't know/like vim and have no desire to learn then I might just be wasting your time.

Re: looping over dictionaries

2010-02-14 Thread Skylar Saveland
{% for k, v in d.items %} {{k}} {{v}} {% endfor %} On Feb 14, 1:58 pm, Madis wrote: > Why will this not work or how should i write it to work: > > I have the following dictionary: > projects = {u'NetMinutes': {'chains': [u'Arendus', u'Uuslahendus']}, > u'Veel': {'chains':

Re: Need help testing views with csrf in 1.1.1

2010-01-08 Thread Skylar Saveland
In case anyone else runs across this, the answer appears to be: disable csrf protection while testing. On Jan 8, 7:04 pm, Skylar Saveland <skylar.savel...@gmail.com> wrote: > I wondering what I'm doing wrong here.  These views work as expected > with a browser.  I was looking to imp

Need help testing views with csrf in 1.1.1

2010-01-08 Thread Skylar Saveland
I wondering what I'm doing wrong here. These views work as expected with a browser. I was looking to improve my test coverage. >>> c = Client() >>> get_response = c.get( reverse('create', kwargs={'typ':'residential'}) ) >>> get_response.status_code 200 >>> post_response = c.post(

Re: django-registration terms of service link

2009-12-04 Thread Skylar Saveland
help_text is safe by default? Might be of some use. aa56280 wrote: > The "safe" filter works on a string, not the entire form. So you'll > have to apply it to the label of the field: > > {{ form.tos.label|safe }} > > Hope that helps. > > > > On Dec 4, 11:55 am, Viktor

Re: ModelForm save() cleans data first?

2009-12-01 Thread Skylar Saveland
Wait, this is a better question than I thought on first glance. Not entirely sure, sorry for the terse first response. Skylar Saveland wrote: > Former > > Continuation wrote: > > When a ModelForm object calls save(), does it first clean the form > > data using form.clean

Re: ModelForm save() cleans data first?

2009-12-01 Thread Skylar Saveland
Former Continuation wrote: > When a ModelForm object calls save(), does it first clean the form > data using form.cleaned_data? Or do I need to call form.cleaned_data > explicitly? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: cannot import name settings - accessing Django environment from external script

2009-12-01 Thread Skylar Saveland
I thought that it was best practice to not put python code in /var/www and to own the code with an unprivileged user. Doesn't seem like it is necessarily germane to the present topic but perhaps something to think about. Am I wrong? Are there exceptions? I think I have seen some high profile

Re: django not finding modules on pythonpath

2009-12-01 Thread Skylar Saveland
Are you using python-path arg to WDP? Also, you might do some sys.path hacking in the .wsgi script. neridaj wrote: > Hello, > > I'm trying to deploy my project to my server and I don't understand > why django isn't finding modules I've added to my pythonpath. When I > try to access my site I get

Re: django url and reverse

2009-11-29 Thread Skylar Saveland
You simply can't call request.user.get_profile() on an anonymous user. caliman wrote: > Hi! > > In my project most of my views requires the user to be logged in but > in some i don't for example the login view wich only displays a login > form. When I'm going to the login form as a non logged in

Re: Error when generating PDF

2009-11-26 Thread Skylar Saveland
>    Paragraph(rack.nick, normalstyle, bulletText=None), Yep, rack.nick is None here it would seem. Like Karen said, don't have nullable CharField if you can help it; blank=True is good and then and empty will be "". I have a dirty hack for you that should 'work'. Paragraph( rack.nick if

Re: Newbie: is it possible to re-render a tag/filter after adding it to the web page as string

2009-11-26 Thread Skylar Saveland
> > I'm reading a string value that is stored in my database. This string > the main content of my webpage and it contains contents like > javascript, css styling, and django template tags/filters. > > After I load string value by {{ stringValue|safe }} filter, everything > is added to the page

Re: Show field labels instead of names in form error lists

2009-11-26 Thread Skylar Saveland
On Nov 27, 1:27 am, Yang Zhang wrote: > What's the easiest way to have error lists describe fields using their > labels instead of their names? Thanks in advance. I don't think that I understand your question. Is there something to it that isn't covered in

Re: admin for "regular" users - still a bad idea?

2009-11-26 Thread Skylar Saveland
> each user has their own table in the > db for transactions, and they can do whatever they want to their own > data. i wouldn't want them to be able to touch anyone else's tables, > but it seems like django has a permissions system to restrict that. ha, reading lists on mobile ... I didn't even

Re: admin for "regular" users - still a bad idea?

2009-11-26 Thread Skylar Saveland
> I don't > believe you can do inline formsets with generic views, which is > unfortunate, but it's not hard with a simple custom view. well, perhaps not automagically, but you can just send extra_context and then do a little bit of custom work ``if request.method == POST``. -- You received

Re: admin for "regular" users - still a bad idea?

2009-11-26 Thread Skylar Saveland
Yep, still a bad idea. Permissions are by table not by row. Use generic views for basic CRUD. Count László de Almásy wrote: > i've seen notes in some django documentation that implies that using / > admin/ for non-trusted users is not a good idea. which is unfortunate > since it seems like the

Re: How can I change the values of select options created by a ModelForm?

2009-11-26 Thread Skylar Saveland
You're primary question is a little tough, ther are a couple of ways to go. I just wanted to mention that your slug might not be unique the way you have it and you could get IntegrityError. Also, your get_absolute_url would be better served with permalink. Your primary question, well, I'm just

Re: Chart tool

2009-11-26 Thread Skylar Saveland
You might also check out pycha? S.Selvam wrote: > On Thu, Nov 26, 2009 at 2:01 AM, Javier Guerra wrote: > > > On Wed, Nov 25, 2009 at 3:07 PM, S.Selvam wrote: > > > I need to show some data as a chart. > > > > > > I would like to achieve a high

Re: Addree Book Contact Importer in django/python

2009-11-18 Thread Skylar Saveland
>   I need to import contacts of given email id/pwd from gmail,yahoo,hotmail > for django app. Please suggest? yaho: http://developer.yahoo.com/auth/ http://www.amaltas.org/show/using-yahoo-bbauth-with-django.html goog: http://code.google.com/p/gdata-python-client/ Not sure about hotmail. --

Re: Redirect problems

2009-11-18 Thread Skylar Saveland
What are the details of the error? On Nov 18, 7:06 am, Zeynel wrote: > I've been trying to redirect > > /admin/ to /admin/wkw1/lawyer > > The suggestions from my previous > posthttp://groups.google.com/group/django-users/msg/67c4594a4083bd45 > did not work. > > I read the

Re: ModelForm and fieldsets

2009-11-18 Thread Skylar Saveland
> that was my mistake - had an error in the template - it wors no. > But according to this, I've another problem - fields which are foreign > keys don't get rendered. Typos? Wrong names? Maybe try to define the fields explicitly with the widgets and choices that you want (but then the save

Re: bulk product import to satchmo

2009-11-18 Thread Skylar Saveland
My buddy did a talk on generically importing data from excel for pyatl. http://www.mefeedia.com/watch/25167971 You can check out some code here: http://code.google.com/p/django-batchimport/ Not sure how it will do with this satchmo business. > there is no script for parsing.  I'm importing

Re: ModelForm and fieldsets

2009-11-18 Thread Skylar Saveland
If you haven't already, you could instantiate one in the shell and render/inspec it there. You will at least be able to see what might be a problem with your class/python-code vs what might be wrong at the template level. On Nov 18, 9:27 am, Benjamin Wolf wrote: > Hi there, > >

Re: How to handle this race condition?

2009-11-10 Thread Skylar Saveland
Why store it in the database? You might be able to avoid this directly if you use a model method for this attribute. Continuation wrote: > I'm working on an auction app. > > In an Auction object I store the current_high_bid for that auction. > > When a new_bid comes in, I: > 1) retrieve the

Re: Django Interview Questions

2009-11-02 Thread Skylar Saveland
Doesn't work on my mobile browser. Dimitri Gnidash wrote: > Hey guys, > > For all those of you interviewing or being interviewed, I created a > quick list of sample interview questions. > While not comprehensive, it is a good start to review these before the > interview, if anything, to gain a

Re: Migrating a Wordpress website to Django

2009-11-02 Thread Skylar Saveland
inspectdb might be of some interest John K wrote: > Hello all, > > We are auditing several web frameworks and will ultimately choose one > that will replace Wordpress (Wordpress hosted on our servers). So far, > Django fits the bill. > > Has anyone had any experience migrating a Wordpress site

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread Skylar Saveland
If you are not in a virtualenv with -no-site-packages then you should be able to just: sudo aptitude install python-mysqldb sridharpandu wrote: > Thanks. That was quick. I use Ubuntu 9.04 (jaunty). I am unable to > figure out the location of MySQLdb. A "WHEREIS MySQLdb" at the command >

Re: mptt get_ancestor method breaks based on data?

2009-09-18 Thread Skylar Saveland
Well, after further review it looks like changing the data and running syncdb with initial_data is probably the culprit.. makes sense? On Sep 18, 1:28 pm, Skylar Saveland <skylar.savel...@gmail.com> wrote: > I have a model on which django-mptt works with the simple test data. > How

mptt get_ancestor method breaks based on data?

2009-09-18 Thread Skylar Saveland
I have a model on which django-mptt works with the simple test data. However, when I load the production data (where I have seen that get_ancestor is not working) to my dev machine, get_ancestor returns []. In [5]: for p in Page.objects.filter(parent__isnull=False): ...: print p,

Re: serving a static file via nginx requiring authentication from django

2009-07-01 Thread Skylar Saveland
You could document this experience once you get it running; sounds useful. On Jun 30, 1:00 am, John Hensley wrote: > On 6/28/09 10:20 PM, Annie wrote: > > > I'm trying to this to work: users can download their files from their > > account page from a url like > >

orbited tutorial .. wsgi instead of mod_python shouldn't matter?

2009-06-29 Thread Skylar Saveland
http://darkporter.com/?p=7 --~--~-~--~~~---~--~~ 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

Re: Need help

2009-05-31 Thread Skylar Saveland
sky...@abc255:/$ sudo updatedb [sudo] password for skylar: sky...@abc255:/$ locate pg_hba.conf /etc/postgresql/8.3/main/pg_hba.conf sky...@abc255:/$ sudo vim /etc/postgresql/8.3/main/pg_hba.conf There should be some lines something like this (for local access): local all postgres

Re: What's wrong with this code?

2009-05-31 Thread Skylar Saveland
It looks pretty good to me. Are you trying this in a shell? If not that might help you debug. You are missing a ')' at the end of >>>reader = csv.reader(open("mysite\restaurants.csv") that is probably actually your problem ;-). I was experiencing some strange behavior as I was playing with

Re: Revisit Django trunk and Python 2.6

2009-05-24 Thread Skylar Saveland
On May 24, 3:21 am, Kegan wrote: > I am always using Django trunk and Python 2.5.4. And having no > problem. > > I am thinking of switching to Python 2.6 (just to use latest python > version). Anyone is already doing this in development? production? Any > problem? > > Thanks.

Re: 2 seperate projects, or 2 seperate apps?

2009-05-23 Thread Skylar Saveland
> each be on their own domain when finished, and they will both have > their own auth models (to use both sites, you need an account on each > site). Sounds like two different settings files to me but I would be interested to hear what others have to input.

Re: Python noob tuples question

2009-05-22 Thread Skylar Saveland
> if I start a tuple with ( ('john","adams")) Also, this is the same as ('john', 'adams')... it is just a tuple and not a tuple within a tuple ( ('john', 'adams'), ) (note the comma .. something of an idiom .. parenthesis do not create the tuple but rather the comma) would be a tuple

Re: password_change - specify minimum password length

2009-05-22 Thread Skylar Saveland
> I'm using the built-in password_change view. Is there an easy way to > specify a minimum password length for the new password? (Other than > using javascript in the template) Well, you probably want your server-side to match whatever validation on the client-side and you want it to work

Re: Installing django

2009-05-22 Thread Skylar Saveland
> why follow their steps? just follow the steps in the django tutorial. +1, I say use VPS and learn unix. However, if we are talking webfaction you will have to go the web dashboard and click things. (yuck) and then you will have some sort of virtual environment that is unlike a VPS or your

Re: Installing django

2009-05-22 Thread Skylar Saveland
> I meant for webfaction - I use webfaction, but do not use their django set up > method. I set it up like I would set up django on my own box - using the > latest svn trunk and configuring apache. It certainly doesn't take 21 minutes. I seem to always jump in the middle of a thread and say

Re: Admin interface is slow

2009-05-20 Thread Skylar Saveland
Is this something having to do with pools? --~--~-~--~~~---~--~~ 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

Re: Django Training

2008-12-09 Thread Skylar Saveland
+1, Perhaps building a fully-working site using all parts of Django, implementing interesting and useful features. Also setting-up with reverse proxy/static server with lean, fast networking. Depends on how long the class is I suppose. On Tue, Dec 9, 2008 at 3:32 PM, Jane <[EMAIL PROTECTED]>