Using STATIC_URL in CSS/JS files?

2012-01-02 Thread Victor Hooi
it to point to {{ STATIC_URL}} without hardcoding the URL/path - any way? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/24ML6hwMPCAJ. To

Highlighting Active Navigation Link - correct approach?

2012-01-08 Thread Victor Hooi
this isn't part of Django core, or an in-built templatetag? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Xx5Rk_rBuxIJ. To

Re: TypeError:

2012-11-16 Thread Victor Rocha
ance with new django 1.4 specifications and you should be fine. Thank you, Victor Rocha RochApps.com On Thursday, November 15, 2012 3:05:02 PM UTC-5, Satinder Goraya wrote: > > I am using a custom field "SeparatedValuesField" for saving array > values in my models. When i

Re: What used @models.permalink and get_absolute_url? Please an example to better understand this. An example of the documentation is not clear to me

2012-11-17 Thread Victor Rocha
In order to use get_absolute_url, first of all you need to have named urls. Lets imagine we have the following named url. url(r'^accounts/(P?d+)/$', DetailView.as_view( template_name='accounts/details.html', ), name='account_details') In order to referece this url in a te

Re: Editing model instance

2012-11-23 Thread Victor Rocha
. Let me know if I was of any help, Victor Rocha RochApps <http://www.rochapps.com> On Thursday, November 22, 2012 5:59:11 AM UTC-5, sandy wrote: > > I edit value of a table using model instance, however after editing I > want the values to be saved in some other table with same st

Re: Editing model instance

2012-11-23 Thread Victor Rocha
m(instance=clientjob) return render_to_response('tcc/edit_job.html', {'jform': jform,'sform':sform},context_instance=RequestContext(request)) Thank you, Victor Rocha RochApps <http://RochApps.com> On Friday, November 23, 2012 8:55:06 AM UTC-5, V

Model method versus overriding save()

2012-12-07 Thread Victor Hooi
Any cons with that approach? What do you guys tend to use in your projects? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-

Re: Model method versus overriding save()

2012-12-09 Thread Victor Hooi
so should I be using something like django.db.models.signals.post_save in addition to overriding save(), or instead of it? Cheers, Victor On Monday, 10 December 2012 10:49:22 UTC+11, Chris Cogdon wrote: > > Even though I'm a total database junkie (and where by that I mean > postg

Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
eated your app using django 1.4 from the beginning, I don't see how this error could happen! Django lays out your project for you and sets everything correctly. Thank you, Victor Rocha RochApps <http://www.rochapps.com> On Tuesday, December 25, 2012 8:22:10 AM UTC-5, huw_at1 wrote:

Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
ll concern about this 'test.test.settings' it should only be 'test.settings' Thank you, Victor Rocha RochApps <http://www.rochapps.com/> On Tue, Dec 25, 2012 at 10:22 AM, huw_at1 wrote: > Thank you, > Victor Rocha > RochApps <http://www.rochapps.com&g

Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
I don't think I can be of more help. Hopefully someone with experience with PyCharm can chime in. This is probably not what you want to hear but ditch windows, ditch pycharm use windows and vim or at least gedit. One last comment, in your manage.py file i can see this 'pkadata.settings'; i didnt s

Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
setting in the IDE as you said. > > Thanks for the help. > > > On Tuesday, December 25, 2012 5:14:03 PM UTC, Victor Rocha wrote: > >> I don't think I can be of more help. Hopefully someone with experience >> with PyCharm can chime in. >> This is pro

Re: Django 1.4 manage.py cannot find settings

2012-12-25 Thread Victor Rocha
Would you please describe all you have to do to resolve it, in case someone else stumbles upon the same issue? Thank you, Victor Rocha RochApps On Tue, Dec 25, 2012 at 5:51 PM, huw_at1 wrote: > [RESOLVED] > > > On Tuesday, 25 December 2012 17:28:15 UTC, Victor Rocha wrote: >

Re: Get objects sorted by time of last comment

2013-01-05 Thread Victor Rocha
hat does all of the heavy lifting behind the scenes. disclaimer: I am not really sure if you can employed any of the methods listed here on a Generic Model tho, use at your own risk... thank you, Victor Rocha RochApps <http://www.rochapps.com> On Wednesday, January 2, 2013 1:50:17 AM U

Re: Problem with FilteredSelectMultiple widget

