Ticket #5930: 5930.patch

File 5930.patch, 1.4 KB (added by Nick Lane, 16 years ago)
  • docs/custom_model_fields.txt

    diff -r 06d5a1dd16af docs/custom_model_fields.txt
    a b would like to be able to things like thi  
    5656
    5757We assign to and retrieve from the ``hand`` attribute in our model just like
    5858any other Python class. The trick is to tell Django how to handle saving and
    59 loading such an object
     59loading such an object.
    6060
    6161In order to use the ``Hand`` class in our models, we **do not** have to change
    6262this class at all. This is ideal, because it means you can easily write
    characters by concatenating all the card  
    9898characters by concatenating all the cards together in a pre-determined order.
    9999Say, all the *north* cards first, then the *east*, *south* and *west* cards, in
    100100that order. So ``Hand`` objects can be saved to text or character columns in
    101 the database
     101the database.
    102102
    103103What does a field class do?
    104104---------------------------
    Some general advice  
    549549Some general advice
    550550--------------------
    551551
    552 Writing a custom field can be a tricky process sometime, particularly if you
     552Writing a custom field can be a tricky process sometimes, particularly if you
    553553are doing complex conversions between your Python types and your database and
    554554serialization formats. A couple of tips to make things go more smoothly:
    555555
Back to Top