Best practice for serving restricted or premium media

2010-04-20 Thread Brad Buran
I'm currently researching Django as a potential framework for a web application I am building. We plan to make a variety of media (images and videos) free on our website; however, we want to have some premium media available only when certain criteria are met (e.g. the logged-in user is of a certa

Re: Best practice for serving restricted or premium media

2010-04-21 Thread Brad Buran
approaches, but I can now use Google to find and review some tutorials regarding each of these. Will they all work on shared hosting? Brad On Tue, Apr 20, 2010 at 10:50 PM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > On Apr 21, 12:09 pm, Brad Buran wrote: > > I

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

2010-04-23 Thread Brad Buran
Is there any easy way of generating dummy content for models in Django? As I'm learning how to use Django, I often find myself deleting the sqlite database and running syncdb each time (rather than dealing with the issues of manual schema migration each time I make a change to my models). As part

best practice for widget that edits multiple model fields

2010-07-20 Thread Brad Buran
I have a group of fields (date_start, date_end, all_day) that I would like to reuse in several models. I've defined a MultiWidget that displays two split datetime fields plus a checkbox (for the all_day toggle). However, I'm not sure how to get the MultiWidget to set the value of these three fiel

Re: best practice for widget that edits multiple model fields

2010-07-21 Thread Brad Buran
elds/#howto-custom-model-fields > > On Jul 20, 10:00 pm, Brad Buran wrote: > > I have a group of fields (date_start, date_end, all_day) that I would > like > > to reuse in several models. I've defined a MultiWidget that displays two > > split datetime fields plus a ch

Re: best practice for widget that edits multiple model fields

2010-07-21 Thread Brad Buran
tom-model-fields > > On Jul 20, 10:00 pm, Brad Buran wrote: > > I have a group of fields (date_start, date_end, all_day) that I would > like > > to reuse in several models. I've defined a MultiWidget that displays two > > split datetime fields plus a checkbo

Sorting related model

2010-09-11 Thread Brad Buran
Given the following two models forming the base of a wiki-style app: class Page(models.Model): current_revision = models.IntegerField() class PageContent(models.Model): page = models.ForeignKey(Page) revision = models.IntegerField() created = models.DateTimeField() Here, we have

problem reversing namespaced URL (application instance not recognized?)

2010-10-17 Thread Brad Buran
I'm trying to reuse a wiki app twice in my project; however, whenever I call the reverse function, it returns the URL of the first instance defined in my urls.conf. I have attempted specifying the view name as app_instance:view_name, app_name:view_name as well as using the current_app keyword of t

Re: problem reversing namespaced URL (application instance not recognized?)

2010-10-17 Thread Brad Buran
x27;test.wiki.urls', app_name='wiki', namespace='help'). Sorry for the trouble, Brad On Sun, Oct 17, 2010 at 6:14 PM, Brad Buran wrote: > I'm trying to reuse a wiki app twice in my project; however, whenever I > call the reverse function, it returns the

Implementing query with Django ORM - left join with length() and replace() functions

2013-04-05 Thread Brad Buran
I'm trying to replicate a query using Django's ORM; however, I'm having a bit of difficulty figuring out how to accomplish it. The model that I'm querying is defined as: class Word(models.Model): objects = WordManager() spelling = models.CharField(max_length=128) ipa = models.Char

Replicating complex query with two dense_rank() functions using ORM

2020-11-03 Thread Brad Buran
I have a "puzzle of the day" that users can answer. I track the puzzle of the day using the Puzzle model. I track the answers using the PuzzleAnswer model. I would like to calculate the number of consecutive puzzles a particular user (i.e., the author) gets right in a row. The current SQL I use