Re: Testing

2012-01-31 Thread Furbee
I think you can do something like: assertTrue(first == one_value or first == second_value) At the same time, when unit testing, you should really know exactly what a value returned from a method is. Furbee On Tue, Jan 31, 2012 at 4:32 PM, xino12 wrote: > Hello, I'm doing unitTesti

Re: create users from /etc/passwd?

2012-02-02 Thread Furbee
o require login for every page. I implemented something similar to this and it works perfectly.: http://onecreativeblog.com/post/59051248/django-login-required-middleware You're want to study up on how middleware works, here: https://docs.djangoproject.com/en/1.3/topics/http/middleware/ Go

Re: what is the best IDE to use for Python / Django

2012-02-15 Thread Furbee
Is this posting a zombie? It doesn't seem to ever die no matter what we do to kill it! :-) Furbee On Wed, Feb 15, 2012 at 10:09 AM, wrote: > ** > @Sanders, nice answer :D, SOL > +adesst > -- > *From: * Thorsten Sanders > *Sender: * django

Re: What is the best type of wood to use for staking vampires?

2012-02-15 Thread Furbee
Ha ha ha, that's funny! On Wed, Feb 15, 2012 at 12:44 PM, James Pyrich wrote: > On 2/15/12 1:28 PM, Dennis Lee Bieber wrote: > >> On Wed, 15 Feb 2012 11:45:51 -0800, Furbee >> wrote: >> >> Is this posting a zombie? It doesn't seem to ever die

Re: Where are the 2+ places user_id is defined?

2012-02-15 Thread Furbee
cause there is already a user profile with that user_id in the database. If you are currently developing, then the easiest thing to do is to drop the user profile table and let syncdb recreate it. Alternatively you could delete the unneeded user profiles in the shell. Furbee On Wed, Feb 15, 2012

Re: import problem