2013-01-31 Thread Victor Rocha
Can you post up your code? On Thursday, January 31, 2013 6:29:08 AM UTC-5, KVR wrote: > > Hi, > I am trying to reuse FilteredSelectMultiple widget from django admin > widgets. > > I've defined my form and media classes, and included form and media > contexts in my template also. > > But when I

Re: Problem with FilteredSelectMultiple widget

2013-02-01 Thread Victor Rocha
I remember running into this problem quite sometime ago. What happens is that in order to access the file jsi18n you need to be logged in. What you need to do it's save a copy of the file and point to the file instead. thank you, Victor rocha rochapps.com On Fri, Feb 1, 2013 at 11:52 PM

Re: Problem with FilteredSelectMultiple widget

2013-02-01 Thread Victor Rocha
n your templated you do this Thank you, Victor Rocha rochapps.com On Sat, Feb 2, 2013 at 12:15 AM, KVR wrote: > Yeah, it's throwing js error. Could you please tell me how to point that, > I am just newbie to Django. > I've tried adding the fo

Re: Problem with FilteredSelectMultiple widget

2013-02-01 Thread Victor Rocha
You are very welcome! On Sat, Feb 2, 2013 at 1:14 AM, KVR wrote: > Thank you very much Victor Rocha !! > That resolved my issue. > > Regards, > kvr > > > On Saturday, February 2, 2013 11:06:29 AM UTC+5:30, Victor Rocha wrote: > >> One way around this is to call

Re: App-structure: how to have a bunch of data in all the pages.

2013-02-05 Thread Victor Rocha
I think template tags would be a good solution. Thank you, victor rocha www.rochapps.com On Tuesday, February 5, 2013 5:06:28 AM UTC-5, Stefano Tranquillini wrote: > > Hi all. > i've a conceptual problem that i would like to solve. > Let's take as example a blog. > In

Re: admin - see detail inline

2013-02-06 Thread Victor Rocha
(Client) #Admin class Detail_Doc(admin.StackedInline): model = Docs class DocAdmin(admin.ModelAdmin): pass class ClientAdmin(admin.ModelAdmin): inlines = [Detail_Doc,] admin.site.register(Doc, DocAdmin) admin.site.register(Client, ClientAdmin) Thank you, Victor Rocha

Storing versioned maps of application connections?

2013-03-02 Thread Victor Hooi
a save though - there's probably a smarter way to bulk these? (I know there's bulk create in Django, I'm not aware of any bulk updates?). Are there any performance considerations we should be wary of? (There are probably between 100-200 applications). Cheers, Victor -- You recei

Re: p.choice_set.all() error

2013-03-08 Thread Victor Rocha
The only thing I can think of it is that your database is not up-to-date with your models. You could drop the database and do a syncdb, otherwise using south to migrate your database schema could be an option. Good luck, Victor Rocha RochApps <http://www.rochapps.com> On Thursday, M

Using django-devserver with Werzbeug to debug an app - interactive debugger not being trigged?

2013-03-14 Thread Victor Hooi
OError: [Errno 2] No such file or directory: > u'/Users/victorhooi/code/source/y/yolk/yolk-0.4.3.tar.gz' > 127.0.0.1 - - [14/Mar/2013 20:31:04] "GET > /packages/yolk/download/1/yolk-0.4.3.tar.gz HTTP/1.1" 500 - However, I don't seem to get any interactive promp

Deployment best practices - reasons?

2013-04-29 Thread Victor Hooi
s with say ./manage.py run_gunicorn in there)? Supervisord will restart crashed processes. Anything else? Why use Sentry? Allows easier viewing of errors. Anything else? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Store arbitrary key-value pairs in model?

2013-04-29 Thread Victor Hooi
abase (e.g. MongoDB, or Couch DB) might be more suitable, however, I'd like to keep it within Django, if possible (Django and relational DBs are widely used where I am, and there's good support for them). Cheers, Victor -- You received this message because you are subscribed to the Google G

apps referencing username field in custom user classes

2013-06-23 Thread Victor Rajewski
27; field 'username' which is an alias to whatever USERNAME_FIELD references? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: apps referencing username field in custom user classes

2013-06-23 Thread Victor Rajewski
> > On Mon, Jun 24, 2013 at 5:43 AM, Victor Rajewski > > > wrote: > >> I have a custom minimal user model subclassing AbstractBaseUser, >> containing little more than an email address, for use with >> django-social-auth. However, I'm using an externally

Re: apps referencing username field in custom user classes

