comment_was_posted

2008-10-29 Thread sam
hello, I try to redirect a user who comments a post on my blog to the same page, to do that, i need to use the signal : 'comment_was_posted' i have put the code below in my blog 'models.py' to be sure it has been loaded, but when i post a new message, i'm not redirected to google ... from djang

securing /admin/

2009-09-18 Thread Sam
Hi Django peeps, Right now, I am in the middle of trying to secure a django app's admin and store areas (satchmo). I have installed a self-signed certificate for testing purposes and I am able to encrypt all pages just fine EXCEPT for the admin page. Here is my setup: ubuntu 8.04 and apache2 wi

Encrypting admin area (SSL) on nignx proxy with apache2

2009-09-24 Thread Sam
headers not being installed. I don't think this is causing a problem since I can encrypt some pages, but I though I would mention it. Thanks, Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: I experience problem with special chars like æ øå in filename when using models.ImageField. and models.Fi leField

2010-06-13 Thread Sam
ield, the exception goes away. The issue is that the default encoding is ascii and so unicode() called on a utf8 byte str blows up. The CharField implementation simply checks if the value is an instance of basestring and just passes it through. This latter approach seems better to me. As it stands, I

Re: I experience problem with special chars like æ øå in filename when using models.ImageField. and models.Fi leField

2010-06-14 Thread Sam
Here it is! http://code.djangoproject.com/ticket/13758 Any feedback on that ticket would be appreciated. Regards, Sam On Jun 13, 11:20 pm, Karen Tracey wrote: > On Sun, Jun 13, 2010 at 8:22 PM, Sam wrote: > > As it stands, I'm inclined to think this issue is a bug. > &g

"View on Site" for instance with Many-To-Many relation to the Site model

2010-06-29 Thread Sam
uld appreciate any feedback on this, it has come up and I am at a loss to explain this behavior in the admin. Am I missing something? Thanks much, Sam -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: "View on Site" for instance with Many-To-Many relation to the Site model

2010-06-30 Thread Sam
tl;dr version: admin "view on site" link returns the first Site associated with a model, rather than the current Site. Is this correct? It seems that it should return the current site (if it is picking one arbitrarily) -Sam On Jun 29, 11:19 pm, Sam wrote: > Hello, > > I

Re: What is (?u) in r'^tags/(?P[^/]+)/(?u)$'

2007-06-04 Thread Sam
Thanks both of you. To synthesize : It is possible to put flags at the end of our urls match strings. Those are (?iLmsux) corresponding to re.I, re.L, re.M, re.S, re.U, re.X In this case, re.U is for (source : http://docs.python.org/lib/node46.html ): UNICODE Make \w, \W, \b, \B, \d, \D, \

Re: How is profile_callback in django-registration supposed to work?

2007-06-24 Thread Sam
This is how i use profile_callback with django-registration : 1. define the profile_callback function : # profile/models.py from django.db import models from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ class ProfileManager(models.Manager): "

Re: How is profile_callback in django-registration supposed to work?

2007-06-26 Thread Sam
'^register/$', register, {'profile_callback':Profile.objects.create}, name='registration_register'), On Jun 24, 6:27 pm, Sam <[EMAIL PROTECTED]> wrote: > This is how i use profile_callback with

Re: newbie django vs. djangoamf

2007-07-10 Thread Sam
>From this URL http://djangoamf.sourceforge.jp/index.php?DjangoAMF_en : Django AMF is a Middleware for Django web framework written in Python. It enables Flash/Flex applications to invoke Django's view functions using AMF(Action Message Format). A MiddleWare is a piece of code that is hooked in

Re: Django serving static PDF file

2007-07-17 Thread Sam
import urllib from django.http import HttpResponse def output_file(request, file, mimetype): f = urllib.urlopen(file) data = f.read() f.close() return HttpResponse(data, mimetype=mimetype) It is better to serve from static environments but sometimes, you want to check user righ