2012-02-15 Thread Furbee
Can you reply with the actual NameError Exception? Like: NameError: globalname 'datetime' is not defined, or whatever it is. From the module that is throwing this error are you importing anything else that is importing an overridden date method or datetime object? You can also try this (instead of

Re: import problem

2012-02-16 Thread Furbee
He said he would do that later tonight. Furbee On Thu, Feb 16, 2012 at 2:04 PM, Dennis Lee Bieber wrote: > On Thu, 16 Feb 2012 13:41:32 -0500, Scott Macri > wrote: > > >I don't believe I have any circular imports in my code. I have a > >simple file dosomethi

Re: import problem

2012-02-17 Thread Furbee
there was something with your environment that was using an old copy of the file without the import, because your syntax sounded perfect. Anyway, I'm glad you got it figured out! Furbee On Thu, Feb 16, 2012 at 6:33 PM, Dennis Lee Bieber wrote: > On Thu, 16 Feb 2012 21:00:40 -0500, Scott Macri &g

Re: Dumb newbie question

2012-02-17 Thread Furbee
, defs, constants, does not import anything from the module that you are importing into. Funny things happen, when you have circular imports, and when you are beginning out they can be hard to troubleshoot. Furbee On Fri, Feb 17, 2012 at 7:43 AM, Bob Carlson wrote: > I’m well into beginning build

Re: DATABASE in settings file not working

2012-02-17 Thread Furbee
That is strange. This probably won't help, but try deleting the settings.pyc file and then run python manage.py runserver again (without --settings=settings). Furbee On Fri, Feb 17, 2012 at 7:45 AM, Babatunde Akinyanmi wrote: > Yes I do get it. I didn't realize that while I was ty

Re: templates not updating when i change things please help

2012-02-19 Thread Furbee
browsing session to remove cache from the picture. In IE, go to File > New Session, or go to In Private browsing, in Chrome go new Incognito browser (Ctrl + Shift + N). That's been my experience, at least. Furbee On Sun, Feb 19, 2012 at 6:53 AM, Rich wrote: > Hi I am pretty new to d

Re: I am getting TypeError: coercing to Unicode: need string or buffer, long found. Please help.

2012-02-20 Thread Furbee
As an aside, I would assume you want your phone number field to be a string (models.CharField) instead of integer. Furbee On Mon, Feb 20, 2012 at 2:39 PM, Babatunde Akinyanmi wrote: > @Daniel > Your __unicode__ should always return a string so like Shawn said, > when you check your ph

Re: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-21 Thread Furbee
your models.py and settings.py files for any lines that are indented which are not supposed to be. Furbee On Tue, Feb 21, 2012 at 3:41 PM, Django_for_SB wrote: > Django Gurus, > > I'm an absolute beginner using Python in Django. I'm currently going > through the tutorial,

Re: Getting URL from within a template

2012-03-13 Thread Furbee
view'], 'event_type': request.GET['event_type'], 'filterValue': request.GET['_filterValue']}, context_instance=RequestContext(request)) >From the template, now, the different variables are available. {{ date_time }}, {{ submit_preview }}, {{ event_type }}, {{

Re: Getting URL from within a template

2012-03-13 Thread Furbee
luck, Furbee On Tue, Mar 13, 2012 at 11:57 AM, Larry Martell wrote: > On Tue, Mar 13, 2012 at 12:38 PM, Furbee wrote: > > I think you want to actually get these in the view code and pass them to > the > > template as named variables. For example: > > > > retur

Re: Getting URL from within a template

2012-03-13 Thread Furbee
get updated details. Cheers On Tue, Mar 13, 2012 at 2:23 PM, Larry Martell wrote: > On Tue, Mar 13, 2012 at 2:19 PM, Furbee wrote: > > Hi Larry, > > > > render_to_response is one of many ways to return an HttpResponse to send > to > > the client. Wherever your view

Re: Getting URL from within a template

2012-03-13 Thread Furbee
13, 2012 at 3:33 PM, Furbee wrote: > > Good deal, but if you send the page to the client, then jQuery updates > the > > URL, the {{ request.get_full_path }} is still only able to have the > original > > URL that was requested. Once the page is sent to the client, > Django

Re: Getting URL from within a template

2012-03-13 Thread Furbee
012 at 3:53 PM, Furbee wrote: > > Gotcha, I was unclear. You can have jQuery modify the URL without > actually > > requesting the page from the webserver, I thought that was what you > meant. > > This comes in handy when you want to use javascript to update the URL > >

Re: Getting URL from within a template

2012-03-13 Thread Furbee
Oh, you are filtering in the template, using Django, sorry. I thought you meant you pass it to the template and use jQuery to filter. My bad. :-) Cheers On Tue, Mar 13, 2012 at 3:25 PM, Furbee wrote: > Aha! Very nice. As a sidebar, you said you pass the filter string back to > the templ

Re: Getting URL from within a template

2012-03-14 Thread Furbee
Gotcha, you are filtering the QuerySet in Django, returning to client, and further filtering with jQuery. Makes sense now. :-) Happy Coding! Furbee On Wed, Mar 14, 2012 at 2:11 PM, Larry Martell wrote: > On Tue, Mar 13, 2012 at 4:26 PM, Furbee wrote: > > Oh, you are filtering in the

Re: where did I install Django