2013-06-24 Thread Victor Rajewski
-write those apps, would it not make sense to implement an alias-type field in BaseAbstractUser model (or via its Manager and Queryset)? What would be the pros vs cons of this approach? Is it worth raising in django-developers? Cheers, Victor -- You received this message because y

Re: 'SimpleLazyObject'

2013-07-13 Thread Victor Rocha
reference to it on your databases. The Bookmark foreign key expects to point to user instance on the users table. Thank you, Victor Rocha www.RochApps.com On Friday, July 12, 2013 2:45:00 PM UTC-4, Kakar wrote: > > I've got a TypeError: > > int() argument must be a string

Design for storing likes/dislikes?

2013-07-16 Thread Victor Hooi
y 0=unrated, 1=like, 2 = unlike, and all possible combinations are listed. We'll be doing queries to compare users, and see if their likes/dislikes intersect. Are there any pros/cons of the two approaches for this given query, or is there perhaps a more efficient way of storing this d

Re: Design for storing likes/dislikes?

2013-07-17 Thread Victor Hooi
m the relationship not being there? Cheers, Victor On Wednesday, 17 July 2013 11:24:54 UTC+10, donarb wrote: > > On Tuesday, July 16, 2013 5:29:47 PM UTC-7, Victor Hooi wrote: >> >> Hi, >> >> We have a list of users, who are going to like/dislike various widgets. &g

Re: Design for storing likes/dislikes?

2013-07-18 Thread Victor Hooi
-hate-five-star-ratings/ Cheers, Victor On Thursday, 18 July 2013 06:31:15 UTC+10, arnonym wrote: > > On Tue, 16 Jul 2013 17:29:47 -0700 (PDT) Victor Hooi > > wrote: > > We have a list of users, who are going to like/dislike various > > widgets. > > > > My q

Best practice - using Django model's in-built id field?

2013-07-18 Thread Victor Hooi
Hi, I'm just wondering - is it considered good or bad practice to use a Django model's in-built ID field? Say for example you wanted a unique identifier for each transactio - should you be generating your own, or can you use just self.id? Cheers, Victor -- You received this messa

Re: Best practice - using Django model's in-built id field?

2013-07-18 Thread Victor Hooi
Hi, Ok, thanks, I'll generate my own AutoField to track each transaction. Just to clarify - when you say they'll be issues with migration, what do you mean? Is it because that field is also as a FK to other models? Or something else? Cheers, Victor On Friday, 19 July 2013 11:50

Re: Best practice - using Django model's in-built id field?

2013-07-18 Thread Victor Hooi
Hi, Actually, while we're there - is this a suitable use of AutoField? Or is there a better way to generate unique transactions IDs? python.uuid? Or something better? Cheers, Victor On Friday, 19 July 2013 11:57:21 UTC+10, Victor Hooi wrote: > > Hi, > > Ok, thanks, I&#

Re: Design for storing likes/dislikes?

2013-07-19 Thread Victor Hooi
s a M2M between Users and Widgets - since each user can like/unlike many widgets, and each widget can be liked/unliked by many users. Cheers, Victor On Saturday, 20 July 2013 00:57:54 UTC+10, Steven Smith wrote: > > I've used NullBooleanField for this before, as well. A lot qui

Re: Best practice - using Django model's in-built id field?

2013-07-19 Thread Victor Hooi
UUID for each transaction, however, I suspect that's something I don't need to worry about until down the track. Cheers, Victor On Friday, 19 July 2013 23:45:06 UTC+10, Javier Guerra wrote: > > On Fri, Jul 19, 2013 at 4:26 AM, Tom Evans > > > wrote: > > Because

Re: html to pdf

2013-07-28 Thread Victor Rocha
Shameless plug but you could use this: https://github.com/rochapps/django-pdf -victor On Sunday, July 28, 2013 3:50:41 AM UTC-4, Harjot Mann wrote: > > Hello Everyone > > I am using Reportlaba nd pisa to convert the html template to pdf and > it is working but my question is

Re: html to pdf

2013-07-28 Thread Victor Rocha
Can you post the traceback? On Sunday, July 28, 2013 3:50:41 AM UTC-4, Harjot Mann wrote: > > Hello Everyone > > I am using Reportlaba nd pisa to convert the html template to pdf and > it is working but my question is that I want to convert the html > template directly to pdf. Right now it is r

Using standard Django admin User forms for Custom User model?

