Use model of non-installed app

2009-02-21 Thread TiNo
this a bug? Thanks, Tino --~--~-~--~~~---~--~~ 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 dj

Re: Use model of non-installed app

2009-02-21 Thread TiNo
On Sat, Feb 21, 2009 at 16:04, Alex Gaynor <alex.gay...@gmail.com> wrote: > > > On Sat, Feb 21, 2009 at 7:50 AM, TiNo <tin...@gmail.com> wrote: > >> >> Hi, >> >> I am trying to use a model from an app that is on my python path, but >> not in

Adding an already uploaded image to ImageFileField

2009-02-21 Thread TiNo
, 'f.image.save' takes quite some time. Why is this? The file is not resaved, at least as far as I can see from the 'date last modified'. Is there a quicker way to do this? Thanks, TiNo --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Custom ModelChoiceField muddle

2008-10-01 Thread TiNo
has js turned off, it still works like a dropdown. TiNo On Tue, Sep 30, 2008 at 6:00 PM, Donn <[EMAIL PROTECTED]> wrote: > > Perhaps if I ask it in a different way: > 1. A 'book' has a title (string) and an author (foreign key). > 2. I use a ModelForm from the model. > 3. I w

Re: Json Serialization / Form Validation error

2008-10-18 Thread TiNo
Could you try this with simplejson not bundled with Django? If that works this is probably a bug in the version bundled with Django. On Sat, Oct 18, 2008 at 6:58 PM, justind <[EMAIL PROTECTED]> wrote: > > Hello, > > No one has any ideas? > > The code I'm actually using in my view is almost

Re: save_model and how to ignore any changes to an object

2008-10-19 Thread TiNo
In django admin, there is a save_as option. see http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-as You could also save revisions of objects. Check: http://code.djangoproject.com/wiki/FullHistory http://code.google.com/p/django-reversion/ http://code.google.com/p/django-history/

Re: Editing ForeignKey relations from parent

2008-10-20 Thread TiNo
Something that is in a different direction, but might do the trick:check out http://code.google.com/p/django-batchadmin/ You could select multiple "children" and create an "add to parent..." action for it. Hope it helps, TiNo On Mon, Oct 20, 2008 at 8:45 PM, endi <[

Re: second post:Please answer!How to compare from two models in the same function (view)?