2012-03-20 Thread Furbee
>From an answer on stackoverflow.com ( http://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory ): Enter python shell by executing python binary: from distutils.sysconfig import get_python_lib print(get_python_lib()) It usually resides in

Re: Dajaxice is not defined!!! please heelpppp!! :(

2012-05-04 Thread Furbee
o see that there was an exception, instead of them thinking everything went through fine since it is input from their perspective correctly. Cheers, Furbee On Fri, May 4, 2012 at 8:48 AM, Tom Evans wrote: > On Fri, May 4, 2012 at 4:06 PM, doniyor > wrote: > > if i call the dajaxice.cor

Re: Middleware order

2012-05-15 Thread Furbee
I don't know, but the revision middleware smells like it could be the culprit. It is the last module in processing the request, and the first one processing the response back up the chain. Maybe it is returning the old data. Just a stab in the dark. Furbee On Tue, May 15, 2012 at 8:23 AM,

Re: Database Error at /admin/coltrane/entry/add/

2012-05-15 Thread Furbee
run python manage.py syncdb to have it recreated including this field. Furbee On Tue, May 15, 2012 at 8:57 AM, Gethin Llyn ab Alwyn wrote: > Hello all! > > I'm following James Bennett's book Practical Django Projects, and I've got > stuck at page 65 Chapter 4. On that page, ther

Re: Database Error at /admin/coltrane/entry/add/

2012-05-16 Thread Furbee
data. However, South will implement changes to table structure, and it is actually incredibly easy to set up! Happy Coding, Furbee On Wed, May 16, 2012 at 1:21 AM, Gethin Llyn ab Alwyn wrote: > Thank you for your answer, deleting the table and running manage.py syncdb > did the trick >

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Furbee
w the tutorials and documentation, especially Tutorial 1-4. This will get you on your way to installing and using Django via the web, and shell. Furbee On Tue, Aug 14, 2012 at 2:50 PM, Jirka Vejrazka wrote: > > right, I was being very brief in my description! > > But it is the followi

Re: Django + Ajax/Javascript

2011-11-02 Thread Furbee
You could pass the values from the view to the template and use javascript (I would suggest using jQuery) if there are only a few options. I would suggest using Dajax (dajaxproject.com) for your AJAX commands. It is really easy to plug into Django, and you should get familiar with it and the jQuery

Re: Onchange event on Choicefield in django formset

2011-11-02 Thread Furbee
I think your 'answer' is going to exist in POST in either case. Perhaps change the construct of your logic to: if 'evaluation' in request.POST: return render_to_response('results.html') elif 'form-0-answer' in request.POST: answer = request.POST.get('answer','') val

Re: Field available via Django shell but not via web application (crossposted from StackOverFlow)

2011-11-02 Thread Furbee
You said you are using django.contrib.auth.models.User as your User model, but that doesn't have a "foos" property. Can you share the models that you are using? Are you creating a subclass User that extends django.contrib.auth.models.User and adds foos and a ForeignKey? Is foos a ManyToManyField, O

Re: Calling Python from JavaScript

2011-11-02 Thread Furbee
You could call the Dajaxice method that gets the result (the one that fires when the drop down changes) with window.onload, or you could pass the initial values to the template via the view. For consistency and code reuse, I would personally use the first method, calling the Dajaxice function respo

Re: Formwizard - Many2Many field - instance needs to have a primary key value before a many-to-many relationship can be used

2011-11-02 Thread Furbee
In your Customer model there are fields which cannot be Null, so you cannot instance.save() before setting those properties. So, you may have to check for the category field in your loop and if it is category, save the instance first. Something like the following: views.py (in clients application)

Re: QuerySet: "if obj in queryset" can be very slow

2011-11-02 Thread Furbee
Thanks Tom, that's a great explanation! Furbeenator On Wed, Nov 2, 2011 at 10:46 AM, Tom Evans wrote: > On Wed, Nov 2, 2011 at 5:30 PM, Ian Clelland wrote: > > On Wed, Nov 2, 2011 at 8:25 AM, Thomas Guettler wrote: > >> > >> # This is my current solution > >> if get_special_objects().filter(p

Re: Formwizard - Many2Many field - instance needs to have a primary key value before a many-to-many relationship can be used

2011-11-02 Thread Furbee
those which have been already saved by Line 7 and add category. Then I > suppose Django will perform an "UPDATE" rather than an "INSERT" SQL > statement ? > > Is it right ? > > > Again, regards for the time spend to answer. > > Alain > > On 2 nov,

Re: Formwizard - Many2Many field - instance needs to have a primary key value before a many-to-many relationship can be used

2011-11-02 Thread Furbee
quot;instance.id == Non" and it seems to be > faster. > > To be sure. You mean that if a customer has 1 category, there will be > 2 database access (one for all informations except category and one > for category). > > If a customer has 50 categories, then it's 51 databa

Re: Relation not found error while dealing with foreign keys and forms

2011-11-02 Thread Furbee
Can you try this and tell us what you see: Run a shell using python manage.py shell >>> instance = Staff.objects.using('gold').get(username='tsamuel') >>> str(instance.query) This will tell us whether or not the database, reference, and such are correctly translating into a query. The error means

Re: Relation not found error while dealing with foreign keys and forms

2011-11-03 Thread Furbee
s this operational for your instance? If not, I would double check that the n_nics_groups table definitely exists in the datasource you defined as 'gold.' This should be defined in the DATABASES section of settings.py. It looks like it is the database 'public' from your

Re: Relation not found error while dealing with foreign keys and forms

2011-11-03 Thread Furbee
Hi Tabitha, I wish I could supply a quick and simple answer to fix what's going on in your database, but nothing obvious is standing out. Can you supply your model for StaffForm? That seems to be where the problem lies, since we can get details from the model and view elsewhere. Thanks, F

Re: Relation not found error while dealing with foreign keys and forms

2011-11-04 Thread Furbee
Oh no, that would not be a good thing to share! :-) That's a bummer that the upgrade broke things. So, the error is being raised on this line? staff_form = StaffForm(request.POST, instance=staffinstance).using('gold') Furbee On Fri, Nov 4, 2011 at 8:02 AM, Tabitha Samuel wrote

Re: Relation not found error while dealing with foreign keys and forms

2011-11-04 Thread Furbee
roups g ON(g.n_group_number = s.nics_group) WHERE s.username = 'tsamuel')) If that throws an error, we may have a problem in the DB layer. Thanks, Furbee On Fri, Nov 4, 2011 at 10:29 AM, Tabitha Samuel wrote: > The error that I'm getting is on the second form instantiation, tha