2013-07-30 Thread Victor Hooi
use the normal Django User admin forms with a custom User model? Secondly, I tried creating a user via the create_user() method on my custom User object - I still wasn't able to login to the admin using that username/password, which I thought was weird. Cheers, Victor -- You received this

Re: django1.5 pour rapidsms

2013-07-31 Thread Victor Rocha
can you post the traceback you are getting? On Wednesday, July 31, 2013 7:49:10 AM UTC-4, mimi89 wrote: > > depuis que j'ai rajouté l'application rapidsms-xforms à rapidsms, celui-ci > ne marche plus car la version de ce dernier est Django1.5 et que pour > rapidsms c'est un ancienne version! > L

Re: Using standard Django admin User forms for Custom User model?

2013-08-05 Thread Victor Hooi
ers failed - the forms seemed to be looking specifically for auth_user. Apparently this is something that could be made easier? https://code.djangoproject.com/ticket/19353 http://stackoverflow.com/a/17496836/139137 Is that something that could be in 1.6? Cheers, Victor On Thursday, 1 August 2013

Returning random model objects - is order_by('?') on Postgres safe to use now?

2013-08-07 Thread Victor Hooi
s made some recent changes which makes ORDER BY RANDOM the better option now? Which database backends specifically should we be warned about when saying that order_by('?') is expensive and slow? Cheers, Victor -- You received this message because you are subscribed to the Goo

Re: Returning random model objects - is order_by('?') on Postgres safe to use now?

2013-08-07 Thread Victor Hooi
code I was using randint to generate random numbers between 0 and the highest pk (and handling ObjectDoesNotExist). Hence, this was meant to be faster and cheaper. However, I'm curious if database backend has changes significantly? Cheers, Victor On 08/08/2013 12:11 PM, "Tom Lockhart&q

Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Victor Hooi
Rest Framework, the human-readable name seems to given as "I os client" or "i os client". Is there any way to easily suppress this behaviour? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Victor Hooi
where it's getting it's verbose form from: <https://lh3.googleusercontent.com/-SyhDu2sXyRM/UgxTmrTck4I/Xx4/3IxlNTqQHZw/s1600/Screen+Shot+2013-08-15+at+2.05.22+PM.png> Cheers, Victor On Thursday, 15 August 2013 12:50:40 UTC+10, Ramiro Morales wrote: > > On Wed, Aug 14, 2013 a

Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Victor Hooi
workaround, right? Is it documented anywhere in the Django docs, or is it considered too much of an edge case? Cheers, Victor On Thursday, 15 August 2013 15:08:00 UTC+10, Mike Dewhirst wrote: > > On 15/08/2013 2:06pm, Victor Hooi wrote: > > For example, verbose_name-Plural on the

Representing infinity or "no limit" in an integer field?

2013-08-19 Thread Victor Hooi
ot;correct"? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to thi

Bulk-creating two ForeignKey linked models - id field for relationship isn't set properly?

2013-08-20 Thread Victor Hooi
d hasn't been generated yet, and the ProductImage object I have is somehow broken? Is there another way I can achieve this then? (Loop through file, creating a list of Products and ProductImages, then bulk_creating them?) *2. Image Set Counter* Also, second question - in the last code se

Re: Bulk-creating two ForeignKey linked models - id field for relationship isn't set properly?

2013-08-20 Thread Victor Hooi
efore moving onto the next Product(). Are there any workarounds for this, or any way I could still leverage on bulk_create()? 2. Cool, thanks for the tip - completely forgotten about this - enumerate() will be very useful =). Cheers, Victor On Tuesday, 20 August 2013 20:40:52 UTC+10, Daniel Ro

Re: Bulk-creating two ForeignKey linked models - id field for relationship isn't set properly?

2013-08-20 Thread Victor Hooi
doing that extra lookup is going to be any better than just iterating through and doing a save() each round and avoiding bulk_create() altogether. Cheers, Victor On Tuesday, 20 August 2013 22:51:57 UTC+10, Daniel Roseman wrote: > > On Tuesday, 20 August 2013 12:10:34 UTC+1, Victor Hooi

Re: Bulk-creating two ForeignKey linked models - id field for relationship isn't set properly?

2013-08-20 Thread Victor Hooi
Hi, Cool, thanks for the link to the ticket. Very interesting reading, and I learnt something =). Apparently the ticket says the patch still needs docs/tests - guess it'll be a while before this gets integrated then...hmm. Cheers, Victor On Wed, Aug 21, 2013 at 2:11 AM, Simon Charette