unspecified date field

2008-05-13 Thread sam
hello, i'm looking for a way to authorize user to add date like '2007-00-00', or '2004-04-00', when he doesn't know precisely the day or the day and the month of a date. is someone has got a way to do this ? thanks --~--~-~--~~~---~--~~ You received this messa

Python HTML lib_filter

2007-03-07 Thread Sam
I have translated Cal Henderson's lib_filter.php to python. If you need to filter your users HTML input, you might like it. http://amisphere.com/contrib/python-html-filter/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Python HTML lib_filter

2007-03-07 Thread Sam
I have updated the script to version 1.15.2 ( i started at the translation version ) with two other features: - turn text URLs into clickable URLs http://www.djangoproject.com/ becomes http://www.djangoproject.com/ - blacklist regexp URLs filter.forbidden_urls = ( r'^/delete-account/', ) Click t

Re: Python HTML lib_filter

2007-03-07 Thread Sam
html-filter/html_filter.py On Mar 7, 11:52 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Sam, there's a filter for clickable URLs built-into Django, too. > Smacked my head when I found that one. > --~--~-~--~~~---~--~~ You rec

Re: Python HTML lib_filter

2007-03-07 Thread Sam
You can see the power of "HTML Filter" by looking at the unit tests. http://amisphere.com/contrib/python-html-filter/html-filter-test.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Python HTML lib_filter

2007-03-09 Thread Sam
I have enhanced and fixed some bugs inside "HTML Filter" What it does : html_filter removes HTML tags that do not belong to a white list closes open tags and fixes broken ones removes javascript injections and black listed URLs makes text URLs

High Fidelity Slugify : support for international characters

2007-03-12 Thread Sam
I needed slugify to be more precise with accented characters and i couldn't find some code to do it, so here it is : http://amisphere.com/contrib/python-django/slughifi.py http://amisphere.com/contrib/python-django/ for a quick overview example : >>> text = "C'est déjà l'été." >>> slughifi(text

Re: Restricting Access to Users

2007-03-13 Thread Sam
You should go with a MiddleWare. http://www.djangoproject.com/documentation/middleware/ Here is a basic example: from django.http import HttpResponseRedirect class AccessMiddleware(object): def process_request(self, request): # Insert your Auth Code if authorized:

Re: Restricting Access to Users

2007-03-13 Thread Sam
It's up to your code inside the middleware to restrict or allow the access. For example, you could check the request.META['PATH_INFO'] for zones where the middleware shouldn't do anything. On Mar 13, 4:47 pm, "Stephen Mizell" <[EMAIL PROTECTED]> wrote: > > You should go with a MiddleWare. > > Wi

Re: Global model/view best practice help

2007-04-11 Thread Sam
Like Todd said, 1. Write a function : def my_template_vars(request) return {'var1': 'test', 'var2': 'test2'} 2. Edit your settings.py TEMPLATE_CONTEXT_PROCESSORS = ( ... 'project.app.file.my_template_vars', ) 3. Inside your views, load your templates with a RequestContext object if

Re: cannot get REQUEST_URI

2007-04-28 Thread Sam
Why don't you also use request.META['PATH_INFO'] at production level ? uri = request.META.get('PATH_INFO') On 28 avr, 12:53, "omat * gezgin.com" <[EMAIL PROTECTED]> wrote: > I need to use the current request URI in a template. Thus, I am > passing the uri as a context variable, which is: > > uri

Re: geographical data in models

2007-05-16 Thread Sam
I didn't go with PostGIS because i only needed basic functionality and approximative data. In my models, i have : lat = models.FloatField(max_digits=7, decimal_places=4, blank=True, null=True) lng = models.FloatField(max_digits=7, decimal_places=4, blank=True, null=True) I'm using it together wi

Re: Best-practices for form with image