Re: Relation not found error while dealing with foreign keys and forms

2011-11-04 Thread Furbee
have other models that don't have corresponding tables created, syncdb would create those. Furbee On Fri, Nov 4, 2011 at 11:46 AM, Tabitha Samuel wrote: > Yep, n_nics_groups and n_test_staff exist in the same 'gold' > database. > > So when I tried: > form = StaffForm(i

Re: Relation not found error while dealing with foreign keys and forms

2011-11-04 Thread Furbee
kages/django/db/models/sql/compiler.py", line 680, in results_iter for rows in self.execute_sql(MULTI): File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql cursor.execute(sql, params) File "/usr/lib/python2.5/site-p

Re: Relation not found error while dealing with foreign keys and forms

2011-11-05 Thread Furbee
they would just be a goup, not FormFields. Hopefully that will get you through this jam, until a fix is created. I haven't written any patches before, but I will see if I can figure it out, time permitting. Thanks, Furbee On Fri, Nov 4, 2011 at 3:36 PM, Furbee wrote: > No worries. Wow

Re: [Django] #17167: ModelForm model=class not honoring reference fields with secondary database

2011-11-05 Thread Furbee
No, that is incorrect. The Foreign key does not cross database boundaries. The employee table is in the secondary database, and the department table is also in the secondary database. The foreign key from from the employee table to the department table, both in the same secondary database. Furbeen

Re: How do I define a default (override-able) primary key field on an abstract model?

2011-11-05 Thread Furbee
I can't speak to the reference field being used as a primary key, but the initial error is that you have multiple primary keys on the single model B. If it 'is-a' class Base, it inherits id as a primary key, and also defines a and a primary key. You cannot have multiple primary key fieds, hence "ta

Re: Relation not found error while dealing with foreign keys and forms

2011-11-07 Thread Furbee
referential objects. There are not arguments I can find to forcefully tell ModelForm to use a non-default database. So, it may be that Database Routers are the only way you can get ModelForm to look for NICSGroupType in the database 'gold.' Furbee On Sun, Nov 6, 2011 at 3:04 PM, Tabitha Sa

Re: ImportError: No module named django

2011-11-18 Thread Furbee
go to that location and enter "python setup.py install". This should install the Django framework into the Python site-packages folder, and the "import django" should work from a python shell. Cheers, Furbee On Fri, Nov 18, 2011 at 12:14 PM, Jenny wrote: > I am as newbie

Re: syncdb not finding and syncing my MySQL database

2011-11-21 Thread Furbee
Yes, please offer more details. One thing I noticed off the bat, though, was that you said you are running "python manage.py syncdb" from the directory where your models.py is. The manage.py file is at the root of your project, not in the apps folder(s) where models.py is. Furbee On M

Re: Problem with Django and AJAX: Empty responsetext