Using PredictionIO with Django - where to put client creation?

2013-09-09 Thread Victor Hooi
issue? Should I be shoving this into something like Celery, or is the above acceptable? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to djang

Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-18 Thread Victor Hooi
ing some of those settings variables in models.py, and it's failing silently. Should I put each os.environ call in a try/except block, or is there a more Pythonic way? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-18 Thread Victor Hooi
d is there a special exception type you should throw if it's not being set, or is there a better way to handle it? Cheers, Victor On Thursday, 19 September 2013 15:54:15 UTC+10, Dig wrote: > > Hi, > > Do you means some thing like this? > > os.environ.get('SOME_VARIABLE&#

Aggregation and count - only counting certain related models? (i.e. adding a filter on the count)

2013-09-24 Thread Victor Hooi
way to do it, and doesn't really use the database. I was wondering if there's a smarter way to still use aggregation, but filter out to only count a subset of related ItemLikeStatus? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users&

Loading data from Django into RedShift - ORM vs SQL?

2013-10-17 Thread Victor Hooi
ta in, but I don't think that will work well with RedShift). My question is regarding how we should be extracting the data - we can either hook directly into the Django ORM, or just use SQL by hand. What are people's experiences with either approach? Any thoughts on pros/cons of eit

Re: sorting model data in template page

2011-04-29 Thread Victor Harada
The for tag does not accept calls with parameter. You should make the view function calculate the sorted list and pass it to the template or create a template tag that accepts your call 2011/4/29 Krish > This code works perfectly, > > {% for talk_child in talk.child.all %} > {{talk_child.text}}

Importing file to Models - Temporary store to allow confirming?

2011-06-25 Thread Victor Hooi
ngo sessions? Or any other way to do it? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/zBHlA9Q2t7MJ. To post to this gro

Re: Importing file to Models - Temporary store to allow confirming?

2011-06-27 Thread Victor Hooi
future. In this case, I suppose I can just use Ajax on the page itself to check on the status of the queue? Cheers, Victor On Mon, Jun 27, 2011 at 04:36, Shawn Milochik wrote: > If you're using Django 1.2 or higher you can take advantage of the > multi-database support by adding

Re: Importing file to Models - Temporary store to allow confirming?

2011-06-27 Thread Victor Hooi
er I the future. In this case, I suppose I can just use Ajax on the page itself to check on the status of the queue? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https:

Hyphens in Django app/project names?