2007-05-22 Thread Sam
Your request is called a "captcha" You can find examples in the groups or there : http://code.google.com/p/django-captcha/ http://www.djangosnippets.org/tags/captcha/ On 22 mai, 09:59, Xin Xic <[EMAIL PROTECTED]> wrote: > Hello, > > First, sorry for my english. > > Well, I want out a form for

Cannot update model instance in views but works in admin ( UnicodeEncodeError ) - FIXED

2007-05-24 Thread Sam
I use .96, UTF-8. I couldn't update a user instance with strings containing unicode special characters in my views but it worked with the admin interface. Some of you may encounter this problem, so here is the solution... I got this error : UnicodeEncodeError at /profile/xxx/edit/ 'ascii' code

Re: Unicode-branch: testers wanted

2007-05-25 Thread Sam
Most of the table mapping is taken from a GPL project. I've just emailed the authors to see if they would relicense the file to include it inside django. I'll update as soon as i have their replies. On 25 mai, 10:44, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-25 at 10:31 +0

Re: Newforms makes unicode String from a dictonary

2007-05-25 Thread Sam
I couldn't find ImageField validation in .96 To validate your images, just try to open it with PIL from PIL import Image from cStringIO import StringIO try: image = Image.open(StringIO(request.FILES['picture'] ['content'])) except: # raise error here In practice, I handle pictu

Re: Newforms makes unicode String from a dictonary

2007-05-25 Thread Sam
It looks ugly to me but did you try: >>> ustr u"{'var': 'val'}" >>> dic = eval(ustr) >>> dic {'var': 'val'} On 25 mai, 12:40, Christian Schmidt <[EMAIL PROTECTED]> wrote: > > To validate your images, just try to open it with PIL > > When I said I validate the image then did I mean that I try to

What is (?u) in r'^tags/(?P[^/]+)/(?u)$'

2007-06-04 Thread Sam
Found there : Non-ASCII Tag Names in URLs http://code.google.com/p/django-tagging/wiki/UsefulTips I thought it is used to convert to unicode but it doesn't seem effective. Anyone knows about other flags ? --~--~-~--~~~---~--~~ You received this message because y

Re: user restrictions in admin interface

2007-11-27 Thread sam
this ? sam --~--~-~--~~~---~--~~ 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 [EMAIL PROT

user restrictions in admin interface

2007-11-27 Thread sam
standard django admin) and I would like that just a category of user can modify the publish_status (always in the standard django admin). ? thx sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: user restrictions in admin interface

2007-11-28 Thread sam
thx for your answer, so, I have found a translation of goFlow in english, may be it could be more understandable to you ? http://code.djangoproject.com/wiki/GoFlow --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: AttributeError: 'WSGIRequest' object has no attribute 'user'

2007-01-15 Thread Sam
I had this error because i'm not using the auth module. If that's you case, comment it out in your settings.py file: TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.debug", "django.core.context_processors.i18n", # "django.core.context_processors.auth", ) On Jan 5, 5

_post_save() problem with an empty file field