2011-11-21 Thread Furbee
hough it seemed like a bug, but it has been too long and I can't remember exactly what the problem was. Keep me posted. Furbee On Mon, Nov 21, 2011 at 1:10 PM, Schmidtchen Schleicher < spiolli...@googlemail.com> wrote: > I'm trying to do a simple google-suggest like thing with dja

Re: Can't figure out this Object Model error...

2011-12-05 Thread Furbee
Don't mean to sound remedial, but have you verified that the table bookmarks_eda_appcatalog exists and that it has a column named eda_app_id? Did you use manage.py syncdb to create the tables? Furbee On Mon, Dec 5, 2011 at 4:24 PM, Marc Edwards wrote: > I am receiving the following er

Re: Can't figure out this Object Model error...

2011-12-05 Thread Furbee
That is what I sort of assumed. You created the table with syncdb, changed the models.py for it and ran syncdb, which does nothing if the table already exists. On Mon, Dec 5, 2011 at 5:04 PM, Reinout van Rees wrote: > On 06-12-11 01:24, Marc Edwards wrote: > >> DatabaseError at/admin/bookmarks/e

Re: 404 only in Chrome

2011-12-09 Thread Furbee
lio/?my_hax_rock, etc. See if that helps. Furbee On Fri, Dec 9, 2011 at 5:33 PM, neridaj wrote: > Hello, > > For some reason I'm getting a 404 in google chrome when I visit / > portfolio/. The url entered is /portfolio/ but it returns as a 404 at / > portfolio/undefined/ in t

Re: How to change the representation of newline?

2011-12-13 Thread Furbee
/ascii-value-of-a-character-in-python. You can use ord() and chr() to switch carriage return/line feeds using the ascii ordinal representation and back if you need to. Furbee 2011/12/13 Tom Evans > 2011/12/13 Germán : > > Has anybody solved this issue? > > > > On Dec 14 20

Re: Can a template extend a template?

2011-12-13 Thread Furbee
Brilliant! I wasn't looking an answer to this question, and wasn't all that aware of how these interacted, but it will sure come in handy. Thanks for the extremely clear, concise explanation. I don't think the Django docs make it quite that clear. Furbee On Tue, Dec 13, 2011 at 3

Re: Successful login to go back to the page login was initiated from

2011-12-16 Thread Furbee
Thanks for sharing the answer, I was sort of wanting to figure this out long term, just haven't gotten to it, yet. Furbee On Fri, Dec 16, 2011 at 4:33 PM, bazaarsoft wrote: > Never mind, found the answer: > > http://efreedom.com/Question/1-806835/Django-Redirect-Previous-Pag

Re: no plus-sign to add related object in admin

2011-12-29 Thread Furbee
Just taking a stab in the dark, are the ones without the + sign editable in the Admin? If they are not editable, I would imagine Django would not show the + in the Admin. Furbee On Thu, Dec 29, 2011 at 12:58 PM, K.C. Smith wrote: > I've got a project where when I pull up the admin pag

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

2012-01-12 Thread Furbee
. I'm not sure this would work for you, but it might be an alternative, although it violates the DRY principle. Furbee On Thu, Jan 12, 2012 at 9:20 AM, Jeff wrote: > > On Jan 11, 9:23 pm, Dennis Lee Bieber wrote: > > On Wed, 11 Jan 2012 17:26:44 +, Tom Evans > > wrot

Re: Can you people explain why the def _str_() method is used below?

2018-01-09 Thread Furbee
Who you call "you people?" Just kidding. On Tue, Jan 9, 2018 at 11:27 AM, wrote: > Thanks alot James and Projec.Your posts were very helpful to me. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-02 Thread Furbee
generated and how long it took to get a response from your DB. You can also write raw SQL, if you can make one more efficiently. Furbee On Fri, Feb 2, 2018 at 10:56 AM, Vijay Khemlani wrote: > "with large of records in A and B, the above takes lot of time" > > How long? At f

Re: Optimal query for related names in onetomany or manytomany using Django Queryset

2018-02-03 Thread Furbee
You can set up an index on multiple field, as well, so if you’re searching for As without a reference from B or C, using the index_together operative in the class Meta for that model. I’m not completely sure, but I think this may speed up you query time. Thanks, Furbee On Saturday, February 3