2011-01-14 Thread Victor Hooi
/project naming conventions? (I could only find an outdated one at http://homepage.mac.com/s_lott/iblog/architecture/C1597055042/E20070622152523/index.html ). Cheers, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Hyphens in Django app/project names?

2011-01-17 Thread Victor Hooi
I either go for a single-word module name, or replace hyphens with underscores. Is there any recommendation from the Django team? Is sing underscores as faux-hyphens considered bad practice? Cheers, Victor -- You received this message because you are subscribed to the Google Groups "D

Migrating custom view to class-based generic views ; Using staticfiles assets in CSS files?

2011-01-17 Thread Victor Hooi
a smarter way of doing this with the provided mixins/generics views? And now my second question - I can use STATIC_URL or get_static_url in my template files - but how do I use these values in my CSS files? I.e. my CSS files need to reference assets stored as part of staticfiles. Cheers, Vic

ON DELETE CASCADE behaviour on M2M?

2011-01-17 Thread Victor Hooi
can you set it to ON CASCADE DELETE, as it does for FK? Cheers, Victor -- 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 d

Django Admin - list_display doesn't follow FK links?

2011-01-29 Thread Victor Hooi
http://stackoverflow.com/questions/163823/can-list-display-in-a-django-modeladmin-display-attributes-of-foreignkey-fields And a ticket for it her: http://code.djangoproject.com/ticket/5863 but discussion seems to have petered off. Is there a technical or design reason for this? Cheers, Victor --

Configuration for Nginx and staticfiles

2011-01-31 Thread Victor Hooi
_media/static - I'm not sure why I need two layers of static directories, but I couldn't see a way around this (although I'm undoubtedly missing something obvious here). Also, any recommended changes to Nginx config? Cheers, Victor -- You received this message because you are sub

Templatetag - using date and join together?

2011-02-10 Thread Victor Hooi
much more compact, and I would like to understand what's going on as well, or how to get it to work (assuming there is a way). Thoughts? Thanks, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Sum in html template using template tag

2011-03-11 Thread Victor Harada
Hi You should use {{ list | running_total }} and the filter should look like this: from django.template import Library register = Library() @register.filter def running_total(role_total): return sum( [d.get('total') for d in role_total] ) 2011/3/11 sushanth Reddy > Hi , > > I am trying t

Use django rest framework with dynamoDB

2015-01-15 Thread victor . garcia
I need to create an api-rest with django-rest-framwork for bring data from a database DynamoDB. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+uns

Model with two e-mail fields uniques

2015-04-07 Thread victor menezes
7;someEmail' #same email used by John on email1 field Kane.save() #should raise error because email2 is already used by John on email1 field Thanks Victor Menezes "Geek by nature, Linux by choice" -- You received this message because you are subscribed to the Google Groups "

Re: Model with two e-mail fields uniques

2015-04-07 Thread victor menezes
, Javier Guerra wrote: > > On Tue, Apr 7, 2015 at 2:20 PM, victor menezes > wrote: > > What would be the best way to make a model with two e-mail fields > uniques? I > > was thinking about writing some validation in the save() method but > would > > like to know

Re: Model with two e-mail fields uniques

2015-04-07 Thread victor menezes
= models.CharField(max_length=100) emails = models.ManyToManyField(Email, null=False, blank=False) def __unicode__(self): return self.last_name + ', ' + self.first_name On Tuesday, April 7, 2015 at 6:48:22 PM UTC-4, victor menezes wrote: > > Thanks for th

Re: Model with two e-mail fields uniques

2015-04-08 Thread victor menezes
> if self.emails.count() == 0: > raise ValueError("Need at least one email.") > return super(Person, self).save(*args, **kwargs) > > > class Email(models.Model): > person = models.ForeignKey(Person, related_name='emails') > em

ModelForm not creating field with required options

2015-04-24 Thread victor menezes
Hi all, I'm using Django 1.8 and having trouble to because my form does not generate fields with required option even though they have the property "blank=False" in the model. In the example bellow, shouldn't the field "description" have the "required" attribute in the html generated using "for

Re: Passing an image to the other url?

2015-06-23 Thread victor rocha
Jeremy, Extending a template do not magically gives you access to the context variables the other template has. The context is set in the view, what's the view for the homepage? You didn't include it in your post. Is the variable images set in there? I recommend using django debug toolbar to h

How to keep backwards campabilities when upgradeing django to 1.7

2014-11-12 Thread Victor Liu
Best Regards Victor Liu -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email

Using filter_horizontal with InlineAdmin - should work, right?

2014-04-07 Thread Victor Hooi
endance, and in that, use a filter_horizontal widget for "subjects". However, currently, AttendanceAdmin on it's own has the filter_horizontal, but the inline does not. This ticket seems to imply it should work: https://code.djangoproject.com/ticket/8292 hence I'm assuming I&#x

Re: I can't run django server nor activate the virtualenv

2014-04-28 Thread Victor Hooi
Hi Fred, Are there any lines *below* the error message you pasted? The last line I can see is: File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", > line 40, in import_module __import__(name) Is there anything else? Cheers, Victor On Monday, 28 Apr

Display objects in a respective html page

2017-12-22 Thread Victor Santos
Hi everyone. I am trying to make a project which have an app named pet, in this app in the model I have "choice field"(I don't know if this is the best way to say that). So, I want to display the objects according to the choice value in a respective template. Therefore if I put meat with food "

How to detect deadlocks?

2016-10-03 Thread Victor Porton
How to detect deadlocks of a transaction? Which exception is thrown if a deadlock happens? We currently use SQLite and MySQL but may switch to another DB. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

An almost reusable app, how to make it reusable?

2016-10-03 Thread Victor Porton
I've created an app which is "almost" reusable: it depends on a variable in /setting.py of our project . from .settings import TRANSACTION_ATTEMPT_COUNT Can it be made into an reusable app? -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Testing a reusable app which uses a database

2016-10-03 Thread Victor Porton
I try to make a reusable app which uses transaction.atomic(). When I run my test.py (below) for my reusable app, I get the below errors. Is it possible to test this reusable app outside of a Django project? [[[ import unittest from transaction_utils.transaction import retry class TestRetry(uni

Re: Testing a reusable app which uses a database

2016-10-03 Thread Victor Porton
Well, I did it. On Monday, October 3, 2016 at 10:41:59 PM UTC+3, Victor Porton wrote: > > I try to make a reusable app which uses transaction.atomic(). > > When I run my test.py (below) for my reusable app, I get the below errors. > > Is it possible to test this reusable app o

Add rows in migrations?

2016-10-04 Thread Victor Porton
After generating DB scheme, I need to add two rows with certain data to certain table. How to do it? Can it be handled with migrations? A complication is that these two rows contain strings dependent on the user's language. Can this be done? -- You received this message because you are subs

Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2016-11-08 Thread Victor Hooi
pression using profile models is less invasive). Regards, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroup

REST Framework alternatives

2019-02-05 Thread Victor Porton
My buddy says that REST Framework is complex and inflexible. So the question: Any other framework which supports validating JSON data? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

Django-Photologue - error deleting a photo

2019-02-11 Thread victor rizo
Hello everyone. I am desperate trying to find a solution for this issue... ProgrammingError at /admin/photologue/photo/ column photologue_gallery_photos.sort_value does not exist LINE 1: ...lery_id", "photologue_gallery_photos"."photo_id", "photologu... It is happening every time I try to dele

Give advice on data migrations

2019-05-10 Thread Victor Porton
Give advice: After migrating data, should I remove old fields immediately or after I change the views and forms to use new models instead of old ones? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop recei

How to report data migration error?

2019-05-23 Thread Victor Porton
Which exception should be raised if my data migration code finds that the data in the DB has a logical error and cannot be migrated for this reason? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

How to migrate MySQL -> PostgreSQL?

2019-06-03 Thread Victor Porton
How to migrate a production database MySQL -> PostgreSQL? (MySQL has several bugs, I want to try something other on my production server.) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Vicious cycle: Cannot migrate a DB that uses a widget using a model

2019-06-19 Thread Victor Porton
When I try to migrate my project from empty DB state, it falls into a vicious cycle: Trying to migrate it requests Country.objects.all() because it has form fields using PlaceWidget but this requires it to be already migrated. How to solve this problem? class PlaceWidget(widgets.MultiWidget):

Check if all boolean values are the same (database)

2017-02-14 Thread Victor Porton
# May contain several purchases class Transaction(models.Model): name = models.CharField(null=True) class Purchase(models.Model): bundle = models.ForeignKey(Transaction, null=True) recurring = models.BooleanField(default=False) For a given transaction, all its purchases must either al

Make a separate table for a model without additional fields

2017-05-01 Thread Victor Porton
I store into the DB payments received through PayPal. Every payment is either manual or automatic (automatic payments are done for the user by PayPal automatically, based on user's permission to pay in the future). I wish to distinguish manual and automatic payments in the DB. But in the follow

Python package to accept payments in Internet

2017-05-02 Thread Victor Porton
I have created a full featured package to accept payments in Internet (currently supports PayPal). It has especially great support for recurring payments. Here it is: http://freesoft.portonvictor.org/django-debits.xml I hope we with community work will turn it into an universal payment gateway

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-14 Thread Victor Hooi
anage multiple types of users? The docs mention adding an inline to UserAdmin - however, this seems to assume you only have one model with a user profile - what if you have multiple? Regards, Victor On Monday, 14 November 2016 04:57:53 UTC+11, me.vineetkothari wrote: > > Use one to many f

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-18 Thread Victor Hooi
with Google Admin well? Ideally we'd want different sections to edit teachers, vs students vs parents - but not sure if this is possible. On Wed, 14 Jun 2017 at 21:45 Mike Dewhirst wrote: > On 14/06/2017 8:59 PM, Victor Hooi wrote: > > Resurrecting a slightly old thread =), but

If you have multiple custom users - what should you set AUTH_USER_MODEL to?

2017-06-18 Thread Victor Hooi
it to? Regards, Victor -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email

is there any way to dump all sqlmigrations automatically ?

2017-08-22 Thread Victor Wang
use "sqlmigrate " is too ineffective to get all sql script to setup new database . is there anyway to dump all "sqlmigrate" for all apps ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

How to create multipage forms with different models

2020-03-02 Thread victor awakan
I am a building a small project in Django. I am able to create two or more forms in a template but now, I want to split the form to separate templates with each form belong to different models. How can I achieve this? Here is a link to dpaste with the multiple forms in a template I created: htt

<    1   2   3   4   >