2006-05-04 Thread sam
Django version 0.91. I was trying to generate a thumbnail for an image upload. The image is a FileField. I want to generate thumbnail in _post_save() of the model object. The code is something like the following: class Item(meta.Model): ... file = meta.FileField(upload_to="files",blank=Tr

how to reference another function inside mode class

2006-02-03 Thread sam
w do I get around this? What if I want to define bar() in another file under the same app/models directory -- how do I refer it in my model file? Thanks, Sam

Re: how to reference another function inside mode class

2006-02-03 Thread sam
Amit, My bar() is a pure function defined outside all model classes but that gave me the error. (If I defined it inside the same class from which it was called, then it's OK). How do I deal with this? To import, what package path should I use? Sam

post_save_redirect in update_object generic view

2006-02-06 Thread sam
In "update_object" generic view, I want to go back to the object_detail page whose URL is like /app/obj//, after the update operation. How do I specify post_save_redirect to do that?

integer field's type?

2006-02-09 Thread sam
I observed a weird thing with the integer field defined inside a model class. Suppose I have SEX_TYPE_CHOICES = ( (1, 'male), (2, 'female'), ) class Person(meta.Model): sex = meta.Integerfield(choices=SEX_TYPE_CHOICES) def is_male(self): if self.sex == 1: retu

limiting foreign key choices in a selection field

2006-02-28 Thread sam
I have a model such as: class Part: maker = ForeignKey(Maker) .. When I make a form to enter the "part" information, if I user standard AddManipulator, maker will become a selection list of all possible makers. What if I only want to show a sub-list of makers that belong to a specifi

Re: limiting foreign key choices in a selection field

2006-02-28 Thread sam
My problem is the "category" is determined at run-time, not at module definition time. How to do that? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: limiting foreign key choices in a selection field

2006-03-01 Thread sam
Nesh: Your method works. Thanks very much! Now a tougher situation: I want to have the same form to enter "part" information, except the maker field I want to split into two fields: "category" and "maker". I want to show different selections in the "maker" field based on what was selected in th

how to implement admin's filter interface in my own view

2006-03-03 Thread sam
Hi there I'd like to add the filter function to my own view much in the same way admin interface does it - i.e. filter based on the values of multiple model fields. I am puzzled how to define the URL pattern and how the matched pattern data gets passed to the view. Let's say I have 3 fields, each

session auto-logout

2006-03-20 Thread sam
A newbie question: I am using Django admin's authentication to do login/logout for my own application. I want to automatically log user out if no activity for 5 minutes. I read the session tutorial and played a bit with SESSION_COOKIE_AGE -- but it doesn't work for me. Any suggestion appreciated.

How to change naming convention when creating models?

2006-03-24 Thread sam
Hi All, I'd like to change the naming convention when creation Django models. For instance I don't want to append "_id" to the foreign key field name. It is apparently possible to change this behavior. Thanks in advance. Regards, Sam --~--~-~--~~~

Re: How to change naming convention when creating models?

2006-03-24 Thread sam
Adrian, Thanks for your reply. Waht about the table names? I'd like to remove the 's' at the end of each name. Regards, Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&quo

Re: How to change naming convention when creating models?

2006-03-24 Thread sam
Thanks for the pointer. I'm a little tired today. Should have found it myself ... --~--~-~--~~~---~--~~ 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

FileField permissions

2006-03-25 Thread sam
I want to use FileField to upload files but I don't want the file URIs directly visible to the user. Rather, I want to service the access to the uploaded files via "views", so that I can exercise file access permission (I implemented access permission myself, without using django admin's). I think

how to do this kind of JOIN

2006-03-30 Thread sam
I would like to get help on how to use Django DB API to accomplish the equivalent of the following SQL statement: select a from X, Y where X.f = Y.id and Y.c=123; X has field a, f and Y has field id, c. f is foreign key of Y and Y's primary key is id. Thanks in advance. --~--~-~--~---

complex Q bug

2006-03-31 Thread sam
I was trying complex Q and notices if I do: complex=(Q1 | Q2) and complex = (Q1 or Q1) the results are not the same. I got right result using "or" but not with "|". Is this a bug or I did something wrong? What is the difference between these two operators? --~--~-~--~~---

get_list() with a ManyToMany relationship

2006-04-27 Thread sam
I have the following problem: Give two models and a M2M relationship: class Product(meta.Model): category =meta.IntegerField() ... class Part(meta.Model): products = meta.ManyToManyField(Product) ... I want to find all products that belongs to a certain category (say "3") and i

Fetching data from related tables

2013-05-09 Thread Sam
I have 3 tables: Continent, Country and Story. Country has ForeignKey(Continent) and Story has ManyToManyField(Country, blank=True) field. What I need is to get a list of countries which at least have one story belonging to it, and I need these countries grouped by continents. How can I achi

Test, RunPython, Datamigrations with Django 1.7.5

2015-03-04 Thread sam
Hello, I have an issue trying to run tests. My application use a migration to have default fixtures (created using migrations.RunPython from a migration file). The problem is when I launch manage.py test, the fixtures from the migration are created on the "production" database and not on the t

Re: Test, RunPython, Datamigrations with Django 1.7.5

2015-03-04 Thread sam
Well, answer is here: https://docs.djangoproject.com/en/1.7/topics/testing/overview/#rollback-emulation Need to use serialized_rollback = True in TransactionTestCase Le mercredi 4 mars 2015 18:24:34 UTC+1, sam a écrit : > > Hello, > > I have an issue trying to run tests. > My ap

Creating serializer for foreign key of foreign key

2020-03-07 Thread Sam
I have 3 models. Question, Choice, and ChoiceColor. class Question(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) question= models.CharField(max_length=200) class Choice(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) choic

Re: One to Many+foreign key Query: best way to build the optimal result

2009-06-25 Thread Sam Walters
tle': loc.location.title, 'id': > loc.location.id, 'state_id': loc.state.id, 'name': loc.name} \ > for loc in locations.iterator() > ] > > render_to_response('template.htm', {'results': results}) > > I run a query si

Help using the django queries API to select columns from multiple tables

2009-06-28 Thread Sam Walters
Hi I am using django 1.0 to redevelop a website. I have read http://docs.djangoproject.com/en/1.0/topics/db/queries/ and cant work out how to do my query except using raw sql. It would be great to be able to use the django query api so i can stack queries more easily. Just one working example woul

Re: Help using the django queries API to select columns from multiple tables

2009-06-29 Thread Sam Walters
ign key relationship work with the current schema then I will move it as you have suggested. Do you know how to build the admin.py to circumvent this issue? On Mon, Jun 29, 2009 at 6:51 PM, Daniel Roseman wrote: > > On Jun 29, 4:57 am, Sam Walters wrote: > > Hi > > I am using d

Re: Best distro for django

2009-07-03 Thread Sam Walters
It should not matter. Any modern Linux Distro which supports the dependencies will be no different. The only conceivable way this question makes sense is if you want to make install or deployment easy. In which case use something thats based on a debian, fedora type distro where there is heaps of

Re: MEDIA_URL and ADMIN_MEDIA_PREFIX

2009-07-12 Thread Sam Lai
Yes, because unless you copy the admin site's media over to your MEDIA_URL (or vice-versa), Django won't be able to find the admin media. >From http://docs.djangoproject.com/en/dev/ref/settings/ ADMIN_MEDIA_PREFIX Default: '/media/' The URL prefix for admin media -- CSS, JavaScript and images

Re: MEDIA_URL and ADMIN_MEDIA_PREFIX

2009-07-12 Thread Sam Lai
Forgot to add - the usual trick is to symlink the admin media in your MEDIA_URL; that way you don't have to set up two different aliases in your web server config. 2009/7/13 Sam Lai : > Yes, because unless you copy the admin site's media over to your > MEDIA_URL (or vice-versa),

Re: home page caching

2009-07-13 Thread Sam Tregar
riod you require. One way to do that is entirely with Squid, but another would be to modify your app to output HTTP cache control headers (Expires, Cache-Control, etc). I'm not sure how to do that in Django but I imagine it shouldn't be too hard. -sam --~--~-~--~~-

Re: How to get this value

2009-07-13 Thread Sam Lai
Try: getattr(eachalert, criteria1_metric1) or something similar. look up the getattr python function. On 7/14/09, David wrote: > > still no lucky... > > Traceback (most recent call last): > File "", line 1, in > File "/home/dwang/alert/../alert/message/models.py", line 245, in > check_crit

AttributeError when trying to save and access models

2009-07-14 Thread Sam Walters
Hi Django world I keep getting problems accessing and storing data in foreignkey and one-to-one relationships. Error is basically of the form: "AttributeError Exception Value: 'DirectoryAdmin' object has no attribute 'abbrev'" The models.py file is here: http://pastebin.com/mcc4ee45 The SQL it pr

Re: How to implement a custom field (or relation) which supports List of Strings

2009-07-17 Thread Sam Tregar
ead you should create a new model for friends and link users to friends with a one-to-many relation. Each friend can have a single character field for their name, which will give you a list of strings (friends) attached to each user. Does that make sense? -sam --~--~-~--~~--

Re: Windows development server problem

2009-07-21 Thread Sam Lai
Did you forget any imports? Maybe your code snippet's identifiers clashed with the default django ones? Are there any errors in stdout? 2009/7/21 cwurld : > > Hi, > > I have a snippet of code that runs fine as a standalone program. But > when I incorporate it into a view and access that view w

Re: IDE for Django and Ext JS

2009-07-28 Thread Sam Lai
There's also the free Komodo Edit (and the more featureful Komodo IDE) from ActiveState, which supports python and the django template language among other things, and is cross-platform too. 2009/7/29 Jamie : > > On the mac, there's textmate (an editor, not an IDE), which has a > language plugin

Help building a custom RadioSelect widget.

2009-08-03 Thread Sam Walters
n.com/m67363386 Any help completing/explaining this would be greatly appreciated and open the floodgates towards understanding how to do this for all sorts of pythonic/django overloading scenarios. cheers -Sam --~--~-~--~~~---~--~~ You received this message because yo

Re: Help building a custom RadioSelect widget.

2009-08-04 Thread Sam Walters
Thanks David This example is exactly what i was hoping for. I hope something like this gets put into a tutorial because i guess many people would need to control exactly what their form looks like. Cheers -Sam On Tue, Aug 4, 2009 at 11:00 PM, David De La Harpe Golden wrote: > > Sam W

checking if db schema and model match

2009-08-05 Thread Sam Lai
, and what that is. I thought syncdb did this, but it doesn't seem to. I think this would be quite useful to have, and could pre-empt errors later on when non-existent fields are used in views etc. Sam --~--~-~--~~~---~--~~ You received this message because y

Re: Multiple data formats for one view

2009-08-05 Thread Sam Lai
I have a piece of middleware which assigns the right MIME type based on URL extension, then I have templates for XML, JSON and HTML. My view function simply gets the required context objects, then passes it to the appropriate template. This could probably be generified to make it more reusable.

Re: checking if db schema and model match

2009-08-06 Thread Sam Lai
sn't have built- > in solution for that. > Try using South (http://bitbucket.org/andrewgodwin/south/overview/), > it is a very good db migration app. I suggest using development > version because (based on my experience) it is more robust than last > official release (0.5). >

Re: Django documentation site is SLOW

2009-08-07 Thread Sam Walters
Hi Its probably not the browser. I am using firefox 3.5 on an eee pc and the documentation is fine. This is with Javascript disabled using noscript however i just turned it on again and no noticable difference in top readings *You should look at the install addons of firefox, eg: some plugin whic

Re: Javascript with built-in templates tags

2009-08-08 Thread Sam Lai
Can you show us the generated template HTML, and if possible, the expected result? That way we can work out the issue with your django templates, rather than trying to guess your code. 2009/8/9 WilsonOfCanada : > > I tried that before, but it only seems to work when it is used on > the .html fil

Re: Django in Vista

2009-08-15 Thread Sam Lai
You need to install python then django first before trying the tutorial - start here http://docs.djangoproject.com/en/dev/intro/install/ 2009/8/16 Thiago511 : > > I went to that link you gave me. I tried it, and I go the same error > message. > > they told me to: > > "From the command line, cd in

Re: Django in Vista

2009-08-15 Thread Sam Lai
ath to your python executable. To make things easier later, add the directory containing the python executable to your system path (Control Panel -> System -> Advanced -> Environment Variables -> PATH). 2009/8/16 Thiago511 : > > python and Django are both installed already > >

Re: Django in Vista

2009-08-16 Thread Sam Lai
You added the directory containing django-admin.py to your PATH right, not the path of django-admin.py itself? If you want, type 'set path' (without quotes) into your command prompt and paste the result here and we'll see if you did it right. 2009/8/16 Thiago511 : > > UPDATE: > Well I added djan

how do you display custom permissions on admin site?

2009-08-16 Thread sam lee
eld. Do I need to do some extra step to make my custom permissions available to admin site? Or am I completely missing the point of custom permissions? Thank you. Sam. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &quo

Re: how do you display custom permissions on admin site?

2009-08-17 Thread sam lee
again. Sam. On Mon, Aug 17, 2009 at 3:47 AM, fabrix wrote: > > On Aug 16, 2:29 pm, sam lee wrote: >> I run syncdb and runserver > [...] >> But I don't see the myapp | test_perm listed under Permissions field. > > permissions are stored in db, syncdb doesn&#x

Re: Django and CouchDB

2009-08-18 Thread Sam Lai
Would be easy enough if you just wanted to use the routing, views and template parts of Django though. Sorry, no experience though something that I've been wanting to try for a while. Unfortunately, the current project doesn't call for that kind of db. 2009/8/18 Joshua Partogi : > > > On Tue, Au

Re: Best practice on data security .. on record, table (model) db or url

2009-08-21 Thread Sam Lai
2009/8/21 Gerard : > > Hi All, > > I'm working on an invoice system, currently deployed the single user version >  in house. Next one is gonna be a full blown multi user setup. Having > fairly good knowledge of security, I was wondering what would be best > practice in Django for data separation.

Re: dump data using json

2009-08-21 Thread Sam Lai
2009/8/22 ashish tiwari : > hi Friends > > i heared about the json format > django provided utility of dumpdata, loaddata which dumps and loads data in > json format. > > but i dont know,how to use it.. > > i want to dumpdata...from my app > > name of iFriends > name of People > > iFrien

Re: print PDF on windows

2009-08-25 Thread Sam Lai
Use python to call a PDF reader via the command line - http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm http://foxit.vo.llnwd.net/o28/pub/foxit/manual/enu/FoxitReader30_Manual.pdf (see the Command Line section) Depending on the complexity of your PDFs, I'd recommend using Foxit instead

Executing a queryset with MySQL's SSCursor cursor class

2009-08-26 Thread Sam Tregar
ow if that's possible? My searches of the docs and code haven't turned up much yet. Thanks, -sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: print PDF on windows

2009-08-26 Thread Sam Lai
ere are security risks associated with this option. > > Marc > > On Aug 26, 1:46 am, Sam Lai wrote: >> Use python to call a PDF reader via the command line - >> >> http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm >> >> http://foxit.vo.llnwd.net/o

How to control which DB connection and cursor a queryset will use

2009-08-27 Thread Sam Tregar
a generic queryset qset = blah.objects.all() # tell qset to use the new connection: qset.use_db(db) # and then apply some filters qset = qset.filter(...) # and execute the query: for object in qset: ... -sam --~--~-~--~~~---~--~~ You rec

QuerySet without result_cache?

2009-08-27 Thread Sam Tregar
y to turn this cache off? Looking at the code leads me to think no, but I thought I'd ask. -sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: QuerySet without result_cache?

2009-08-27 Thread Sam Tregar
erySet cache system works. Maybe I'll see about a patch. -sam --~--~-~--~~~---~--~~ 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

Re: print PDF on windows

2009-08-28 Thread Sam Lai
an app under another user account. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx?mfr=true > Thanks so much for your help > > Marc > > On Aug 27, 2:42 am, Sam Lai wrote: >> 2009/8/27 mettwoch : >> >> >> >> &g

Re: QuerySet without result_cache?

2009-08-28 Thread Sam Tregar
On Thu, Aug 27, 2009 at 8:18 PM, Alex Gaynor wrote: > > On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar wrote: > > On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor > wrote: > >> > >> Instead of iterating over the QuerySet itself, use > >> QuerySet.iterator(), t

Re: Need help getting the company I work for to go with django

2009-09-01 Thread Sam Lai
2009/9/2 Kenneth Gonsalves : > > On Tuesday 01 Sep 2009 10:55:18 pm mrsource wrote: >> - It has many tools for safety, with a normal opensource CMS you have >> many more issues with security holes because all the code is public. > > this is sheer FUD to say that 'many more issues with security hol

Re: Editors of choice

2009-09-10 Thread Sam Walters
Vim in conjunction with Git - most powerful + extensible editor out there in my humble opinion. On Thu, Sep 10, 2009 at 7:46 PM, boyombo wrote: > > Vim + pydiction + django.vim > > On Sep 10, 1:31 pm, eka wrote: >> Vim + RopeVim + Omincompletion + taglist + tasklist + python_fn >> >> On Sep 10,

Re: removing fields in modelformset

2009-05-11 Thread Sam Chuparkoff
On Mon, 2009-05-11 at 07:55 -0700, eric.frederich wrote: > Hello, > > I need to set up a view for administrators of an application that I am > writing where they can edit a subset of fields on a particular model. > It was pretty simple... > > EnrollmentFormSet = modelformset_factory(Enrollment,

Re: removing fields in modelformset

2009-05-11 Thread Sam Chuparkoff
On Mon, 2009-05-11 at 10:59 -0700, eric.frederich wrote: > Hmm, thats almost what I need. I guess I didn't fully explain what I > need. > I do need to limit the number of fields that are shown, but I also > need to make some of them view only. I don't think this "view only" feature exists. Googl

Re: Design Question

2009-05-11 Thread Sam Chuparkoff
On Mon, 2009-05-11 at 17:31 -0700, Glen Jarvis wrote: > Both forms have a 'name' attribute. And, both forms are in a template > together. (I mean that both form instances are created for the > specific instance of the model in question, and are displayed together > (very interleaved) in a template

Re: temporarily log in as another user

2009-05-14 Thread Sam Chuparkoff
On Wed, 2009-05-13 at 05:21 -0700, Dave Brueck wrote: > Has anyone in this group implemented any sort of login-as-another-user > functionality with Django? I implemented "sticky superuser logins" about a year ago (the last time I worked with django until now), so I can attest it is a neat trick,

Re: Problem debugging with pdb

2009-05-15 Thread Sam Chuparkoff
On Fri, 2009-05-15 at 14:00 -0700, Joshua Russo wrote: > I can't seem to get pdb to stop at my break points for a page request. > I start it like so: > > (from the directory containing manage.py) python -m pdb manage.py > runserver Have you tried this? python -m pdb manage.py runserver --norelo

Re: User profile get_profile() error

2009-05-15 Thread Sam Chuparkoff
On Fri, 2009-05-15 at 19:53 -0400, Joshua Williams wrote: > When trying to access a user defined profile, using get_profile, I > am > getting an error when accessing the profile for a user. Just so I > have my bases covered, here is my model class: > > class UserDetail(models.Model): >

Re: Integer Max/Min Values

2009-05-16 Thread Sam Kuper
2009/5/17 sampablokuper > I've been encountering the same problem. It's especially frustrating > because it seems model validation used to be much easier in Django > (see > http://www.cotellese.net/2007/12/11/adding-model-field-validation-to-the-django-admin-page/ > ). > [...] > > Are the Django

Re: Formatting a Foreign key combo box in admin change form

2009-05-16 Thread Sam Chuparkoff
On Fri, 2009-05-15 at 15:12 -0700, nih wrote: > in the admin change form the select box only shows name.username (eg > nih) > is it possible to show the full name in the select box You are looking to override label_from_instance(). See here http://docs.djangoproject.com/en/1.0/ref/forms/fields/#

  1   2   3   4   5   6   >