Re: Speficy a Database for Testing

2012-02-08 Thread Mark Furbee
Denis Darii already answered this on February 1st: "You can redefine your database connection by adding somewhere at the end of your settings.py something like: import sys if 'test' in sys.argv: DATABASES = ... hope this helps." Did you try this? On Wed, Feb 8, 2012 at 7:19 AM, xina tow

Re: Speficy a Database for Testing

2012-02-08 Thread Mark Furbee
, but django makes a new testDatabase and that's my problem, I want > django to use a database I've previously done. > > > On 8 February 2012 16:34, Mark Furbee wrote: > >> Denis Darii already answered this on February 1st: >> >> "You can redefine

Re: Set of choices of which several can be chosen without using a ManyToManyField

2011-11-02 Thread Mark Furbee
As alluded to previously, the most "straightforward way to use a set of choices of which several can be chosen" IS to use a ManyToManyField. The syntax is slightly different, but ManyToManyFields are really easy to use with Django. Do not reinvent the wheel in this case. Thanks, Mark F

Re: Relation not found error while dealing with foreign keys and forms

2011-11-04 Thread Mark Furbee
page that you've tried this on, or have you just tried it in the shell? Thanks, Furbee On Fri, Nov 4, 2011 at 7:02 AM, Tabitha Samuel wrote: > Here is staff/models.py > > from django.db import models > > class NICSGroupType(models.Model): >n_group_number = models.I

Re: Having Headache With LoginForm

2012-01-17 Thread Mark Furbee
It means, don't use the "decorator" @login_required above your login view. Your login view cannot require a login, because you'd never get to log in. Chicken and egg. On Tue, Jan 17, 2012 at 2:34 PM, coded kid wrote: > > > Thorsten Sanders wrote: > > With using > > > > @login_required decorator

Re: Having Headache With LoginForm

2012-01-18 Thread Mark Furbee
working! Any help? > > On Jan 17, 10:37 pm, Mark Furbee wrote: > > It means, don't use the "decorator" @login_required above your login > view. > > Your login view cannot require a login, because you'd never get to log > in. > > Chicken and egg.

Re: Having Headache With LoginForm

2012-01-18 Thread Mark Furbee
gged out successfully.'}, context_instance=RequestContext(request)) template login.htm: . . . {% csrf_token %} Login {% if error %} {% FatalImage %} {{ error }} {% endif %} {% if warning %} {% WarnImage %} {{ warning }} {% endif %} {% if notice %} {% NoticeImage %} {{

Re: Having Headache With LoginForm

2012-01-19 Thread Mark Furbee
slashes, change the ? with *, like `url(r'^login/*', 'views.Login')`. Again, that's not tested, but it should work, I think. Happy Coding! Mark On Wed, Jan 18, 2012 at 6:09 PM, coded kid wrote: > Thanks bro. Don't you think I should import Login in urls.py? What >

Re: can someone rewrite this line please

2013-02-20 Thread Mark Furbee
Not sure if you need the json.large to be compiled or if that should be part of the string. The biggest issue was you had a single-quote before onmouseover. After that, you have to escape the single-quote before \',LEFT, true, OFFSETY, -250, OFFSETX, 0, WIDTH, 800)\" target=\"_blank\">'; FYI: if y

Re: can someone rewrite this line please

2013-02-21 Thread Mark Furbee
No worries, Mike. Any time! On Thu, Feb 21, 2013 at 3:17 AM, MikeKJ wrote: > Thank you Mark spot on! > > Really appreciate it > > > > > > On Wednesday, February 20, 2013 3:58:28 PM UTC, Mark wrote: > >> Not sure if you need the json.large to be compiled or if that should be >> part of the strin

Re: Saving browser output as pdf

2013-02-24 Thread Mark Furbee
Mike DeWitt's answer is most appropriate. In you view define an argument 'pdf=False' and when returning the response from uou view, if pdf is False, return regular HttpResponse. If pdf is True, follw @Mike's reply to set response Content type to PDF. It is really easy to return what would be an htm

Re: Saving browser output as pdf