2008-10-22 Thread TiNo
something like this? (don't now if you want the form from an instance or not, but assumed so, as you are trying to change data, not?) def comp(request, obj_id): instance = get_object_or_404(Model, obj_id) form = ItemForm(instance=instance) if request.method=="POST": form =

Re: Breaking up models into smaller files

2008-10-25 Thread TiNo
as before, and syncdb should be able to find them as well. TiNo On Sat, Oct 25, 2008 at 11:35 AM, Low Kian Seong <[EMAIL PROTECTED]>wrote: > > I am trying to build an app in django which has a few components: > > 1. Stocks > 2. Customers and > 3. Sales > > I notice

Re: How to send emails when after an event happened?

2008-10-25 Thread TiNo
not something that should happen when a page is viewed, it is someting that should happen at a certain point in time. So it looks like a cronjob should do the trick. Create a script that sents emails for all expired products, and create a cron-job that runs this script da

Re: Manager to add entries where there is a ManyToMany relationship

2008-10-26 Thread TiNo
do this at the same time with creating a Quote, put the two modelforms on the same page with a prefix added. (see http://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms). Then in your view you can first save the Quote, and then create the relationship with its

Re: previewing a form - best way?

2008-11-02 Thread TiNo
http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-preview/ ?? On Sun, Nov 2, 2008 at 6:54 AM, Flavio <[EMAIL PROTECTED]> wrote: > > Hi there. > > Following scenario: > > I have a model that contains several options about the layout of a > page, for example background-image and

Re: An interesting URL dispatcher problem

2008-11-04 Thread TiNo
ter'), >(r'^(?P\w+)/(?P\w+/$', 'filter'), > ) > you are missing a closing ) on the last line: (r'^(?P\w+)/(?P\w+*)*/$', 'filter'), Tino --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&q

Re: saving multiple versions of an uploaded image

2008-11-05 Thread TiNo
Or take a look at photologue. Does all this for you. http://code.google.com/p/django-photologue/ On Wed, Nov 5, 2008 at 9:02 AM, David Christiansen <[EMAIL PROTECTED]> wrote: > > It's also worth looking into the sorl.thumbnail library. This has an > ImageWithThumbnailField that does this work

Re: Best practice

2008-11-06 Thread TiNo
> > class Profile(models.Model): >name = models.CharField() >foo = models.PositiveIntegerField(blank=True, default=0) > > class RegistrationForm(forms.Form): >name = forms.CharField() >foo = forms.IntegerField(min_value=0, max_value=55, > required=False) > > a) If your form is

Re: Problem logging in to admin using Safari

2008-06-23 Thread TiNo
> Looks like your browser isn't configured to accept cookies. Please > enable cookies, reload this page, and try again. > Well, are cookies enabled in Safari? (Prefs > Security > accept cookies)... --~--~-~--~~~---~--~~ You received this message because you are

Re: Validation Problem with ModelChoiceField

2008-06-27 Thread TiNo
Looking at the source, ModelChoiceField validates the given id against the initial queryset, where you provided an empty one. "models.Gallery.objects.none()" So no id's validate. I think changing none() to all() should make it work. TiNo On Jun 26, 9:01 pm, mwebs <[EMAIL PROT

Re: User Filtering

2008-06-27 Thread TiNo
You could have the autocomplete opperate on a dummy_seat input, and have the js fill in the correct user id in a hidden 'seat' field on blur. Maybe even nicer, a selectbox containing all users, and an input that pops up on focus to filter. That way the form degrades nicely when js is turned off.

Re: User Filtering

2008-06-28 Thread TiNo
You could take a look at jQuery (http://jquery.com/), and for example this jQuery plugin: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ On Jun 27, 3:36 pm, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > TiNo wrote: > > Maybe even nicer, a selectbox containin

override label_tag?

2008-06-29 Thread TiNo
Hi, Is there an easy way to override a form.field's label_tag method? So I can have it add a class 'required' when form.field.required is True, like it's done for the admin forms, but without the need of creating fieldsets and fieldlines? later, TiNo

Re: Inputting Date/Time in a Django Form

2008-06-29 Thread TiNo
add: to your template, use SplitDateTimeField and pass the fields: attrs={'class':'vDateField'} That way you have the same date and time input as the admin interface. TiNo On Sun, Jun 29, 2008 at 10:46 PM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > > Hi Folks, > > W

Re: Make changes to model...

2008-07-02 Thread TiNo
You can use the output of "python manage.py sql myapp" to see what the sql ought to be and compare it with the curent state. On 7/2/08, Oscar Carlsson <[EMAIL PROTECTED]> wrote: > > Unless you use django-evolution ( > http://code.google.com/p/django-evolution/ , which I don't know much > about)

Re: Re: Inputting Date/Time in a Django Form

2008-07-02 Thread TiNo
rote: > > Sorry, I don't understand where I have to put the attrs bit. > > Can you give me an example? > > delivery_datetime = forms.SplitDateTimeField(attrs={'class':'vDateField'}) > doesn't work, is that what you meant? > > Thanks, > > Ti

Re: Inputting Date/Time in a Django Form

2008-07-02 Thread TiNo
on_datetime_1" type="text" class="vDateField required" > name="collection_datetime_1" /> > > in my html. > > Any ideas? > > Cheers, > > Tim. > > On Wednesday 02 Jul 2008, TiNo wrote: > > Sorry, I was a little too quick. I used

Re: Inputting Date/Time in a Django Form

2008-07-03 Thread TiNo
a little hacky... TiNo On 7/2/08, Tim Sawyer <[EMAIL PROTECTED]> wrote: > > > Sorry, still not working. I get: > > __init__() got an unexpected keyword argument 'widgets' > > Is that because widgets isn't a parameter to __init__ ? (I'm still getting > to > gri

Re: Make changes to model...

2008-07-03 Thread TiNo
The Meta class is to change the Model name, but Chris wants to change the app name, not?I don't think you can do that. On Thu, Jul 3, 2008 at 2:53 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Wed, 2008-07-02 at 11:49 -0700, [EMAIL PROTECTED] wrote: > > Thanks guys. I know how to do

Re: Discard an uploaded image when returning a form with errors

2008-07-03 Thread TiNo
If the image verifies, and is on your server already, why not resize it? :D On Thu, Jul 3, 2008 at 11:49 PM, Berco Beute <[EMAIL PROTECTED]> wrote: > > To answer my own question, I now moved the validation code to the form > and create a PIL image using >

Re: clean_* method for ModelForms?

2008-07-06 Thread TiNo
You don't have to do the commit=False thing. You can check if author is present in the clean() method, that will always be called. On Sun, Jul 6, 2008 at 10:44 PM, Rob Hudson <[EMAIL PROTECTED]> wrote: > > So if I understand correctly, you are saying make author a > not-required field so

Re: NEED HELP BADLY

2008-07-17 Thread TiNo
How about:http://www.djangoproject.com/documentation/tutorial03/ On Fri, Jul 18, 2008 at 4:53 AM, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Is this the best way to organize the files in Django? > > Not important, it's personal taste. > > Also in a web cart scenario where is the best area to

Re: Write Caching

2008-08-25 Thread TiNo
Maybe this could be a solution: http://www.stardata.it/articoli_en/triggers_on_select_articoli_en.html No idea how much overhead that would create though. On Sun, Aug 24, 2008 at 5:43 AM, Steve Potter <[EMAIL PROTECTED]>wrote: > > I am working on a project that involves logging every time an

Re: ModelForm, images and exclude

2008-08-31 Thread TiNo
>self.views = 0 >self.updated = datetime.datetime.today() >self.thumbnail = create_thumbnail(self.image, THUMB_WIDTH, > THUMB_HEIGHT) > super(Media, self).save() > Don't think it will solve your problem, some tips though. TiNo --~--~-~--~~--

Re: Adding Relation Without Saving

2008-08-31 Thread TiNo
You probably have a list of products somewhere, right? (from a form or other input). Couldn't you just do sum([p.price for p in products]) where products is that list?? On Fri, Aug 29, 2008 at 9:08 PM, Koen Bok <[EMAIL PROTECTED]> wrote: > > I'd like to build relations with objects without

Re: ModelForm, images and exclude

2008-09-02 Thread TiNo
but does clean the code up a bit. Thanks for your help. > > From the error it looks like a related field doesn't exist but I can't > tell what field it's complaining about. Usually the error messages are > helpful, this time, not so much. > -Chris > > On Aug 31, 12:37 pm, Ti

Re: ModelForm, images and exclude

2008-09-03 Thread TiNo
Set .pet and .type null=True, save with commit=True, add the values, and save again? also see http://www.djangoproject.com/documentation/modelforms/#the-save-method on save_m2m after commit=False. And default does not work indeed, 'initial' does however; you pass it when creating the form

Re: ModelForm, images and exclude

2008-09-03 Thread TiNo
ve it mostly working, I > just have to add a few validation checks and such. When I'm done I'll > post me snippets here in case anyone else has the same problem. Of > course, I'm open to any alternatives. I may try the initial keyword, I > somehow couldn't find it in all the docum

Re: how to use "if element in List" from a template?

2008-09-03 Thread TiNo
{% load my_utils %} should work On Wed, Sep 3, 2008 at 11:46 AM, joune <[EMAIL PROTECTED]> wrote: > > Thanks Daniel.. > > Sorry i'm a bit slow (i do this in my spare time) > > I tried what you said, and refered to the doc at > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ for

Re: How to retrieve forgotten password of django admin user

2008-09-10 Thread TiNo
Read this about modifiing the admin templates: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates On Wed, Sep 10, 2008 at 3:02 PM, Chaitu <[EMAIL PROTECTED]>wrote: > > I want to modified the django admin login page. In this page I also > wants to display option

Re: image upload with model form

2008-09-10 Thread TiNo
Inline -> On Wed, Sep 10, 2008 at 3:11 PM, Kwan Hong Lee <[EMAIL PROTECTED]> wrote: > Hello, > > Does anybody have a sample code that has a imagefield and upload working > through model form that you could share? > > I get weird error > > Exception Type: ValueError Exception Value: > > The view

Re: How to retrieve forgotten password of django admin user

2008-09-10 Thread TiNo
On Wed, Sep 10, 2008 at 3:14 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > > Chaitu wrote: > > I want to modified the django admin login page. In this page I also > > wants to display option for retrieve the forgotten password of admin > > user. But I am not able to find solution for this. > >

Re: Uploading JPEG image problem

2008-09-11 Thread TiNo
In your PIL installation, you need to tell PIL where to find the JPEG decoder (which you probably need to install first) Read http://mail.python.org/pipermail/image-sig/2002-August/001947.html for example or google for "mac os x jpeg pil" On Thu, Sep 11, 2008 at 4:21 AM, Rodney Topor <[EMAIL

Re: Customized ManyToMany in Admin

2008-09-12 Thread TiNo
Probably more like: def __unicode__(self): return u'%s | %s' % (self.title, self.language.name) because self.language is the language object, not the name (or title) string. On Fri, Sep 12, 2008 at 7:32 PM, phred78 <[EMAIL PROTECTED]> wrote: > > Oh, I see! > You mean something like > > def

Re: Customized ManyToMany in Admin

2008-09-12 Thread TiNo
, to go > fetch the language object to get the language name. > > so for extra credit, where do we add a select_related() for the > widget ? > > > > On Sep 12, 7:43 pm, TiNo <[EMAIL PROTECTED]> wrote: > > Probably more like: > > def __unicode__(self): &g

Re: Map API's and Django, preferences?

2008-09-13 Thread TiNo
that should help you in the right direction: http://www.developer.com/java/web/article.php/10935_3528381 http://ajaxian.com/archives/geocoding-with-googles-maps-api http://www.instantdjango.com/chapter1.html Good luck, and please backpost when you build a cool app! TiNo On Sat, Sep 13, 2008 at 3:02 AM

Re: PDF in Django (not via reportlab)

2008-09-15 Thread TiNo
google: html pdf python:http://www.htmltopdf.org/ non-commercial use is free. On Mon, Sep 15, 2008 at 2:06 PM, Vinay Sajip <[EMAIL PROTECTED]>wrote: > > > > On Sep 15, 12:53 pm, Bobo <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > > I'm looking for a smart and simple way to create a PDF

Re: Ordering in with Many-to-Many Relationships

2008-09-17 Thread TiNo
If I understand you correctly, you (for example) have a quicktime1, in reel1 and reel2. In reel1 it is the first of, says 5 quicktimes, and in reel2 it is the third of 4? The best solution that appears to me is an extra column in the intermediary table. See:

Re: Signals, sites and instances

2009-03-19 Thread TiNo
You could do this in the save method. If the News_item is newly created, it's id will not be set, so to assure it only happens on creation, you could use this code: if self.id is None: do your stuff... Tino On Thu, Mar 19, 2009 at 6:19 PM, Baxter <mail.bax...@gmail.com> wrote: >

Re: How to create ability to send email from the admin with django?

2009-04-03 Thread TiNo
I just recently wrote this, so here is (snippets of) my code [2]. The send_mail method does exactly as it says, it sends mail with subject, message, from, to some recepients. TiNo [1] http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#ref-contrib-admin-actions [2] http://d

Re: Merging apps

2009-04-07 Thread TiNo
jangoproject.com/wiki/MultipleDatabaseSupport TiNo <http://code.djangoproject.com/wiki/MultipleDatabaseSupport> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: How to widen the text fields in the admin pages for editing records

2009-04-07 Thread TiNo
ts/#django.forms > > Thanks. I can see how that works if I'm creating my own forms, but > how would I go about modifying the widgets for the forms that ship > with the built-in admin application? You can override the ModelAdmin.form attribute to provid

Re: Use Python to parse HTML and integrating said script into Django

2009-04-13 Thread TiNo
ULE in your script [2]) [1] http://en.wikipedia.org/wiki/Cron [2] http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ TiNo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&quo

Re: How can I get the user ID of the currently logged-in user?

2009-04-25 Thread TiNo
You can find the user object in the request: http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.user So request.user.id will give you the userid of the currently loggedin user. Tino On Sat, Apr 25, 2009 at 4:44 PM, Daniel Strasser <webdeveloper@gmail.

Re: How to list_filter by a foreign key field not returned by the model's __unicode__?

2009-04-25 Thread TiNo
On Sat, Apr 25, 2009 at 10:34 PM, kspr <pacr...@gmail.com> wrote: > # This is what I want: (admin.py) > class DoctorAdmin(admin.ModelAdmin): >list_filter = ['origin.country'] > shouldn't it be: list_filter = ['origi

Re: login decorator losing POST data

2009-05-14 Thread TiNo
filling out the form? That eliminates all the issues with redirecting the POST data. TiNo --~--~-~--~~~---~--~~ 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@googl

Re: Query by date + offset

2009-05-14 Thread TiNo
ject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model Maybe this works (untested): Offering.objects.filter(date__lt=datetime.today() + F('duration')) TiNo > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Implementing A/B Testing in Django

2009-05-17 Thread TiNo
> > Does anyone have any other ideas or suggestions about how to > dynamically show templates to users in a pluggable way while at the > same time measuring what template the user sees? > It's not about doing it in Django, but you know that Google Website Optimizer does this, and provides you out

Re: Theory - where & how to handle common functions & views

2009-05-18 Thread TiNo
it? You can than probably have several templates that extend the base template (with all your etc.) and have them all use just one block, content for example, from your base template. Tino --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Theory - where & how to handle common functions & views

2009-05-18 Thread TiNo
bsite language - which language is > visitor seeing and login info and such stuff. Basically it has to read > stuff from session data and to write some to it. > Thing that have to happen on (almost) every request, should usually be done in Middleware[1]. Tino [1] http://d

Re: Newbie - record parent ID in child data entered by ModelForm

2009-06-05 Thread TiNo
On Fri, Jun 5, 2009 at 11:04, adelaide_mike wrote: > Exception Value: 'PropertyForm' object does not support item > assignment > There you go. You can't do: > form['street']=request.session['street_id'] You can save the form instance first, without commiting,

Re: Change AuthenticationForm error message

2009-06-15 Thread TiNo
ith this is django test > fail when I do this. I was wondering was is the best practice when it comes > to this. > You could subclass AuthenticationForm, override the clean method, and use it in your own custom login view. That is probably the easiest. TiNo --~--~-~--~~--

Re: Abstract models and 'blank' (etc.) constraints

2009-06-17 Thread TiNo
You can acces a models field through Model._meta.fields. You can probably loop through these fields in your Model's __init__ method, and change their blank attribute to false. TiNo On Wed, Jun 17, 2009 at 13:32, Richard Colley <richard.col...@gmail.com>wrote: > > Ok, after loo

Re: Abstract models and 'blank' (etc.) constraints

2009-06-17 Thread TiNo
On Wed, Jun 17, 2009 at 14:42, Richard Colley <richard.col...@gmail.com>wrote: > > Thanks TiNo, > > Are there any caveats with this? e.g. to make syncdb etc. work > correctly? I don't know, as I never tried, and I am not very experienced with messing with the inner meta

Re: Installation error

2009-06-20 Thread TiNo
re the system will check for commands or programs. PYTHONPATH: (check with echo $PYTHONPATH): these are directories where python will look when you try to import other python files. So you want django to be on your pythonpath, otherwise you won't be able

Re: dynamic settings through script

2009-07-01 Thread TiNo
Wouldn't it be easier to create a 'lock-file'? Have your middelware check for the lock file, if it's present, block access, if not, do nothing. This is at least how some programs do their locks (Adobe Creative suite for example) and quite easy to implement. Tino On Wed, Jul 1, 2009 at 16:34

Re: Display Data From Multiple Tables

2009-07-01 Thread TiNo
On Wed, Jul 1, 2009 at 16:59, The Danny Bos wrote: > > Hi there, > > Seems easy, but I'm having an ass of a time. I think once I wrap my > head around how to do this, I'll be rolling through Django like it's > building sprites on a Commodore 64. > > So, I have four tables.

Re: Display Data From Multiple Tables

2009-07-02 Thread TiNo
> > TINo, no errors at all, it just doesn't display. Wat doesn't display? The publisher name? The authors? > > Agreed it is a ManyToMany type. Am thinking perhaps a ForeignKey type > may work just fine. Any reason you guys can think of that an Author > field should be a Many

Re: Display Data From Multiple Tables

2009-07-02 Thread TiNo
-toolbar/tree/master > On Jul 2, 10:22 pm, Alex Robbins <alexander.j.robb...@gmail.com> > wrote: > > You should take a look at select_related[1]. It will take the lot of > > queries TiNo was talking about and flatten it down to one big one. > However, sel

Re: Foreign Keys

2009-07-21 Thread TiNo
On Mon, Jul 20, 2009 at 23:24, AKK wrote: > > Hello, i currently have two classes in my model: > > class Post(models.Model): >prepopulated_fields = {"post_slug": ("post_title",)} > >post_title = models.CharField(max_length=750) >post_slug =

Use an arbitrary changelist

2009-07-22 Thread TiNo
, TiNo --~--~-~--~~~---~--~~ 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-user

Re: Use an arbitrary changelist

2009-07-28 Thread TiNo
On Wed, Jul 22, 2009 at 17:57, Alex Gaynor <alex.gay...@gmail.com> wrote: > > On Wed, Jul 22, 2009 at 7:08 AM, TiNo<tin...@gmail.com> wrote: > > Hi, > > I would like a second changelist for an app. Besides the changelist that > > shows all members, I would li

Image handling - Custom image field?

2009-08-01 Thread TiNo
would I have to override to do this? - What would be the best way to start a separate python script? And is there any way to communicate between de fastcgi script and the import script? Say pass that we are at image 25 of 100? Thanks, TiNo --~--~-~--~~~---~--~~ You

Re: Image handling - Custom image field?

2009-08-12 Thread TiNo
On Mon, Aug 3, 2009 at 12:53, Peter Bengtsson wrote: > > I would write a management command and let a cron job fire off to run > it. > See this for how to write management commands: > http://docs.djangoproject.com/en/dev/howto/custom-management-commands/ > > Then your cron job

Re: Theory: Models/Apps

2009-08-14 Thread TiNo
comment.py | - urls.py | - ... | - anotherapp.. Then you can import your models as: from app.models.post import Post or you can import them in you __init__ file and import them as normal # __init__.py from post import Post from comment import Comment # somewhere else: from app.models import Post

Re: how much python do i need to know to learn/use Django?

2009-08-14 Thread TiNo
king distinction between Django functions and methods and built-in Python stuff. But it shouldn't be to hard to learn both at the same time. Tino --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&

Re: Transactions in Django

2009-08-18 Thread TiNo
On Tue, Aug 18, 2009 at 16:19, Lokesh wrote: > > Hi, > > Unable to perform rollback the transactions. Ended up with the > following error > "Transaction managed block ended with pending COMMIT/ROLLBACK" > > Can I rollback the db changes even if the code doesn't raise

Re: How to validate image dimensions?

2009-08-21 Thread TiNo
forms.ValidationError("Not more than 64*64 pixels.") >return img You can do this with PIL: import Image image = Image.open(img) if image.size[0] > 64: #image.size is a 2-tuple (width, height) ... Or you could resize it down to 64 px if it is bigger. TiNo --~--

ReST and path issues

2009-09-02 Thread TiNo
Hi, I am trying to set up a sort of smal CMS where the input is RestructuredText. The restructured text is parsed by a templatetag with the following code (taken from the PyCon rst project): @register.filter def restructuredparts(value, **overrides): """return the restructured text parts"""

Re: ReST and path issues

2009-09-05 Thread TiNo
On Thu, Sep 3, 2009 at 00:38, TiNo <tin...@gmail.com> wrote: > Hi, > I am trying to set up a sort of smal CMS where the input is > RestructuredText. The restructured text is parsed by a templatetag with the > following code (taken from the PyCon rst project): > >

Re: ReST and path issues

2009-09-07 Thread TiNo
- 1 tinodb tinodb 5431 Aug 25 16:50 html4css1.css -rwxr-xr-x 1 tinodb tinodb 58522 Aug 25 16:50 __init__.py -rw-rw-r-- 1 tinodb tinodb 77999 Aug 25 16:50 __init__.pyc -rw-rw-r-- 1 tinodb tinodb 114 Aug 25 16:50 template.txt What is going on? > > > > > On Sat, Sep 5, 2009 at 7:

Re: GROUP results in views.py

2009-10-30 Thread TiNo
On Fri, Oct 30, 2009 at 15:05, Tom Evans wrote: > SQL cant do this, so do it in python... SQL's GROUP BY is made for this isn't it? And it is also possible in django. I guess this is what you need:

Re: GROUP results in views.py

2009-11-01 Thread TiNo
On Fri, Oct 30, 2009 at 22:10, Javier Guerra <jav...@guerrag.com> wrote: > > On Fri, Oct 30, 2009 at 4:05 PM, TiNo <tin...@gmail.com> wrote: > > SQL's GROUP BY is made for this isn't it? > > no, it's not. > > SQL's GROUP BY discards 'individual' rows off the re

Re: querysets: if x in y

2009-11-08 Thread TiNo
On Mon, Nov 9, 2009 at 01:11, Edward McCaughan wrote: > where you're getting results where a property matches a value, could > you have it try anything in a list of values, eg: > ObjectOne.objects.filter(name=["toast","bread","shoes"]) >

ManyToOne to auth.models.User

2009-11-14 Thread TiNo
with a year. thx, Tino -- 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 django-users+unsubscr...@googlegroups.com. For mo

Re: ManyToOne to auth.models.User

2009-11-15 Thread TiNo
On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker <den...@kaarsemaker.net>wrote: > On za, 2009-11-14 at 15:53 -0800, TiNo wrote: > > > In my apps, Users of the app participate in a certain Year. I would > > like a Year to continue a ManyToOne relationship with a User. As &

Re: ManyToOne to auth.models.User

2009-12-08 Thread TiNo
> > TiNo wrote: > > On Sun, Nov 15, 2009 at 09:31, Dennis Kaarsemaker < > den...@kaarsemaker.net>wrote: > > > > > >> On za, 2009-11-14 at 15:53 -0800, TiNo wrote: > >> > >> > >>> In my apps, Users of the app particip

Re: ManyToOne to auth.models.User

2009-12-08 Thread TiNo
On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch wrote: > one to many from year to user is same as many to one from a > user to a year. > Yes, but how? :D I can't place a FK on the User... -- You received this message because you are subscribed to the Google Groups "Django

Re: How to choose one row of data

2009-12-11 Thread TiNo
guessing... Tino On Fri, Dec 11, 2009 at 19:25, Andy <asdjohn...@gmail.com> wrote: > Tom - DR's method is simple and effective, but I'm guessing you say > it's the worst way because it creates an unnecessary database > request. Is this a correct assumption? If not, please explain.

error on manipulator fields

2008-06-19 Thread TiNo
Hi, (Django version 0.97-pre-SVN-7633) I am trying to use a custom modelfield. When I try to ad an entry in the admin, i get: --- TypeError at /admin/klanten/klant/add/ __init__() got an unexpected keyword argument 'is_required'

Re: error on manipulator fields

2008-06-20 Thread TiNo
ch tonight. If you don't hear back from me, that'll have worked :D Thanks, TiNo On Jun 20, 12:53 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Thu, Jun 19, 2008 at 6:21 PM, TiNo <[EMAIL PROTECTED]> wrote: > > Hi, > > > (Django version 0.97-pre-SVN-7633)

memcached not working with django

2011-10-07 Thread tino
Hello, I am trying to implement memcached on my django site. # telnet localhost 11211 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. stats STAT pid 22537 STAT uptime 31523 STAT time 1317992962 STAT version 1.4.5 STAT pointer_size 64 STAT rusage_user

super() argument 1 must be type, not None

2009-12-21 Thread TiNo
ports are None (User, datetime, models, etc.). I vaguely remember encountering this error before, but I don't remember what I did to fix it. What could have overridden all those things with None? Does anybody have any clues? I can post my whole models.py if necessary, but it's rather large. Thanks, Ti

Re: super() argument 1 must be type, not None

2009-12-21 Thread TiNo
On Tue, Dec 22, 2009 at 00:19, Kieran Brownlees wrote: > Have you restarted your server lately? I find that bug turns up from > time to time when the auto reloader doesn't reload properly. > Yep. Also tried in the dev server as mentioned... -- You received this message

Re: super() argument 1 must be type, not None

2009-12-23 Thread TiNo
I am overriding a save function of a model with the following code: def save(self, *args, **kwargs): if (not self.id) and self.email != '': self.create_user() if hasattr(self, 'user'): self.user.email = self.email self.user.first_name =

Re: super() argument 1 must be type, not None

2009-12-23 Thread TiNo
On Wed, Dec 23, 2009 at 16:53, Bill Freeman wrote: > Are you sure that Lid is defined in this context? Try putting: > > import pdb;pdb.set_trace() > > before the super and check. > As I described, I checked that. The strange thing is, that it is defined as ``None``. As are

Re: super() argument 1 must be type, not None

2009-12-23 Thread TiNo
On Wed, Dec 23, 2009 at 17:31, Doug Blank wrote: > Perhaps this is a cyclic Python import issue. I think Python will go > through a file twice, the first time getting names into the scope, and > then a second time to fill in the details. Perhaps you are still in > the

Re: ManyToOne to auth.models.User

2009-12-26 Thread TiNo
:09 PM, Itay Donenhirsch <i...@bazoo.org> wrote: > > use a userprofile > > see http://docs.djangoproject.com/en/dev/topics/auth/, search for > "userprofile" > > also take a look at > > > http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-mod

django.utils.copycompat is deprecated

2013-10-28 Thread tino
Hello, I am getting the following in apache error log. [error] /home/findme/virtualenv/lib/python2.7/site-packages/django/utils/copycompat.py:10: DeprecationWarning: django.utils.copycompat is deprecated; use the native copy module instead Is this something to worry about? Regards Tino

mod_wsgi setup

2013-11-15 Thread tino
Hello, I am trying to setup a python 2.7 + Django + virtualenv + mod_wsgi environment in my centos 6.3 server to run my python application through apache. But I am getting internal error while trying to access the application through apache. The error log shows the following.

Re: mod_wsgi setup

2013-11-15 Thread tino
Thank you guys for the suggestions. But selinux is already disabled in the server. [root@lampserver spark]# getenforce Disabled Also I tried to set DEBUG = False in settings.py. That also did not help. On Friday, November 15, 2013 3:04:58 PM UTC+5:30, tino wrote: > > Hello, &g

Re: mod_wsgi setup

2013-11-15 Thread tino
/var/run/wsgi On Friday, November 15, 2013 3:04:58 PM UTC+5:30, tino wrote: > > Hello, > > I am trying to setup a python 2.7 + Django + virtualenv + mod_wsgi > environment in my centos 6.3 server to run my python application through > apache. > But I am g

python virtual environment

2013-11-29 Thread tino
Hello I am trying to run a project that was setup in another server, but getting the following error. I am using python 2.7, django, virtualenv. So I am running the project inside a python virtual environment (virtualenv)[web.srv1 daily# python manage.py runserver 0.0.0.0:8000 Traceback

  1   2   >