2013-02-24 Thread Mark Furbee
Django docs (pretty turse): https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ >From ReportLab site: http://www.reportlab.com/software/documentation/ Here's a decent quick tutorial: http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/ Note that what you

Re: ANNOUNCE: Django 1.5 released

2013-02-26 Thread Mark Furbee
Woo-hoo! Awesome news. We really appreciate all the hard work you guys have been doing getting this version out. Thanks a million! Mark On Tue, Feb 26, 2013 at 11:44 AM, James Bennett wrote: > Yup, it's finally here! > > * Announcement blog post here: > https://www.djangoproject.com/weblog/201

Re: 'url' template tag throws and error after upgrading to 1.4

2013-04-04 Thread Mark Furbee
It would appear to me that your missing the path to django in your environment. When you upgraded did you also upgrade to another version of Python, perhaps? Is the dist-packages/site-packages django folder in the same place it was? On Thu, Apr 4, 2013 at 3:58 PM, Bastian wrote: > I have tried

Re: 'url' template tag throws and error after upgrading to 1.4

2013-04-04 Thread Mark Furbee
Can you run manage.py shell and connect to 'views?' On Thu, Apr 4, 2013 at 4:13 PM, Mark Furbee wrote: > It would appear to me that your missing the path to django in your > environment. When you upgraded did you also upgrade to another version of > Python, perhaps? Is the

Re: I really about to give up Django

2013-08-22 Thread Mark Furbee
Try dropping the .value from referencia. Like {{ form.instance.idproduto.idmercadoria.referencia }}. Does this work? On Thu, Aug 22, 2013 at 9:35 AM, Fellipe Henrique wrote: > I tried again.. and work if I have just 1 FK, if I have more then one, > doesn't work, like this: > > I have this models

Re: I really about to give up Django

2013-08-22 Thread Mark Furbee
Are your "nome" and "idade" fields displaying? If so, {{ form.instance.brinq.descricao }} should display the descricao field of the brinq object associated with that Filhos instance bound to the form in the formset. On Thu, Aug 22, 2013 at 9:24 AM, Fellipe Henrique wrote: > Ok, I read that, but

Re: I really about to give up Django

2013-08-23 Thread Mark Furbee
Are you sure the idmercadoria is not None on that idproduto record? {{ form.instance.idproduto.**idmercadoria }} Does this display anything? How about {{ form.instance.idproduto }}? If these don't display, verify the records in your database. In Django templates, if something is None or does not

Re: I really about to give up Django

2013-08-23 Thread Mark Furbee
I see. I don't understand how this works: {{ itens.instance.idproduto.codigobarra }} when this doesn't: {{ itens.instance.idproduto.idmercadoria.referencia }} Can you post your template code? On Fri, Aug 23, 2013 at 10:13 AM, Fellipe Henrique wrote: > form.instance is "Pedido" model, not "It

Re: How to check if user is already in user database?

2015-01-16 Thread Mark Furbee
Yes, that link will cover the basics... Here's a couple ways to find out if a query returns any records: User.objects.filter(username=username).exists() # .exists() returns boolean if records are found. User.objects.filter(username=username).count() != 0 # .count() returns number of rec

Re: How to check if user is already in user database?

2015-01-16 Thread Mark Furbee
Also, you can do a try/catch, but I don't really like this method, personally: try: User.objects.get(username=username) except User.DoesNotExist: # user didn't exist in database. On Fri, Jan 16, 2015 at 9:16 AM, Mark Furbee wrote: > Yes, that link will cov

Re: ANN: Django website redesign launched

2014-12-16 Thread Mark Furbee
Looks slick to me! Clearly with mobile and responsive design in mind, but that's what we have to keep in mind these days. Great job to all contributors involved in this redesign! On Tue, Dec 16, 2014 at 4:01 PM, Cal Leeming wrote: > > Personally I really like it. > > The footer menu contrast is

Re: (1364, "Field 'id' doesn't have a default value") - mysql issue?

2014-04-09 Thread Mark Furbee
You say you imported the database. Did you use syncdb to set up the tables? It sounds like your comment_id field in MySQL is not set as an auto-incrementing primary key field. Do you have access to that MySQL database to check, and or update that field definition? On Wed, Apr 9, 2014 at 2:42 PM,